cxxtools-3.0/0000775000175000017500000000000013672344761010257 500000000000000cxxtools-3.0/Makefile.in0000664000175000017500000007643413644433103012246 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = include/cxxtools/config.h cxxtools-config \ pkgconfig/cxxtools-bin.pc pkgconfig/cxxtools-http.pc \ pkgconfig/cxxtools-json.pc pkgconfig/cxxtools.pc \ pkgconfig/cxxtools-unit.pc pkgconfig/cxxtools-xmlrpc.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(bin_SCRIPTS) 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 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 DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck 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 CSCOPE = cscope DIST_SUBDIRS = src src/unit src/http src/xmlrpc src/bin src/json \ include tools demo demo/async demo/ssl test am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/cxxtools-config.in \ $(top_srcdir)/include/cxxtools/config.h.in \ $(top_srcdir)/pkgconfig/cxxtools-bin.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-http.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-json.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-unit.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-xmlrpc.pc.in \ $(top_srcdir)/pkgconfig/cxxtools.pc.in AUTHORS COPYING \ ChangeLog INSTALL NEWS README compile config.guess config.sub \ install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 @MAKE_DEMOS_TRUE@DEMO_DIR = demo demo/async demo/ssl @MAKE_UNITTEST_TRUE@UNITTEST_DIR = test SUBDIRS = src \ src/unit \ src/http \ src/xmlrpc \ src/bin \ src/json \ include \ tools \ $(DEMO_DIR) $(UNITTEST_DIR) bin_SCRIPTS = cxxtools-config pkgconfigdir = $(libdir)/pkgconfig/ pkgconfig_DATA = pkgconfig/cxxtools-bin.pc \ pkgconfig/cxxtools-http.pc \ pkgconfig/cxxtools-json.pc \ pkgconfig/cxxtools.pc \ pkgconfig/cxxtools-unit.pc \ pkgconfig/cxxtools-xmlrpc.pc all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): include/cxxtools/config.h: $(top_builddir)/config.status $(top_srcdir)/include/cxxtools/config.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ cxxtools-config: $(top_builddir)/config.status $(srcdir)/cxxtools-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-bin.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-bin.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-http.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-http.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-json.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-json.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-unit.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-unit.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-xmlrpc.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-xmlrpc.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # 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. $(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//`; \ 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; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist 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 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || 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; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS 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-pkgconfigDATA 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 uninstall-binSCRIPTS \ uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/NEWS0000664000175000017500000000000013644433072010655 00000000000000cxxtools-3.0/Makefile.am0000664000175000017500000000103313644433072012221 00000000000000ACLOCAL_AMFLAGS = -I m4 if MAKE_DEMOS DEMO_DIR = demo demo/async demo/ssl endif if MAKE_UNITTEST UNITTEST_DIR = test endif SUBDIRS = src \ src/unit \ src/http \ src/xmlrpc \ src/bin \ src/json \ include \ tools \ $(DEMO_DIR) $(UNITTEST_DIR) bin_SCRIPTS = cxxtools-config pkgconfigdir = $(libdir)/pkgconfig/ pkgconfig_DATA = pkgconfig/cxxtools-bin.pc \ pkgconfig/cxxtools-http.pc \ pkgconfig/cxxtools-json.pc \ pkgconfig/cxxtools.pc \ pkgconfig/cxxtools-unit.pc \ pkgconfig/cxxtools-xmlrpc.pc cxxtools-3.0/ltmain.sh0000644000175000017500000117106713644433101012014 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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, either version 3 of the License, or # (at your option) any later version. # 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: cxxtools-3.0/tools/0000775000175000017500000000000013672344760011416 500000000000000cxxtools-3.0/tools/Makefile.in0000664000175000017500000005216013644433103013374 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = siconvert$(EXEEXT) cxxtz$(EXEEXT) subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_cxxtz_OBJECTS = cxxtz.$(OBJEXT) cxxtz_OBJECTS = $(am_cxxtz_OBJECTS) cxxtz_DEPENDENCIES = $(BASE_LIBS) 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_siconvert_OBJECTS = siconvert.$(OBJEXT) siconvert_OBJECTS = $(am_siconvert_OBJECTS) siconvert_DEPENDENCIES = $(BIN_LIBS) 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cxxtz.Po ./$(DEPDIR)/siconvert.Po am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(cxxtz_SOURCES) $(siconvert_SOURCES) DIST_SOURCES = $(cxxtz_SOURCES) $(siconvert_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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ siconvert_SOURCES = siconvert.cpp cxxtz_SOURCES = cxxtz.cpp BASE_LIBS = $(top_builddir)/src/libcxxtools.la HTTP_LIBS = $(BASE_LIBS) $(top_builddir)/src/http/libcxxtools-http.la XMLRPC_LIBS = $(HTTP_LIBS) $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la BIN_LIBS = $(BASE_LIBS) $(top_builddir)/src/bin/libcxxtools-bin.la JSON_LIBS = $(HTTP_LIBS) $(top_builddir)/src/json/libcxxtools-json.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = $(top_builddir)/src/libcxxtools.la siconvert_LDADD = $(BIN_LIBS) cxxtz_LDADD = $(BASE_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cxxtz$(EXEEXT): $(cxxtz_OBJECTS) $(cxxtz_DEPENDENCIES) $(EXTRA_cxxtz_DEPENDENCIES) @rm -f cxxtz$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(cxxtz_OBJECTS) $(cxxtz_LDADD) $(LIBS) siconvert$(EXEEXT): $(siconvert_OBJECTS) $(siconvert_DEPENDENCIES) $(EXTRA_siconvert_DEPENDENCIES) @rm -f siconvert$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(siconvert_OBJECTS) $(siconvert_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cxxtz.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siconvert.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cxxtz.Po -rm -f ./$(DEPDIR)/siconvert.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cxxtz.Po -rm -f ./$(DEPDIR)/siconvert.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool 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-binPROGRAMS \ 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 uninstall-binPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/tools/Makefile.am0000664000175000017500000000114713644433072013367 00000000000000bin_PROGRAMS = \ siconvert \ cxxtz siconvert_SOURCES = siconvert.cpp cxxtz_SOURCES = cxxtz.cpp BASE_LIBS = $(top_builddir)/src/libcxxtools.la HTTP_LIBS = $(BASE_LIBS) $(top_builddir)/src/http/libcxxtools-http.la XMLRPC_LIBS = $(HTTP_LIBS) $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la BIN_LIBS = $(BASE_LIBS) $(top_builddir)/src/bin/libcxxtools-bin.la JSON_LIBS = $(HTTP_LIBS) $(top_builddir)/src/json/libcxxtools-json.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = $(top_builddir)/src/libcxxtools.la siconvert_LDADD = $(BIN_LIBS) cxxtz_LDADD = $(BASE_LIBS) cxxtools-3.0/tools/cxxtz.cpp0000664000175000017500000000774113644433072013225 00000000000000#include #include #include #include int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg help(argc, argv, '?'); if (help || argc == 1) { std::cerr << "Usage: " << argv[0] << " {options} {times}\n" "\n" "Synopsis:\n" "current time in time zone Pacific/Nauru\n" " " << argv[0] << " -c -z Pacific/Nauru\n" "dump information about the current time zone\n" " " << argv[0] << " -d\n" "output some GMT times in the time zone\n" " " << argv[0] << " '2017-03-26 01:00:00' '2017-03-26 00:59:59'\n" "\n" "Options:\n" " -a list all valid time zones\n" " -z specify time zone (default: system time zone)\n" " -Z output time zone of the system\n" " -d dump time zone informations\n" " -c output current time in the specified time zone\n" " -u print current utc time\n" " -r reverse\n" " -e early flag (with -r take earlier time if ambiguous)\n" " -l late flag (with -r take later time if ambiguous)\n" " -v output previous and next change of dst\n"; } cxxtools::Arg timeZone(argc, argv, 'z', cxxtools::Tz::currentZone()); cxxtools::Tz tz(timeZone); cxxtools::Arg dump(argc, argv, 'd'); cxxtools::Arg listAll(argc, argv, 'a'); cxxtools::Arg currentTime(argc, argv, 'c'); cxxtools::Arg utc(argc, argv, 'u'); cxxtools::Arg currentTimeZone(argc, argv, 'Z'); cxxtools::Arg reverse(argc, argv, 'r'); cxxtools::Arg early(argc, argv, 'e'); cxxtools::Arg late(argc, argv, 'l'); cxxtools::Arg verbose(argc, argv, 'v'); // show previous and next change if (dump) { std::cout << timeZone.getValue() << '\n'; tz.dump(std::cout); } if (listAll) { auto l = cxxtools::Tz::getTimeZones(); for (auto z: l) std::cout << z << '\n'; } if (currentTime) { std::cout << tz.toLocal(cxxtools::DateTime::gmtime()).toString() << '\n'; } if (utc) { std::cout << cxxtools::DateTime::gmtime().toString() << '\n'; } if (currentTimeZone) { std::cout << cxxtools::Tz::currentZone() << '\n'; } for (int a = 1; a < argc; ++a) { cxxtools::DateTime dt(argv[a]); if (reverse) { cxxtools::UtcDateTime dtz; if (early) dtz = tz.toUtc(cxxtools::LocalDateTime(dt), 1); else if (late) dtz = tz.toUtc(cxxtools::LocalDateTime(dt), 0); else dtz = tz.toUtc(cxxtools::LocalDateTime(dt)); std::cout << dtz.toString() << '\n'; } else { auto dtz = tz.toLocal(cxxtools::UtcDateTime(dt)); std::cout << dtz.toString() << ' ' << dtz.tzName() << ' ' << dtz.isdst(); if (verbose) std::cout << " previous change: " << tz.previousChange(dtz).toString() << " next change: " << tz.nextChange(dtz).toString(); std::cout << '\n'; } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/tools/siconvert.cpp0000664000175000017500000002073013644433072014052 00000000000000/* * Copyright (C) 2018 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Usage { }; class Siconvert { bool inputBin; bool inputXml; bool inputJson; bool inputIni; bool inputCsv; bool inputQparams; bool inputSettings; bool outputBin; bool outputXml; bool outputXmlCompact; bool outputJson; bool outputIni; bool outputCsv; bool outputProperties; bool outputCount; bool beautify; unsigned skip; unsigned num; unsigned count; public: Siconvert(int& argc, char* argv[]); void convert(std::istream& in, std::ostream& out); bool docontinue() const { return num > 0; } void finish() const; }; Siconvert::Siconvert(int& argc, char* argv[]) : inputBin(cxxtools::Arg(argc, argv, 'b')), inputXml(cxxtools::Arg(argc, argv, 'x')), inputJson(cxxtools::Arg(argc, argv, 'j')), inputIni(cxxtools::Arg(argc, argv, 'i')), inputCsv(cxxtools::Arg(argc, argv, 'c')), inputQparams(cxxtools::Arg(argc, argv, 'q')), inputSettings(cxxtools::Arg(argc, argv, 's')), outputBin(cxxtools::Arg(argc, argv, 'B')), outputXml(cxxtools::Arg(argc, argv, 'X')), outputXmlCompact(cxxtools::Arg(argc, argv, 'Y')), outputJson(cxxtools::Arg(argc, argv, 'J')), outputIni(cxxtools::Arg(argc, argv, 'I')), outputCsv(cxxtools::Arg(argc, argv, 'C')), outputProperties(cxxtools::Arg(argc, argv, 'P')), outputCount(cxxtools::Arg(argc, argv, 'N')), beautify(cxxtools::Arg(argc, argv, 'd')), skip(cxxtools::Arg(argc, argv, "--skip")), num(cxxtools::Arg(argc, argv, "--num", std::numeric_limits::max())), count(0) { unsigned c; c = 0; if (inputBin) ++c; if (inputXml) ++c; if (inputJson) ++c; if (inputIni) ++c; if (inputCsv) ++c; if (inputQparams) ++c; if (inputSettings) ++c; if (c != 1) { std::cerr << "one input format must be specified" << std::endl; throw Usage(); } c = 0; if (outputBin) ++c; if (outputXml) ++c; if (outputXmlCompact) ++c; if (outputJson) ++c; if (outputIni) ++c; if (outputCsv) ++c; if (outputProperties) ++c; if (outputCount) ++c; if (c != 1) { std::cerr << "one output format must be specified" << std::endl; throw Usage(); } } void Siconvert::convert(std::istream& in, std::ostream& out) { cxxtools::SerializationInfo si; if (inputBin) in >> cxxtools::bin::Bin(si); else if (inputXml) in >> cxxtools::xml::Xml(si); else if (inputJson) in >> cxxtools::Json(si); else if (inputIni) in >> cxxtools::Ini(si); else if (inputCsv) in >> cxxtools::Csv(si); else if (inputQparams) { cxxtools::QueryParams q; in >> q; si <<= q; } else if (inputSettings) { cxxtools::Settings settings; cxxtools::TextIStream tin(in, new cxxtools::Utf8Codec()); settings.load(tin); si = settings; } if (skip == 0) { if (outputBin) out << cxxtools::bin::Bin(si); else if (outputXml) out << cxxtools::xml::Xml(si, "root").beautify(beautify); else if (outputXmlCompact) out << cxxtools::xml::Xml(si, "root").beautify(beautify).useAttributes(false); else if (outputJson) out << cxxtools::Json(si).beautify(beautify); else if (outputIni) out << cxxtools::Ini(si); else if (outputCsv) out << cxxtools::Csv(si); else if (outputProperties) out << cxxtools::Properties(si); if (num > 0 && num != std::numeric_limits::max()) --num; ++count; } else { --skip; } } void Siconvert::finish() const { if (outputCount) std::cout << count << std::endl; } int main(int argc, char* argv[]) { try { log_init(); cxxtools::ArgOut out(argc, argv, 'o'); cxxtools::Arg verbose(argc, argv, 'v'); Siconvert app(argc, argv); if (argc > 1) { for (int a = 1; a < argc; ++a) { if (verbose) std::cerr << "process " << a << " <" << argv[a] << '>' << std::endl; std::ifstream in(argv[a]); do { app.convert(in, out); } while (app.docontinue() && in.peek() != std::char_traits::eof()); } } else { do { app.convert(std::cin, out); } while (app.docontinue() && std::cin.peek() != std::char_traits::eof()); } app.finish(); } catch (Usage) { std::cerr << "Usage: " << argv[0] << " {options} [inputfiles...]\n\n" "Description:\n" " Converts data using cxxtools serialization from one format to another.\n" " When no inputfile is given, data is read from stdin.\n\n" "Options for input format:\n" " -b read binary data\n" " -x read xml data\n" " -j read json data\n" " -i read ini data\n" " -c read csv data\n" " -q read url query string\n" " -s read settings data\n" "\n" "Options for output format:\n" " -B output binary data\n" " -X output xml data\n" " -Y output xml data without attributes\n" " -J output json data\n" " -I output ini data\n" " -C output csv data\n" " -P output properties data\n" " -N output number of objects\n" " -d beautify output (xml, json)\n" "\n" "Other options:\n" " --skip skip objects\n" " --num read objects (default unlimited)\n" " -v verbose - output filename to stderr when processing\n" " -o output to file\n"; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/install-sh0000755000175000017500000003601013644433103012165 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: cxxtools-3.0/cxxtools-config.in0000664000175000017500000000637113644433072013655 00000000000000#! /bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ usage() { cat 1>&2 < INFO ++APP++ INFO EOF } CXXTOOLS_LOGGING_CXXTOOLS_template_properties() { cat <&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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = alltests$(EXEEXT) foo$(EXEEXT) logbench$(EXEEXT) \ serializer-bench$(EXEEXT) rpcbenchclient$(EXEEXT) \ rpcbenchasyncclient$(EXEEXT) rpcbenchserver$(EXEEXT) @MAKE_ICONVSTREAM_TRUE@am__append_1 = \ @MAKE_ICONVSTREAM_TRUE@ iconvstream-test.cpp subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__alltests_SOURCES_DIST = arg-test.cpp base64-test.cpp \ binrpc-test.cpp binserializer-test.cpp cache-test.cpp \ clock-test.cpp csvdeserializer-test.cpp csvserializer-test.cpp \ convert-test.cpp date-test.cpp datetime-test.cpp \ envsubst-test.cpp eventloop-test.cpp file-test.cpp \ inifile-test.cpp iniparser-test.cpp iniserialization-test.cpp \ iso8859_1-test.cpp iso8859_15-test.cpp join-test.cpp \ json-test.cpp jsondeserializer-test.cpp jsonrpc-test.cpp \ jsonrpchttp-test.cpp jsonserializer-test.cpp \ limitstream-test.cpp logconfiguration-test.cpp \ lrucache-test.cpp mime-test.cpp md5-test.cpp pool-test.cpp \ properties-test.cpp propertiesserializer-test.cpp \ ptrstream-test.cpp query_params-test.cpp \ quotedprintable-test.cpp regex-test.cpp \ scopedincrement-test.cpp serialization-test.cpp \ serializationinfo-test.cpp smartptr-test.cpp split-test.cpp \ string-test.cpp test-main.cpp time-test.cpp timespan-test.cpp \ trim-test.cpp tz-test.cpp utf8-test.cpp uri-test.cpp \ win1252-test.cpp xmlreader-test.cpp xmlrpc-test.cpp \ xmlrpccallback-test.cpp xmldeserializer-test.cpp \ xmlserializer-test.cpp iconvstream-test.cpp @MAKE_ICONVSTREAM_TRUE@am__objects_1 = iconvstream-test.$(OBJEXT) am_alltests_OBJECTS = arg-test.$(OBJEXT) base64-test.$(OBJEXT) \ binrpc-test.$(OBJEXT) binserializer-test.$(OBJEXT) \ cache-test.$(OBJEXT) clock-test.$(OBJEXT) \ csvdeserializer-test.$(OBJEXT) csvserializer-test.$(OBJEXT) \ convert-test.$(OBJEXT) date-test.$(OBJEXT) \ datetime-test.$(OBJEXT) envsubst-test.$(OBJEXT) \ eventloop-test.$(OBJEXT) file-test.$(OBJEXT) \ inifile-test.$(OBJEXT) iniparser-test.$(OBJEXT) \ iniserialization-test.$(OBJEXT) iso8859_1-test.$(OBJEXT) \ iso8859_15-test.$(OBJEXT) join-test.$(OBJEXT) \ json-test.$(OBJEXT) jsondeserializer-test.$(OBJEXT) \ jsonrpc-test.$(OBJEXT) jsonrpchttp-test.$(OBJEXT) \ jsonserializer-test.$(OBJEXT) limitstream-test.$(OBJEXT) \ logconfiguration-test.$(OBJEXT) lrucache-test.$(OBJEXT) \ mime-test.$(OBJEXT) md5-test.$(OBJEXT) pool-test.$(OBJEXT) \ properties-test.$(OBJEXT) propertiesserializer-test.$(OBJEXT) \ ptrstream-test.$(OBJEXT) query_params-test.$(OBJEXT) \ quotedprintable-test.$(OBJEXT) regex-test.$(OBJEXT) \ scopedincrement-test.$(OBJEXT) serialization-test.$(OBJEXT) \ serializationinfo-test.$(OBJEXT) smartptr-test.$(OBJEXT) \ split-test.$(OBJEXT) string-test.$(OBJEXT) test-main.$(OBJEXT) \ time-test.$(OBJEXT) timespan-test.$(OBJEXT) \ trim-test.$(OBJEXT) tz-test.$(OBJEXT) utf8-test.$(OBJEXT) \ uri-test.$(OBJEXT) win1252-test.$(OBJEXT) \ xmlreader-test.$(OBJEXT) xmlrpc-test.$(OBJEXT) \ xmlrpccallback-test.$(OBJEXT) xmldeserializer-test.$(OBJEXT) \ xmlserializer-test.$(OBJEXT) $(am__objects_1) alltests_OBJECTS = $(am_alltests_OBJECTS) alltests_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la \ $(top_builddir)/src/unit/libcxxtools-unit.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.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_foo_OBJECTS = foo.$(OBJEXT) foo_OBJECTS = $(am_foo_OBJECTS) foo_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_logbench_OBJECTS = logbench.$(OBJEXT) logbench_OBJECTS = $(am_logbench_OBJECTS) logbench_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_rpcbenchasyncclient_OBJECTS = rpcbenchasyncclient.$(OBJEXT) rpcbenchasyncclient_OBJECTS = $(am_rpcbenchasyncclient_OBJECTS) rpcbenchasyncclient_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la am_rpcbenchclient_OBJECTS = rpcbenchclient.$(OBJEXT) rpcbenchclient_OBJECTS = $(am_rpcbenchclient_OBJECTS) rpcbenchclient_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la am_rpcbenchserver_OBJECTS = rpcbenchserver.$(OBJEXT) rpcbenchserver_OBJECTS = $(am_rpcbenchserver_OBJECTS) rpcbenchserver_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la am_serializer_bench_OBJECTS = serializer-bench.$(OBJEXT) serializer_bench_OBJECTS = $(am_serializer_bench_OBJECTS) serializer_bench_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/arg-test.Po \ ./$(DEPDIR)/base64-test.Po ./$(DEPDIR)/binrpc-test.Po \ ./$(DEPDIR)/binserializer-test.Po ./$(DEPDIR)/cache-test.Po \ ./$(DEPDIR)/clock-test.Po ./$(DEPDIR)/convert-test.Po \ ./$(DEPDIR)/csvdeserializer-test.Po \ ./$(DEPDIR)/csvserializer-test.Po ./$(DEPDIR)/date-test.Po \ ./$(DEPDIR)/datetime-test.Po ./$(DEPDIR)/envsubst-test.Po \ ./$(DEPDIR)/eventloop-test.Po ./$(DEPDIR)/file-test.Po \ ./$(DEPDIR)/foo.Po ./$(DEPDIR)/iconvstream-test.Po \ ./$(DEPDIR)/inifile-test.Po ./$(DEPDIR)/iniparser-test.Po \ ./$(DEPDIR)/iniserialization-test.Po \ ./$(DEPDIR)/iso8859_1-test.Po ./$(DEPDIR)/iso8859_15-test.Po \ ./$(DEPDIR)/join-test.Po ./$(DEPDIR)/json-test.Po \ ./$(DEPDIR)/jsondeserializer-test.Po \ ./$(DEPDIR)/jsonrpc-test.Po ./$(DEPDIR)/jsonrpchttp-test.Po \ ./$(DEPDIR)/jsonserializer-test.Po \ ./$(DEPDIR)/limitstream-test.Po ./$(DEPDIR)/logbench.Po \ ./$(DEPDIR)/logconfiguration-test.Po \ ./$(DEPDIR)/lrucache-test.Po ./$(DEPDIR)/md5-test.Po \ ./$(DEPDIR)/mime-test.Po ./$(DEPDIR)/pool-test.Po \ ./$(DEPDIR)/properties-test.Po \ ./$(DEPDIR)/propertiesserializer-test.Po \ ./$(DEPDIR)/ptrstream-test.Po ./$(DEPDIR)/query_params-test.Po \ ./$(DEPDIR)/quotedprintable-test.Po ./$(DEPDIR)/regex-test.Po \ ./$(DEPDIR)/rpcbenchasyncclient.Po \ ./$(DEPDIR)/rpcbenchclient.Po ./$(DEPDIR)/rpcbenchserver.Po \ ./$(DEPDIR)/scopedincrement-test.Po \ ./$(DEPDIR)/serialization-test.Po \ ./$(DEPDIR)/serializationinfo-test.Po \ ./$(DEPDIR)/serializer-bench.Po ./$(DEPDIR)/smartptr-test.Po \ ./$(DEPDIR)/split-test.Po ./$(DEPDIR)/string-test.Po \ ./$(DEPDIR)/test-main.Po ./$(DEPDIR)/time-test.Po \ ./$(DEPDIR)/timespan-test.Po ./$(DEPDIR)/trim-test.Po \ ./$(DEPDIR)/tz-test.Po ./$(DEPDIR)/uri-test.Po \ ./$(DEPDIR)/utf8-test.Po ./$(DEPDIR)/win1252-test.Po \ ./$(DEPDIR)/xmldeserializer-test.Po \ ./$(DEPDIR)/xmlreader-test.Po ./$(DEPDIR)/xmlrpc-test.Po \ ./$(DEPDIR)/xmlrpccallback-test.Po \ ./$(DEPDIR)/xmlserializer-test.Po am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(alltests_SOURCES) $(foo_SOURCES) $(logbench_SOURCES) \ $(rpcbenchasyncclient_SOURCES) $(rpcbenchclient_SOURCES) \ $(rpcbenchserver_SOURCES) $(serializer_bench_SOURCES) DIST_SOURCES = $(am__alltests_SOURCES_DIST) $(foo_SOURCES) \ $(logbench_SOURCES) $(rpcbenchasyncclient_SOURCES) \ $(rpcbenchclient_SOURCES) $(rpcbenchserver_SOURCES) \ $(serializer_bench_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = \ color.h AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include alltests_SOURCES = arg-test.cpp base64-test.cpp binrpc-test.cpp \ binserializer-test.cpp cache-test.cpp clock-test.cpp \ csvdeserializer-test.cpp csvserializer-test.cpp \ convert-test.cpp date-test.cpp datetime-test.cpp \ envsubst-test.cpp eventloop-test.cpp file-test.cpp \ inifile-test.cpp iniparser-test.cpp iniserialization-test.cpp \ iso8859_1-test.cpp iso8859_15-test.cpp join-test.cpp \ json-test.cpp jsondeserializer-test.cpp jsonrpc-test.cpp \ jsonrpchttp-test.cpp jsonserializer-test.cpp \ limitstream-test.cpp logconfiguration-test.cpp \ lrucache-test.cpp mime-test.cpp md5-test.cpp pool-test.cpp \ properties-test.cpp propertiesserializer-test.cpp \ ptrstream-test.cpp query_params-test.cpp \ quotedprintable-test.cpp regex-test.cpp \ scopedincrement-test.cpp serialization-test.cpp \ serializationinfo-test.cpp smartptr-test.cpp split-test.cpp \ string-test.cpp test-main.cpp time-test.cpp timespan-test.cpp \ trim-test.cpp tz-test.cpp utf8-test.cpp uri-test.cpp \ win1252-test.cpp xmlreader-test.cpp xmlrpc-test.cpp \ xmlrpccallback-test.cpp xmldeserializer-test.cpp \ xmlserializer-test.cpp $(am__append_1) logbench_SOURCES = logbench.cpp logbench_LDADD = $(top_builddir)/src/libcxxtools.la alltests_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la \ $(top_builddir)/src/unit/libcxxtools-unit.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la serializer_bench_SOURCES = serializer-bench.cpp serializer_bench_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la rpcbenchclient_SOURCES = rpcbenchclient.cpp rpcbenchasyncclient_SOURCES = rpcbenchasyncclient.cpp rpcbenchclient_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la rpcbenchasyncclient_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la rpcbenchserver_SOURCES = rpcbenchserver.cpp rpcbenchserver_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la foo_SOURCES = foo.cpp foo_LDADD = $(top_builddir)/src/libcxxtools.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list alltests$(EXEEXT): $(alltests_OBJECTS) $(alltests_DEPENDENCIES) $(EXTRA_alltests_DEPENDENCIES) @rm -f alltests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(alltests_OBJECTS) $(alltests_LDADD) $(LIBS) foo$(EXEEXT): $(foo_OBJECTS) $(foo_DEPENDENCIES) $(EXTRA_foo_DEPENDENCIES) @rm -f foo$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(foo_OBJECTS) $(foo_LDADD) $(LIBS) logbench$(EXEEXT): $(logbench_OBJECTS) $(logbench_DEPENDENCIES) $(EXTRA_logbench_DEPENDENCIES) @rm -f logbench$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(logbench_OBJECTS) $(logbench_LDADD) $(LIBS) rpcbenchasyncclient$(EXEEXT): $(rpcbenchasyncclient_OBJECTS) $(rpcbenchasyncclient_DEPENDENCIES) $(EXTRA_rpcbenchasyncclient_DEPENDENCIES) @rm -f rpcbenchasyncclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcbenchasyncclient_OBJECTS) $(rpcbenchasyncclient_LDADD) $(LIBS) rpcbenchclient$(EXEEXT): $(rpcbenchclient_OBJECTS) $(rpcbenchclient_DEPENDENCIES) $(EXTRA_rpcbenchclient_DEPENDENCIES) @rm -f rpcbenchclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcbenchclient_OBJECTS) $(rpcbenchclient_LDADD) $(LIBS) rpcbenchserver$(EXEEXT): $(rpcbenchserver_OBJECTS) $(rpcbenchserver_DEPENDENCIES) $(EXTRA_rpcbenchserver_DEPENDENCIES) @rm -f rpcbenchserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcbenchserver_OBJECTS) $(rpcbenchserver_LDADD) $(LIBS) serializer-bench$(EXEEXT): $(serializer_bench_OBJECTS) $(serializer_bench_DEPENDENCIES) $(EXTRA_serializer_bench_DEPENDENCIES) @rm -f serializer-bench$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(serializer_bench_OBJECTS) $(serializer_bench_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binrpc-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvdeserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datetime-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/envsubst-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventloop-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvstream-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inifile-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniparser-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniserialization-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_1-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_15-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/join-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsondeserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonrpc-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonrpchttp-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limitstream-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logbench.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logconfiguration-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lrucache-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propertiesserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrstream-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query_params-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotedprintable-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbenchasyncclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbenchclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbenchserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scopedincrement-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serialization-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializationinfo-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializer-bench.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smartptr-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/split-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespan-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tz-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win1252-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmldeserializer-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlreader-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrpc-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrpccallback-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlserializer-test.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/arg-test.Po -rm -f ./$(DEPDIR)/base64-test.Po -rm -f ./$(DEPDIR)/binrpc-test.Po -rm -f ./$(DEPDIR)/binserializer-test.Po -rm -f ./$(DEPDIR)/cache-test.Po -rm -f ./$(DEPDIR)/clock-test.Po -rm -f ./$(DEPDIR)/convert-test.Po -rm -f ./$(DEPDIR)/csvdeserializer-test.Po -rm -f ./$(DEPDIR)/csvserializer-test.Po -rm -f ./$(DEPDIR)/date-test.Po -rm -f ./$(DEPDIR)/datetime-test.Po -rm -f ./$(DEPDIR)/envsubst-test.Po -rm -f ./$(DEPDIR)/eventloop-test.Po -rm -f ./$(DEPDIR)/file-test.Po -rm -f ./$(DEPDIR)/foo.Po -rm -f ./$(DEPDIR)/iconvstream-test.Po -rm -f ./$(DEPDIR)/inifile-test.Po -rm -f ./$(DEPDIR)/iniparser-test.Po -rm -f ./$(DEPDIR)/iniserialization-test.Po -rm -f ./$(DEPDIR)/iso8859_1-test.Po -rm -f ./$(DEPDIR)/iso8859_15-test.Po -rm -f ./$(DEPDIR)/join-test.Po -rm -f ./$(DEPDIR)/json-test.Po -rm -f ./$(DEPDIR)/jsondeserializer-test.Po -rm -f ./$(DEPDIR)/jsonrpc-test.Po -rm -f ./$(DEPDIR)/jsonrpchttp-test.Po -rm -f ./$(DEPDIR)/jsonserializer-test.Po -rm -f ./$(DEPDIR)/limitstream-test.Po -rm -f ./$(DEPDIR)/logbench.Po -rm -f ./$(DEPDIR)/logconfiguration-test.Po -rm -f ./$(DEPDIR)/lrucache-test.Po -rm -f ./$(DEPDIR)/md5-test.Po -rm -f ./$(DEPDIR)/mime-test.Po -rm -f ./$(DEPDIR)/pool-test.Po -rm -f ./$(DEPDIR)/properties-test.Po -rm -f ./$(DEPDIR)/propertiesserializer-test.Po -rm -f ./$(DEPDIR)/ptrstream-test.Po -rm -f ./$(DEPDIR)/query_params-test.Po -rm -f ./$(DEPDIR)/quotedprintable-test.Po -rm -f ./$(DEPDIR)/regex-test.Po -rm -f ./$(DEPDIR)/rpcbenchasyncclient.Po -rm -f ./$(DEPDIR)/rpcbenchclient.Po -rm -f ./$(DEPDIR)/rpcbenchserver.Po -rm -f ./$(DEPDIR)/scopedincrement-test.Po -rm -f ./$(DEPDIR)/serialization-test.Po -rm -f ./$(DEPDIR)/serializationinfo-test.Po -rm -f ./$(DEPDIR)/serializer-bench.Po -rm -f ./$(DEPDIR)/smartptr-test.Po -rm -f ./$(DEPDIR)/split-test.Po -rm -f ./$(DEPDIR)/string-test.Po -rm -f ./$(DEPDIR)/test-main.Po -rm -f ./$(DEPDIR)/time-test.Po -rm -f ./$(DEPDIR)/timespan-test.Po -rm -f ./$(DEPDIR)/trim-test.Po -rm -f ./$(DEPDIR)/tz-test.Po -rm -f ./$(DEPDIR)/uri-test.Po -rm -f ./$(DEPDIR)/utf8-test.Po -rm -f ./$(DEPDIR)/win1252-test.Po -rm -f ./$(DEPDIR)/xmldeserializer-test.Po -rm -f ./$(DEPDIR)/xmlreader-test.Po -rm -f ./$(DEPDIR)/xmlrpc-test.Po -rm -f ./$(DEPDIR)/xmlrpccallback-test.Po -rm -f ./$(DEPDIR)/xmlserializer-test.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/arg-test.Po -rm -f ./$(DEPDIR)/base64-test.Po -rm -f ./$(DEPDIR)/binrpc-test.Po -rm -f ./$(DEPDIR)/binserializer-test.Po -rm -f ./$(DEPDIR)/cache-test.Po -rm -f ./$(DEPDIR)/clock-test.Po -rm -f ./$(DEPDIR)/convert-test.Po -rm -f ./$(DEPDIR)/csvdeserializer-test.Po -rm -f ./$(DEPDIR)/csvserializer-test.Po -rm -f ./$(DEPDIR)/date-test.Po -rm -f ./$(DEPDIR)/datetime-test.Po -rm -f ./$(DEPDIR)/envsubst-test.Po -rm -f ./$(DEPDIR)/eventloop-test.Po -rm -f ./$(DEPDIR)/file-test.Po -rm -f ./$(DEPDIR)/foo.Po -rm -f ./$(DEPDIR)/iconvstream-test.Po -rm -f ./$(DEPDIR)/inifile-test.Po -rm -f ./$(DEPDIR)/iniparser-test.Po -rm -f ./$(DEPDIR)/iniserialization-test.Po -rm -f ./$(DEPDIR)/iso8859_1-test.Po -rm -f ./$(DEPDIR)/iso8859_15-test.Po -rm -f ./$(DEPDIR)/join-test.Po -rm -f ./$(DEPDIR)/json-test.Po -rm -f ./$(DEPDIR)/jsondeserializer-test.Po -rm -f ./$(DEPDIR)/jsonrpc-test.Po -rm -f ./$(DEPDIR)/jsonrpchttp-test.Po -rm -f ./$(DEPDIR)/jsonserializer-test.Po -rm -f ./$(DEPDIR)/limitstream-test.Po -rm -f ./$(DEPDIR)/logbench.Po -rm -f ./$(DEPDIR)/logconfiguration-test.Po -rm -f ./$(DEPDIR)/lrucache-test.Po -rm -f ./$(DEPDIR)/md5-test.Po -rm -f ./$(DEPDIR)/mime-test.Po -rm -f ./$(DEPDIR)/pool-test.Po -rm -f ./$(DEPDIR)/properties-test.Po -rm -f ./$(DEPDIR)/propertiesserializer-test.Po -rm -f ./$(DEPDIR)/ptrstream-test.Po -rm -f ./$(DEPDIR)/query_params-test.Po -rm -f ./$(DEPDIR)/quotedprintable-test.Po -rm -f ./$(DEPDIR)/regex-test.Po -rm -f ./$(DEPDIR)/rpcbenchasyncclient.Po -rm -f ./$(DEPDIR)/rpcbenchclient.Po -rm -f ./$(DEPDIR)/rpcbenchserver.Po -rm -f ./$(DEPDIR)/scopedincrement-test.Po -rm -f ./$(DEPDIR)/serialization-test.Po -rm -f ./$(DEPDIR)/serializationinfo-test.Po -rm -f ./$(DEPDIR)/serializer-bench.Po -rm -f ./$(DEPDIR)/smartptr-test.Po -rm -f ./$(DEPDIR)/split-test.Po -rm -f ./$(DEPDIR)/string-test.Po -rm -f ./$(DEPDIR)/test-main.Po -rm -f ./$(DEPDIR)/time-test.Po -rm -f ./$(DEPDIR)/timespan-test.Po -rm -f ./$(DEPDIR)/trim-test.Po -rm -f ./$(DEPDIR)/tz-test.Po -rm -f ./$(DEPDIR)/uri-test.Po -rm -f ./$(DEPDIR)/utf8-test.Po -rm -f ./$(DEPDIR)/win1252-test.Po -rm -f ./$(DEPDIR)/xmldeserializer-test.Po -rm -f ./$(DEPDIR)/xmlreader-test.Po -rm -f ./$(DEPDIR)/xmlrpc-test.Po -rm -f ./$(DEPDIR)/xmlrpccallback-test.Po -rm -f ./$(DEPDIR)/xmlserializer-test.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles 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 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/test/mime-test.cpp0000664000175000017500000001241613644433072013563 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/mime.h" #include "cxxtools/serializationinfo.h" #include class MimeTest : public cxxtools::unit::TestSuite { public: MimeTest() : cxxtools::unit::TestSuite("mime") { registerMethod("parseMessage", *this, &MimeTest::parseMessage); registerMethod("buildMessage", *this, &MimeTest::buildMessage); registerMethod("serializeMessage", *this, &MimeTest::serializeMessage); registerMethod("multipartMessage", *this, &MimeTest::multipartMessage); registerMethod("outputMessage", *this, &MimeTest::outputMessage); registerMethod("serializeMultipartMessage", *this, &MimeTest::serializeMultipartMessage); registerMethod("serializeMultipartToEntity", *this, &MimeTest::serializeMultipartToEntity); } void parseMessage() { std::string msg( "foo: bar\r\n" "bar: \r\n" " blub\r\n\r\nbody"); cxxtools::MimeEntity mime(msg); CXXTOOLS_UNIT_ASSERT_EQUALS(mime.getHeader("FOO"), "bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(mime.getHeader("baR"), " blub"); CXXTOOLS_UNIT_ASSERT_EQUALS(mime.getBody(), "body"); } void buildMessage() { cxxtools::MimeEntity mime; mime.addHeader("hdr1", "bar1"); mime.addHeader("hdr2", "bar2"); mime.getBody() = "some body text"; CXXTOOLS_UNIT_ASSERT_EQUALS(mime.getHeader("hdr1"), "bar1"); CXXTOOLS_UNIT_ASSERT_EQUALS(mime.getHeader("hdr2"), "bar2"); CXXTOOLS_UNIT_ASSERT_EQUALS(mime.getBody(), "some body text"); } void outputMessage() { cxxtools::MimeEntity mime; mime.addHeader("hdr1", "bar1\nblub"); mime.addHeader("hdr2", "bar2"); mime.getBody() = "some body text"; std::ostringstream s; s << mime; CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MIME-Version: 1.0\r\nhdr1: bar1\n blub\r\nhdr2: bar2\r\n\r\nsome body text"); } void serializeMessage() { cxxtools::SerializationInfo si; { cxxtools::MimeEntity mime; mime.addHeader("hdr1", "bar1"); mime.addHeader("hdr2", "bar2"); mime.getBody() = "some body text"; si <<= mime; } { cxxtools::MimeEntity mime2; si >>= mime2; CXXTOOLS_UNIT_ASSERT_EQUALS(mime2.getHeader("hdr1"), "bar1"); CXXTOOLS_UNIT_ASSERT_EQUALS(mime2.getHeader("hdr2"), "bar2"); CXXTOOLS_UNIT_ASSERT_EQUALS(mime2.getBody(), "some body text"); } } void multipartMessage() { cxxtools::MimeMultipart mp; mp.addObject(); mp.addObject(); CXXTOOLS_UNIT_ASSERT_EQUALS(mp.size(), 2); } void serializeMultipartMessage() { cxxtools::SerializationInfo si; { cxxtools::MimeMultipart mp; mp.addObject(); mp.addObject(); si <<= mp; } { cxxtools::MimeMultipart mp; si >>= mp; CXXTOOLS_UNIT_ASSERT_EQUALS(mp.size(), 2); } } void serializeMultipartToEntity() { cxxtools::MimeMultipart mp; mp.addObject(); mp.addObject(); cxxtools::SerializationInfo si; si <<= mp; cxxtools::MimeEntity me; si >>= me; CXXTOOLS_UNIT_ASSERT(me.isMultipart()); cxxtools::MimeMultipart mp2(me); CXXTOOLS_UNIT_ASSERT_EQUALS(mp2.size(), 2); } }; cxxtools::unit::RegisterTest register_MimeTest; cxxtools-3.0/test/string-test.cpp0000664000175000017500000005546113653121636014151 00000000000000/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #undef CXXTOOLS_API_EXPORT #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" #include #include #if __cplusplus >= 201103L #include #endif class StringTest : public cxxtools::unit::TestSuite { public: StringTest() : cxxtools::unit::TestSuite("string") { cxxtools::unit::TestSuite::registerMethod( "testConstructor", *this, &StringTest::testConstructor ); cxxtools::unit::TestSuite::registerMethod( "testCompare", *this, &StringTest::testCompare ); cxxtools::unit::TestSuite::registerMethod( "testCompareShort", *this, &StringTest::testCompareShort ); cxxtools::unit::TestSuite::registerMethod( "testAssign", *this, &StringTest::testAssign ); cxxtools::unit::TestSuite::registerMethod( "testAppend", *this, &StringTest::testAppend ); cxxtools::unit::TestSuite::registerMethod( "testInsert", *this, &StringTest::testInsert ); cxxtools::unit::TestSuite::registerMethod( "testClear", *this, &StringTest::testClear ); cxxtools::unit::TestSuite::registerMethod( "testErase", *this, &StringTest::testErase ); cxxtools::unit::TestSuite::registerMethod( "testReplace", *this, &StringTest::testReplace ); cxxtools::unit::TestSuite::registerMethod( "testFind", *this, &StringTest::testFind ); cxxtools::unit::TestSuite::registerMethod( "testRFind", *this, &StringTest::testRFind ); cxxtools::unit::TestSuite::registerMethod( "testFindFirstOf", *this, &StringTest::testFindFirstOf ); cxxtools::unit::TestSuite::registerMethod( "testFindLastOf", *this, &StringTest::testFindLastOf ); cxxtools::unit::TestSuite::registerMethod( "testFindFirstNotOf", *this, &StringTest::testFindFirstNotOf ); cxxtools::unit::TestSuite::registerMethod( "testFindLastNotOf", *this, &StringTest::testFindLastNotOf ); cxxtools::unit::TestSuite::registerMethod( "testCStr", *this, &StringTest::testCStr ); cxxtools::unit::TestSuite::registerMethod( "testSubstr", *this, &StringTest::testSubstr ); cxxtools::unit::TestSuite::registerMethod( "testSwap", *this, &StringTest::testSwap ); cxxtools::unit::TestSuite::registerMethod( "testAt", *this, &StringTest::testAt ); cxxtools::unit::TestSuite::registerMethod( "testPushBack", *this, &StringTest::testPushBack ); cxxtools::unit::TestSuite::registerMethod( "testCopy", *this, &StringTest::testCopy ); cxxtools::unit::TestSuite::registerMethod( "testReserve", *this, &StringTest::testReserve ); cxxtools::unit::TestSuite::registerMethod( "testReserveEmpty", *this, &StringTest::testReserveEmpty ); cxxtools::unit::TestSuite::registerMethod( "testLengthAndSize", *this, &StringTest::testLengthAndSize ); #if __cplusplus >= 201103L cxxtools::unit::TestSuite::registerMethod( "testMove", *this, &StringTest::testMove ); #endif } protected: void testConstructor(); void testCompare(); void testCompareShort(); void testAssign(); void testAppend(); void testInsert(); void testClear(); void testErase(); void testReplace(); void testFind(); void testRFind(); void testFindFirstOf(); void testFindLastOf(); void testFindFirstNotOf(); void testFindLastNotOf(); void testCStr(); void testSubstr(); void testSwap(); void testIndexOperator(); void testAt(); void testPushBack(); void testCopy(); void testReserve(); void testReserveEmpty(); void testLengthAndSize(); #if __cplusplus >= 201103L void testMove(); #endif }; cxxtools::unit::RegisterTest register_StringTest; void StringTest::testConstructor() { cxxtools::String s1; CXXTOOLS_UNIT_ASSERT(s1 == cxxtools::String(L"")); cxxtools::String s2(L"abcde"); CXXTOOLS_UNIT_ASSERT(s2 == L"abcde"); cxxtools::String s3(L"abcde", 3); CXXTOOLS_UNIT_ASSERT(s3 == L"abc"); cxxtools::String s4(3, 'x'); CXXTOOLS_UNIT_ASSERT(s4 == L"xxx"); cxxtools::String s5(s2); CXXTOOLS_UNIT_ASSERT(s5 == L"abcde"); cxxtools::String s6(s2, 1); CXXTOOLS_UNIT_ASSERT(s6 == L"bcde"); cxxtools::String s7(s2, 1, 3); CXXTOOLS_UNIT_ASSERT(s7 == L"bcd"); cxxtools::String s10; CXXTOOLS_UNIT_ASSERT(s10 == cxxtools::String(L"")); const cxxtools::Char c11[] = { 'a', 'b', 'c', 'd', 'e', '\0' }; cxxtools::String s11(c11); CXXTOOLS_UNIT_ASSERT(s11 == c11); const cxxtools::Char c12[] = { 'a', 'b', 'c', '\0' }; cxxtools::String s12(L"abcde", 3); CXXTOOLS_UNIT_ASSERT(s12 == c12); const cxxtools::Char c13[] = { 'x', 'x', 'x', '\0' }; cxxtools::String s13(3, 'x'); CXXTOOLS_UNIT_ASSERT(s13 == c13); const cxxtools::Char c14[] = { 'a', 'b', 'c', 'd', 'e', '\0' }; cxxtools::String s14(s11); CXXTOOLS_UNIT_ASSERT(s14 == c14); const cxxtools::Char c15[] = { 'b', 'c', 'd', 'e', '\0' }; cxxtools::String s15(s11, 1); CXXTOOLS_UNIT_ASSERT(s15 == c15); const cxxtools::Char c16[] = { 'b', 'c', 'd', '\0' }; cxxtools::String s16(s11, 1, 3); CXXTOOLS_UNIT_ASSERT(s16 == c16); cxxtools::String s20(s2.begin(), s2.end()); CXXTOOLS_UNIT_ASSERT(s20 == L"abcde"); } void StringTest::testCompare() { const cxxtools::Char abc[] = { 'a', 'b', 'c', '\0' }; const wchar_t* z = L"abcxyz"; cxxtools::String s(L"abcd"); cxxtools::String t(abc); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(s) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(z) , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 3, t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 3, t, 1, 2) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 3, z) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 2, z + 1, 0, 2) , 0); cxxtools::String x1(L"abc"); cxxtools::String x2(abc); CXXTOOLS_UNIT_ASSERT(x1 == x2); CXXTOOLS_UNIT_ASSERT(x1 == abc); CXXTOOLS_UNIT_ASSERT(x2 == abc); const cxxtools::Char empty[] = { '\0' }; cxxtools::String y1(L""); cxxtools::String y2(empty); CXXTOOLS_UNIT_ASSERT(y1 == y2); CXXTOOLS_UNIT_ASSERT(y1 == empty); CXXTOOLS_UNIT_ASSERT(y2 == empty); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(L"abcd"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(L"abc"), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(L"abcde"), -1); cxxtools::String zz(L"abcd\0ef", 7); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcd"), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcde"), -1); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcd\0ef", 7), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcd\0ee", 7), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcd\0eg", 7), -1); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcd\0eff", 9), -1); CXXTOOLS_UNIT_ASSERT_EQUALS(zz.compare(L"abcd\0eff", 5), 0); } void StringTest::testCompareShort() { cxxtools::String s(L"abcd"); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcd") , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abc") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcxyz") , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abd") , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abb") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("ab") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcd", 4) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcxyz", 3) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcxyz", 4) , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abd", 3) , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abb", 3) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("ab", 2) , 1); cxxtools::String x1(L"abc"); CXXTOOLS_UNIT_ASSERT(x1 == "abc"); cxxtools::String y1(L""); cxxtools::String y2(""); CXXTOOLS_UNIT_ASSERT(y1 == y2); CXXTOOLS_UNIT_ASSERT(y1 == ""); CXXTOOLS_UNIT_ASSERT(y2 == ""); } void StringTest::testAssign() { { cxxtools::String s1; cxxtools::String s2(L"abc"); cxxtools::String s3 = s1; cxxtools::Char& ref = s2[0]; // make it unsharable ref = L'x'; s1 = s2; } const wchar_t* z = L"abcde"; std::vector v(z, z + 5); cxxtools::String s; cxxtools::String t(z); s.assign(z); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); s.assign(z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"bcd"); s.assign(z + 1, 0, 10); CXXTOOLS_UNIT_ASSERT(s == L"bcde"); s.assign(3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"xxx"); s.assign(t); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); s.assign(t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"bcd"); s.assign(v.begin(), v.end()); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); s = s; CXXTOOLS_UNIT_ASSERT(s == L"abcde"); s.assign(t); s = s.c_str(); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); } void StringTest::testAppend() { const wchar_t* z = L"abcde"; std::vector v(z, z + 5); cxxtools::String s(L"ABC"); cxxtools::String t(z); s.append(z); CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; s.append(z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABCbcd"); s = L"ABC"; s.append(3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABCxxx"); s = L"ABC"; s.append(t); CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; s.append(t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABCbcd"); s = L"ABC"; s.append(v.begin(), v.end()); CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); // operator += s = L"ABC"; s += z; CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; s += 'x'; CXXTOOLS_UNIT_ASSERT(s == L"ABCx"); s = L"ABC"; s += t; CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; cxxtools::String u = s + t; CXXTOOLS_UNIT_ASSERT(u == L"ABCabcde"); } void StringTest::testInsert() { cxxtools::String::iterator i; const wchar_t* z = L"abcde"; std::vector v(z, z + 5); cxxtools::String s(L"ABC"); cxxtools::String t(z); s.insert(2, z); CXXTOOLS_UNIT_ASSERT(s == L"ABabcdeC"); s = L"ABC"; s.insert(2, z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABbcdC"); s = L"ABC"; s.insert(2, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABxxxC"); s = L"ABC"; s.insert(2, t); CXXTOOLS_UNIT_ASSERT(s == L"ABabcdeC"); s = L"ABC"; s.insert(2, t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABbcdC"); s = L"ABC"; i = s.begin() + 2; s.insert(i, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABxC"); s = L"ABC"; i = s.begin() + 2; s.insert(i, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABxxxC"); /* TODO API not implemented yet. s = L"ABC"; s.insert(i, v.begin(), v.end()); i = s.begin() + 2; CXXTOOLS_UNIT_ASSERT(s == L"ABabcdeC");*/ } void StringTest::testClear() { cxxtools::String s(L"abcdefg"); s.clear(); CXXTOOLS_UNIT_ASSERT(s == L""); } void StringTest::testErase() { cxxtools::String s(L"abcdefg"); cxxtools::String::iterator p = s.begin() + 2; cxxtools::String::iterator q = s.end() - 2; s.erase(); CXXTOOLS_UNIT_ASSERT(s == L""); s = L"abcdefg"; s.erase(2); CXXTOOLS_UNIT_ASSERT(s == L"ab"); s = L"abcdefg"; s.erase(2, 3); CXXTOOLS_UNIT_ASSERT(s == L"abfg"); s = L"abcdefg"; p = s.begin() + 2; s.erase(p); CXXTOOLS_UNIT_ASSERT(s == L"abdefg"); s = L"abcdefg"; p = s.begin() + 2; q = s.end() - 2; s.erase(p, q); CXXTOOLS_UNIT_ASSERT(s == L"abfg"); } void StringTest::testReplace() { const wchar_t* z = L"vwxyz"; std::vector v(z, z + 5); cxxtools::String s(L"ABCDEF"); cxxtools::String t(z); cxxtools::String::iterator i1; cxxtools::String::iterator i2; s.replace(1, 4, z); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); s = L"ABCDEF"; s.replace(1, 4, z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"AwxyF"); s = L"ABCDEF"; s.replace(1, 4, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"AxxxF"); s = L"ABCDEF"; s.replace(1, 4, t); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); s = L"ABCDEF"; s.replace(1, 4, t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"AwxyF"); s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, z); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); cxxtools::Char z2[] = { 'v', 'w', 'x', 'y' }; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, z2 + 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"AwxyF"); s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"AxxxF"); s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, t); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); /* TODO API not implemented yet. s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, v.begin(), v.end()); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); */ } void StringTest::testFind() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"bc"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(t, 2) , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(L"bc") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(L"bc", 2) , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(abcd, 2, 3) , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find('b') , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find('b', 2) , 5); } void StringTest::testRFind() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"bc"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(t) , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(t, 2) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(L"bc") , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(L"bc", 2) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(abcd, 2, 3) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind('b') , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind('b', 2) , 1); } void StringTest::testFindFirstOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(t) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(t, 2) , 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(L"bc") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(L"bc", 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(abcd, 2, 3) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of('b') , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of('b', 2) , 5); } void StringTest::testFindLastOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(t) , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(t, 2) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(L"bc") , 6); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(L"bc", 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(abcd, 2, 3) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of('b') , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of('b', 2) , 1); } void StringTest::testFindFirstNotOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(t, 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(L"bc") , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(L"bc", 2) , 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(abcd, 2, 3) , 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of('b') , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of('b', 2) , 2); } void StringTest::testFindLastNotOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(t) , 6); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(t, 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(L"bc") , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(L"bc", 2) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(abcd, 2, 3) , cxxtools::String::npos); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of('b') , 6); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of('b', 2) , 2); } void StringTest::testCStr() { cxxtools::String s1(L"abc"); CXXTOOLS_UNIT_ASSERT(s1.c_str()[0] == 'a' && s1.c_str()[1] == 'b' && s1.c_str()[2] == 'c' && s1.c_str()[3] == '\0'); cxxtools::String s2; CXXTOOLS_UNIT_ASSERT(s2.c_str()[0] == '\0'); cxxtools::Char abc[] = { 'a', 'b', 'c', '\0' }; cxxtools::String s3(abc); CXXTOOLS_UNIT_ASSERT(s3.c_str()[0] == 'a' && s3.c_str()[1] == 'b' && s3.c_str()[2] == 'c' && s3.c_str()[3] == '\0'); cxxtools::Char zero[] = { '\0' }; cxxtools::String s4(zero); CXXTOOLS_UNIT_ASSERT(s4.c_str()[0] == '\0'); } void StringTest::testSubstr() { cxxtools::String s(L"abcdefg"); CXXTOOLS_UNIT_ASSERT(s.substr() == L"abcdefg"); CXXTOOLS_UNIT_ASSERT(s.substr(2) == L"cdefg"); CXXTOOLS_UNIT_ASSERT(s.substr(2, 3) == L"cde"); CXXTOOLS_UNIT_ASSERT(s.substr(0, 32) == L"abcdefg"); } void StringTest::testSwap() { cxxtools::String s1(L"abc"); cxxtools::String s2(L"xyz"); CXXTOOLS_UNIT_ASSERT(s1 == L"abc"); CXXTOOLS_UNIT_ASSERT(s2 == L"xyz"); s1.swap(s2); CXXTOOLS_UNIT_ASSERT(s1 == L"xyz"); CXXTOOLS_UNIT_ASSERT(s2 == L"abc"); s2.swap(s1); CXXTOOLS_UNIT_ASSERT(s1 == L"abc"); CXXTOOLS_UNIT_ASSERT(s2 == L"xyz"); } void StringTest::testIndexOperator() { cxxtools::String s(L"abcdef"); CXXTOOLS_UNIT_ASSERT(s[0] == 'a'); CXXTOOLS_UNIT_ASSERT(s[5] == 'f'); CXXTOOLS_UNIT_ASSERT(s[6] == '\0'); /* bool exceptionOccured = false; try { s[10]; } catch (const cxxtools::Exception& e) { exceptionOccured = true; }*/ } void StringTest::testAt() { cxxtools::String s(L"abcdef"); CXXTOOLS_UNIT_ASSERT(s.at(0) == 'a'); CXXTOOLS_UNIT_ASSERT(s.at(5) == 'f'); } void StringTest::testPushBack() { cxxtools::String s(L"abc"); s.push_back('d'); CXXTOOLS_UNIT_ASSERT(s == L"abcd"); } void StringTest::testCopy() { cxxtools::Char t1[3]; cxxtools::String s(L"abcd"); s.copy(t1, 2); t1[2] = '\0'; const cxxtools::Char c1[] = { 'a', 'b', '\0' }; CXXTOOLS_UNIT_ASSERT(std::char_traits::compare(t1, c1, 3) == 0); cxxtools::Char t2[5]; s.copy(t2, 4); t2[4] = '\0'; const cxxtools::Char c2[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(std::char_traits::compare(t2, c2, 5) , 0); cxxtools::Char t3[3]; s.copy(t3, 2, 2); t3[2] = '\0'; const cxxtools::Char c3[] = { 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(std::char_traits::compare(t3, c3, 3) , 0); } void StringTest::testReserve() { const cxxtools::Char c1[] = { 'a', 'b', 'c', 'd', '\0' }; cxxtools::String s(L"abcd"); cxxtools::String s2 = s; s2.reserve(10); CXXTOOLS_UNIT_ASSERT( s2.capacity() >= 10 ); CXXTOOLS_UNIT_ASSERT( s2.size() == 4 ); CXXTOOLS_UNIT_ASSERT_EQUALS( std::char_traits::compare(s2.c_str(), c1, 4) , 0 ); CXXTOOLS_UNIT_ASSERT( s.capacity() >= 4 ); CXXTOOLS_UNIT_ASSERT_EQUALS( s.size(), 4 ); CXXTOOLS_UNIT_ASSERT_EQUALS( std::char_traits::compare(s.c_str(), c1, 4) , 0 ); } void StringTest::testReserveEmpty() { cxxtools::String s; s.reserve(0); CXXTOOLS_UNIT_ASSERT_EQUALS( s.size() , 0 ); } void StringTest::testLengthAndSize() { cxxtools::String s1; CXXTOOLS_UNIT_ASSERT_EQUALS(s1.length() , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s1.size() , 0); cxxtools::String s2(L"ab"); CXXTOOLS_UNIT_ASSERT_EQUALS(s2.length() , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s2.size() , 2); s2 += L"cd"; CXXTOOLS_UNIT_ASSERT_EQUALS(s2.length() , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s2.size() , 4); cxxtools::Char ab[] = { 'a', 'b', '\0' }; cxxtools::String s3(ab); CXXTOOLS_UNIT_ASSERT_EQUALS(s3.length() , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s3.size() , 2); cxxtools::Char cd[] = { 'c', 'd', '\0' }; s3 += cd; CXXTOOLS_UNIT_ASSERT_EQUALS(s3.length() , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s3.size() , 4); } #if __cplusplus >= 201103L void StringTest::testMove() { { // test move constructor wchar_t str[] = L"hi"; cxxtools::String s1(str); cxxtools::String s2(std::move(s1)); CXXTOOLS_UNIT_ASSERT(s2 == str); CXXTOOLS_UNIT_ASSERT(s1 == str); // this is true since s1 is a short string and moving is just copying the data without affecting the source } { // test move assignment wchar_t str[] = L"This is a quite long string constant, which do not fit into a short string"; cxxtools::String s1(str); CXXTOOLS_UNIT_ASSERT(s1 == str); cxxtools::String s2; s2 = std::move(s1); CXXTOOLS_UNIT_ASSERT(s2 == str); CXXTOOLS_UNIT_ASSERT(s1 != str); // this is true since s1 is a long string and moving is moving the data from s1 to s2 } } #endif cxxtools-3.0/test/serializer-bench.cpp0000664000175000017500000002135513644433072015107 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; cxxtools::Milliseconds msValue; cxxtools::DateTime dtValue; }; static const std::string intValue = "intValue"; static const std::string stringValue = "stringValue"; static const std::string doubleValue = "doubleValue"; static const std::string boolValue = "boolValue"; static const std::string msValue = "msValue"; static const std::string dtValue = "dtValue"; static const std::string typeName = "TestObject"; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember(intValue) >>= obj.intValue; si.getMember(stringValue) >>= obj.stringValue; si.getMember(doubleValue) >>= obj.doubleValue; si.getMember(boolValue) >>= obj.boolValue; si.getMember(msValue) >>= obj.msValue; si.getMember(dtValue) >>= obj.dtValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember(intValue) <<= obj.intValue; si.addMember(stringValue) <<= obj.stringValue; si.addMember(doubleValue) <<= obj.doubleValue; si.addMember(boolValue) <<= obj.boolValue; si.addMember(msValue) <<= obj.msValue; si.addMember(dtValue) <<= obj.dtValue; si.setTypeName(typeName); } bool runXml = true; bool runJson = true; bool runBin = true; } // Function, which calls the serializer. // // Since the json serializer do not have a root node name we create a function // and specialize it for the json serializer then. template void serialize(Serializer& serializer, const T& data) { serializer.serialize(data, "d"); } // This is the specialization for json. template void serialize(cxxtools::JsonSerializer& serializer, const T& data) { serializer.serialize(data); } // Measure the duration to serialize and deserialize a object and output the result. template void benchSerialization(const T& d, const char* fname = 0) { std::stringstream data; Serializer serializer(data); // serialize cxxtools::Clock clock; clock.start(); serialize(serializer, d); serializer.finish(); cxxtools::Timespan ts = clock.stop(); // optionally output serialized data to file if (fname) { std::ofstream f(fname); f << data.str(); } // deserialization T v2; clock.start(); Deserializer deserializer(data); deserializer.deserialize(v2); cxxtools::Timespan td = clock.stop(); std::cout << "\tserialization: " << ts << "\n" "\tdeserialization: " << td << "\n" "\tsize: " << data.str().size() << " bytes" << std::endl; } template void benchXmlSerialization(const T& d, const char* fname = 0) { benchSerialization(d, fname); } template void benchJsonSerialization(const T& d, const char* fname = 0) { benchSerialization(d, fname); } template void benchBinSerialization(const T& d, const char* fname = 0) { benchSerialization(d, fname); } template void benchVector(const char* typeName, unsigned N, T increment, bool fileoutput) { std::cout << "vector of " << typeName << " values:" << std::endl; std::vector v; T value = 0; for (unsigned n = 0; n < N; ++n, value += increment) v.push_back(value); if (runXml) { std::cout << "xml:" << std::endl; benchXmlSerialization(v, fileoutput ? (std::string("vector-") + typeName + ".xml").c_str() : 0); } if (runJson) { std::cout << "json:" << std::endl; benchJsonSerialization(v, fileoutput ? (std::string("vector-") + typeName + ".json").c_str() : 0); } if (runBin) { std::cout << "bin:" << std::endl; benchBinSerialization(v, fileoutput ? (std::string("vector-") + typeName + ".bin").c_str() : 0); } } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg nn(argc, argv, 'n', 100000); cxxtools::Arg I(argc, argv, 'I', nn); cxxtools::Arg D(argc, argv, 'D', nn); cxxtools::Arg C(argc, argv, 'C', nn); cxxtools::Arg fileoutput(argc, argv, 'f'); runXml = cxxtools::Arg(argc, argv, 'x'); runJson = cxxtools::Arg(argc, argv, 'j'); runBin = cxxtools::Arg(argc, argv, 'b'); std::cout << "size of SerializationInfo: " << sizeof(cxxtools::SerializationInfo) << std::endl; if (!runXml && !runJson && !runBin) { runXml = runJson = runBin = true; } std::cout << "benchmark serializer with " << I.getValue() << " int vector " << D.getValue() << " double vector and " << C.getValue() << " custom vector iterations\n\n" "options:\n" " -n specify number of default iterations\n" " -I specify number of iterations for int vector\n" " -D specify number of iterations for double vector\n" " -C specify number of iterations for custom object\n" " -f write serialized output to files\n" << std::endl; if (I.getValue() > 0) benchVector("int", I, 1, fileoutput); if (D.getValue() > 0) benchVector("double", D, 0.25, fileoutput); if (C.getValue() > 0) { std::cout << "vector of custom objects:" << std::endl; TestObject obj; std::vector v; for (unsigned n = 0; n < C; ++n) { obj.intValue = n; obj.stringValue = cxxtools::convert(n); obj.doubleValue = sqrt(static_cast(n)); obj.boolValue = n&1; obj.msValue = n; obj.dtValue = cxxtools::DateTime(1900+n, 1+n%12, 1+n%28, n%24, n%60, n%60); v.push_back(obj); } if (runXml) { std::cout << "xml:" << std::endl; benchXmlSerialization(v, fileoutput ? "custobject.xml" : 0); } if (runJson) { std::cout << "json:" << std::endl; benchJsonSerialization(v, fileoutput ? "custobject.json" : 0); } if (runBin) { std::cout << "bin:" << std::endl; benchBinSerialization(v, fileoutput ? "custobject.bin" : 0); } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/test/serializationinfo-test.cpp0000664000175000017500000006517713644433072016401 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/serializationinfo.h" #include "cxxtools/serializationerror.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/convert.h" #include "cxxtools/log.h" log_define("cxxtools.unit.serializationinfo") #if __cplusplus >= 201103L #include #endif template T siValue(const cxxtools::SerializationInfo& si) { T value; si.getValue(value); return value; } class SerializationInfoTest : public cxxtools::unit::TestSuite { public: SerializationInfoTest() : cxxtools::unit::TestSuite("serializationinfo") { registerMethod("testSiSet", *this, &SerializationInfoTest::testSiSet); registerMethod("testString", *this, &SerializationInfoTest::testString); registerMethod("testString8", *this, &SerializationInfoTest::testString8); registerMethod("testChar", *this, &SerializationInfoTest::testChar); registerMethod("testInt", *this, &SerializationInfoTest::testInt); registerMethod("testUInt", *this, &SerializationInfoTest::testUInt); registerMethod("testFloat", *this, &SerializationInfoTest::testFloat); registerMethod("testDouble", *this, &SerializationInfoTest::testDouble); registerMethod("testLongDouble", *this, &SerializationInfoTest::testLongDouble); registerMethod("testSiAssign", *this, &SerializationInfoTest::testSiAssign); registerMethod("testSiCopy", *this, &SerializationInfoTest::testSiCopy); registerMethod("testSiSwap", *this, &SerializationInfoTest::testSiSwap); #if __cplusplus >= 201103L registerMethod("testMove", *this, &SerializationInfoTest::testMove); #endif registerMethod("testStringToBool", *this, &SerializationInfoTest::testStringToBool); registerMethod("testRangeCheck", *this, &SerializationInfoTest::testRangeCheck); registerMethod("testMember", *this, &SerializationInfoTest::testMember); } void testSiSet() { cxxtools::SerializationInfo si; si.setValue(static_cast(42)); CXXTOOLS_UNIT_ASSERT(si.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); si.setValue("Hello"); CXXTOOLS_UNIT_ASSERT(si.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"Hello")); si.setValue(cxxtools::String(L"World")); CXXTOOLS_UNIT_ASSERT(si.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"World")); si.setValue(-17); CXXTOOLS_UNIT_ASSERT(si.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), -17); si.setValue(0.0); CXXTOOLS_UNIT_ASSERT(si.isDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 0); } void testString() { cxxtools::SerializationInfo si; si.setValue(cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT(si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), '4'); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42.0); } void testString8() { cxxtools::SerializationInfo si; si.setValue(std::string("42")); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), '4'); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42.0); } void testChar() { cxxtools::SerializationInfo si; si.setValue('7'); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"7")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "7"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), '7'); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(7)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 7.0); } void testInt() { cxxtools::SerializationInfo si; si.setValue(42); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42.0); } void testUInt() { cxxtools::SerializationInfo si; si.setValue(static_cast(42)); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42.0); } void testFloat() { cxxtools::SerializationInfo si; si.setValue(static_cast(48.0)); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(48)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48.0); } void testDouble() { cxxtools::SerializationInfo si; si.setValue(48.0); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(si.isDouble()); CXXTOOLS_UNIT_ASSERT(!si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(48)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48.0); } void testLongDouble() { cxxtools::SerializationInfo si; si.setValue(48.0l); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT(!si.isDouble()); CXXTOOLS_UNIT_ASSERT(si.isLongDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert(siValue(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), static_cast(48)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 48.0); } void testSiAssign() { cxxtools::SerializationInfo si; cxxtools::SerializationInfo si2; si.setValue(static_cast(42)); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); si.setValue("Hello"); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"Hello")); si.setValue(cxxtools::String(L"World")); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"World")); si.setValue(-17); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), -17); } void testSiCopy() { cxxtools::SerializationInfo si; { si.setValue(static_cast(42)); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); } { si.setValue("Hello"); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"Hello")); } { si.setValue(cxxtools::String(L"World")); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"World")); } { si.setValue(-17); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), -17); } } #if __cplusplus >= 201103L void testMove() { { cxxtools::SerializationInfo si; si.setValue(static_cast(42)); si.addMember("foo"); si.addMember("bar"); cxxtools::SerializationInfo si2(std::move(si)); CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(si.memberCount(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(si2.memberCount(), 2); } { cxxtools::SerializationInfo si; const char str[] = "this is a string with aribtrary content"; si.setValue(str); cxxtools::SerializationInfo si2; si2.setValue(L"string to be replaced"); si2 = std::move(si); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), str); CXXTOOLS_UNIT_ASSERT(siValue(si) != str); } { cxxtools::SerializationInfo si; const char str[] = "this is a string with aribtrary content"; si.setValue(str); cxxtools::SerializationInfo si2(std::move(si)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), str); CXXTOOLS_UNIT_ASSERT(siValue(si) != str); } } #endif void testSiSwap() { cxxtools::SerializationInfo si; cxxtools::SerializationInfo si1; cxxtools::SerializationInfo si2; // simple type <-> simple type si1.setValue(17); si2.setValue(1.5); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), 1.5); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 17); // simple type <-> std::string si1.setValue(18); si2.setValue("Hello"); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), "Hello"); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 18); // simple type <-> String si1.setValue(19); si2.setValue(cxxtools::String(L"World")); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), cxxtools::String(L"World")); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 19); // std::string <-> simple type si1.setValue("Hi"); si2.setValue(1.5); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), 1.5); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hi"); // std::string <-> std::string si1.setValue("Hello"); si2.setValue("World"); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), "World"); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hello"); // std::string <-> String si1.setValue("Foo"); si2.setValue(cxxtools::String("Bar")); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), cxxtools::String(L"Bar")); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Foo"); // String <-> simple type si1.setValue(cxxtools::String("Hi")); si2.setValue(1.5); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isDouble()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), 1.5); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hi"); // String <-> std::string si1.setValue(cxxtools::String(L"Hello")); si2.setValue("World"); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), "World"); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hello"); // String <-> String si1.setValue(cxxtools::String("Foo")); si2.setValue(cxxtools::String("Bar")); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si1), cxxtools::String(L"Bar")); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Foo"); // other random tests si.setValue(static_cast(42)); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), 42); si.setValue("Hello"); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), 42); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"Hello")); si.setValue(cxxtools::String(L"World")); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si), "Hello"); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"World")); si.setValue(-17); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si.isString()); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue(si2), -17); } void testStringToBool() { cxxtools::SerializationInfo si; si.setValue("78"); CXXTOOLS_UNIT_ASSERT(siValue(si)); } void testRangeCheck() { cxxtools::SerializationInfo si; si.setValue(-1); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); si.setValue(static_cast(std::numeric_limits::max()) + 1); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue(si)); if (std::numeric_limits::max() > static_cast(std::numeric_limits::max())) { si.setValue(static_cast(std::numeric_limits::max()) * 1.01); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue(si)); si.setValue(static_cast(-std::numeric_limits::max()) * 1.01); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue(si)); } else { log_info("range error for double skipped since long double is not larger than double"); } if (std::numeric_limits::max() > static_cast(std::numeric_limits::max())) { si.setValue(static_cast(std::numeric_limits::max()) * 1.01); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue(si)); si.setValue(static_cast(-std::numeric_limits::max()) * 1.01); CXXTOOLS_UNIT_ASSERT_THROW(siValue(si), std::range_error); CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue(si)); } else { log_info("range error for float skipped since long double is not larger than double"); } } void testMember() { cxxtools::SerializationInfo si; si.addMember("foo"); si.addMember("bar"); si.addMember("baz"); si.addMember("foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(si.memberCount(), 4); CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("foo")); CXXTOOLS_UNIT_ASSERT_THROW(si.getMember("fooo"), cxxtools::SerializationError); CXXTOOLS_UNIT_ASSERT_EQUALS(si.getMember(0).name(), "foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(si.getMember(1).name(), "bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(si.getMember(2).name(), "baz"); CXXTOOLS_UNIT_ASSERT_EQUALS(si.getMember(3).name(), "foo"); } }; cxxtools::unit::RegisterTest register_SerializationInfoTest; cxxtools-3.0/test/jsonserializer-test.cpp0000664000175000017500000003062013644433072015674 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/jsonserializer.h" #include "cxxtools/json.h" #include "cxxtools/timespan.h" namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; TestObject() : intValue(0), doubleValue(0), boolValue(false) { } }; inline void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); } // test object for plain key test struct PlainKeyObject { int a; int b; int c; int d; }; inline void operator<<= (cxxtools::SerializationInfo& si, const PlainKeyObject& obj) { si.addMember("a a") <<= obj.a; si.addMember("1b") <<= obj.b; si.addMember("c-c") <<= obj.c; si.addMember("ddd") <<= obj.d; } struct JsonData { int a; std::string jsonData; }; void operator<<= (cxxtools::SerializationInfo& si, const JsonData& j) { si.addMember("a") <<= j.a; cxxtools::SerializationInfo& jsi = si.addMember("jsonData"); jsi <<= j.jsonData; jsi.setTypeName("json"); } template std::string toJson(const T& t) { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(t).finish(); return out.str(); } } class JsonSerializerTest : public cxxtools::unit::TestSuite { public: JsonSerializerTest() : cxxtools::unit::TestSuite("jsonserializer") { registerMethod("testInt", *this, &JsonSerializerTest::testInt); registerMethod("testObject", *this, &JsonSerializerTest::testObject); registerMethod("testArray", *this, &JsonSerializerTest::testArray); registerMethod("testEmptyArrays", *this, &JsonSerializerTest::testEmptyArrays); registerMethod("testString", *this, &JsonSerializerTest::testString); registerMethod("testStringHighSurrogate", *this, &JsonSerializerTest::testStringHighSurrogate); registerMethod("testPlainInt", *this, &JsonSerializerTest::testPlainInt); registerMethod("testPlainObject", *this, &JsonSerializerTest::testPlainObject); registerMethod("testPlainArray", *this, &JsonSerializerTest::testPlainArray); registerMethod("testPlainString", *this, &JsonSerializerTest::testPlainString); registerMethod("testMultipleObjects", *this, &JsonSerializerTest::testMultipleObjects); registerMethod("testPlainEmpty", *this, &JsonSerializerTest::testPlainEmpty); registerMethod("testEmptyObject", *this, &JsonSerializerTest::testEmptyObject); registerMethod("testDirect", *this, &JsonSerializerTest::testDirect); registerMethod("testEasyJson", *this, &JsonSerializerTest::testEasyJson); registerMethod("testPlainkey", *this, &JsonSerializerTest::testPlainkey); registerMethod("testTimespan", *this, &JsonSerializerTest::testTimespan); } void testInt() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(-4711, "value").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"value\":-4711}"); } void testObject() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "testObject").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"testObject\":{" "\"intValue\":17," "\"stringValue\":\"foobar\"," "\"doubleValue\":1.5," "\"boolValue\":false," "\"nullValue\":null" "}}"); } void testArray() { std::vector data; data.push_back(3); data.push_back(4); data.push_back(-33); std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "array").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"array\":[3,4,-33]}"); } void testEmptyArrays() { std::vector< std::vector > data; data.resize(2); std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "[[],[]]"); } void testString() { cxxtools::String data; data = L"hi\xc3a4\xc3b6\xc3bc"; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "str").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"str\":\"hi\\uc3a4\\uc3b6\\uc3bc\"}"); } void testStringHighSurrogate() { cxxtools::String data; data = L"\x1d11e"; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "str").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"str\":\"\\ud834\\udd1e\"}"); } void testPlainInt() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(-4711).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "-4711"); } void testPlainObject() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{" "\"intValue\":17," "\"stringValue\":\"foobar\"," "\"doubleValue\":1.5," "\"boolValue\":false," "\"nullValue\":null" "}"); } void testPlainArray() { std::vector data; data.push_back(3); data.push_back(4); data.push_back(-33); std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "[3,4,-33]"); } void testPlainString() { cxxtools::String data; data = L"hi\xc3a4\xc3b6\xc3bc"; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "\"hi\\uc3a4\\uc3b6\\uc3bc\""); } void testMultipleObjects() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize("Hi", "a") .serialize(42, "b") .finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"a\":\"Hi\",\"b\":42}"); } void testPlainEmpty() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), ""); } void testEmptyObject() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.setObject(); serializer.finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{}"); } void testDirect() { JsonData j; j.a = 42; j.jsonData = "{ b: 17; c: \"Hi there\" }"; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(j).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"a\":42,\"jsonData\":{ b: 17; c: \"Hi there\" }}"); } void testEasyJson() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; out << cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{" "\"intValue\":17," "\"stringValue\":\"foobar\"," "\"doubleValue\":1.5," "\"boolValue\":false," "\"nullValue\":null" "}"); } void testPlainkey() { { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; out << cxxtools::Json(data).plainkey(true); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{" "intValue:17," "stringValue:\"foobar\"," "doubleValue:1.5," "boolValue:false," "nullValue:null" "}"); } { PlainKeyObject o; o.a = 1; o.b = 2; o.c = 3; o.d = 4; std::ostringstream out; out << cxxtools::Json(o).plainkey(true); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{" "\"a a\":1," "\"1b\":2," "\"c-c\":3," "ddd:4}"); } } void testTimespan() { std::string j; j = toJson(cxxtools::Microseconds(34)); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "34"); j = toJson(cxxtools::Milliseconds(124)); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "124"); j = toJson(cxxtools::Seconds(3456)); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "3456"); j = toJson(cxxtools::Seconds(cxxtools::Microseconds(34565432))); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "34.565432"); j = toJson(cxxtools::Seconds(34, 565477)); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "34.565477"); j = toJson(cxxtools::Minutes(18)); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "18"); j = toJson(cxxtools::Hours(67)); CXXTOOLS_UNIT_ASSERT_EQUALS(j, "67"); } }; cxxtools::unit::RegisterTest register_JsonSerializerTest; cxxtools-3.0/test/xmldeserializer-test.cpp0000664000175000017500000001154313644433072016037 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/xml/xmldeserializer.h" #include namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue; } } class XmlDeserializerTest : public cxxtools::unit::TestSuite { public: XmlDeserializerTest() : cxxtools::unit::TestSuite("xmldeserializer") { registerMethod("testObjectWithAttributes", *this, &XmlDeserializerTest::testObjectWithAttributes); registerMethod("testManyObjectsWithAttributes", *this, &XmlDeserializerTest::testManyObjectsWithAttributes); } void testObjectWithAttributes() { std::istringstream data( "" //""); ""); cxxtools::xml::XmlDeserializer d(data, true); TestObject t; d.deserialize(t); CXXTOOLS_UNIT_ASSERT_EQUALS(t.intValue, 42); CXXTOOLS_UNIT_ASSERT_EQUALS(t.stringValue, "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(t.doubleValue, 2.25); CXXTOOLS_UNIT_ASSERT_EQUALS(t.boolValue, true); } void testManyObjectsWithAttributes() { std::istringstream data( "" "\n" "\n" "\n" ""); cxxtools::xml::XmlDeserializer d(data, true); std::vector t; d.deserialize(t); CXXTOOLS_UNIT_ASSERT_EQUALS(t.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(t[0].intValue, 42); CXXTOOLS_UNIT_ASSERT_EQUALS(t[0].stringValue, "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(t[0].doubleValue, 2.25); CXXTOOLS_UNIT_ASSERT_EQUALS(t[0].boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(t[1].intValue, 43); CXXTOOLS_UNIT_ASSERT_EQUALS(t[1].stringValue, "There"); CXXTOOLS_UNIT_ASSERT_EQUALS(t[1].doubleValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(t[1].boolValue, false); } }; cxxtools::unit::RegisterTest register_XmlDeserializerTest; cxxtools-3.0/test/datetime-test.cpp0000664000175000017500000002626613644433072014440 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/datetime.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class DateTimeTest : public cxxtools::unit::TestSuite { public: DateTimeTest() : cxxtools::unit::TestSuite("datetime") { registerMethod("diff", *this, &DateTimeTest::diff); registerMethod("arithmetic", *this, &DateTimeTest::arithmetic); registerMethod("fromString", *this, &DateTimeTest::fromString); registerMethod("fromStringMonthname", *this, &DateTimeTest::fromStringMonthname); registerMethod("fixDigit", *this, &DateTimeTest::fixDigit); registerMethod("toString", *this, &DateTimeTest::toString); registerMethod("names", *this, &DateTimeTest::names); registerMethod("serialization", *this, &DateTimeTest::serialization); } void diff() { cxxtools::DateTime dt1 = cxxtools::DateTime("2013-05-03 17:01:14.342"); cxxtools::DateTime dt2 = cxxtools::DateTime("2013-05-04 17:01:14.342"); cxxtools::Timespan dt = dt2 - dt1; CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Days(dt), 1.0); dt1 = cxxtools::DateTime("2013-05-03 17:01:14.000"); dt2 = cxxtools::DateTime("2013-05-03 17:01:14.342"); dt = dt2 - dt1; CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Microseconds(dt), 342000); } void arithmetic() { cxxtools::DateTime dt1(2014, 5, 3, 17, 1, 14); cxxtools::DateTime dt2 = dt1 - cxxtools::Days(1); CXXTOOLS_UNIT_ASSERT(dt2 == cxxtools::DateTime(2014, 5, 2, 17, 1, 14)); dt2 = dt1 + cxxtools::Hours(8); CXXTOOLS_UNIT_ASSERT(dt2 == cxxtools::DateTime(2014, 5, 4, 1, 1, 14)); dt2 = dt1 - cxxtools::Hours(18); CXXTOOLS_UNIT_ASSERT(dt2 == cxxtools::DateTime(2014, 5, 2, 23, 1, 14)); dt1 = cxxtools::DateTime(2012, 2, 28, 1, 2, 3); dt2 = dt1 + cxxtools::Days(3); CXXTOOLS_UNIT_ASSERT(dt2 == cxxtools::DateTime(2012, 3, 2, 1, 2, 3)); dt1 = cxxtools::DateTime(2012, 2, 20, 10, 0, 0); dt2 = dt1 + cxxtools::Hours(14); CXXTOOLS_UNIT_ASSERT(dt2 == cxxtools::DateTime(2012, 2, 21, 0, 0, 0)); } void fromString() { int year; unsigned month, day, hours, minutes, seconds, milliseconds, microseconds; cxxtools::DateTime dt; CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::DateTime("2013-05-03 17:01:14.3428")); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 342); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 342800); dt = cxxtools::DateTime("2013 5 3 17 1 14.3", "%Y %m %d %H %M %S%J"); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 300); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 300000); dt = cxxtools::DateTime("2013 5 3 17 1 14", "%Y %m %d %H %M %S%J"); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 0); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); dt = cxxtools::DateTime("2013-5-3 5:01:14 pm", "%Y-%m-%d %H:%M:%S %p"); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 0); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); dt = cxxtools::DateTime("2013 foo 5 bar 3 5 01 14 pm", "%Y*%m*%d*%H*%M*%S %p"); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 0); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::DateTime("5 3 9 1 6", "%m %d %H %M %S")); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 9); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 6); } void fromStringMonthname() { int year; unsigned month, day, hours, minutes, seconds, milliseconds, microseconds; cxxtools::DateTime dt; CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::DateTime("Wed Apr 11 14:24:14 CEST 2018", "??? %O %d %H:%M:%S # %Y")); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2018); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 4); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 11); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 24); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); static const char* monthnames[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; for (unsigned m = 0; m < 12; ++m) { CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::DateTime(monthnames[m], "%O")); dt.get(year, month, day, hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(month, m + 1); } } void fixDigit() { CXXTOOLS_UNIT_ASSERT_NOTHROW(cxxtools::DateTime("3 9 9 1 6", "%m %d %H %M %S")); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::DateTime("3 9 9 1 6", "%2m %2d %2H %2M %2S"), cxxtools::InvalidDate); CXXTOOLS_UNIT_ASSERT_NOTHROW(cxxtools::DateTime("03 09 09 01 06", "%2m %2d %2H %2M %2S")); } void toString() { cxxtools::DateTime dt(2013, 5, 3, 17, 1, 14, 342, 800); std::string str = dt.toString(); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013-05-03 17:01:14.3428"); str = dt.toString("%Y %m %d %H %M %S%J"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14.3428"); str = dt.toString("%Y %1m %1d %1H %1M %1S%J"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 5 3 17 1 14.3428"); dt = cxxtools::DateTime(2013, 5, 3, 17, 1, 14); str = dt.toString("%Y %m %d %H %M %S%J"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14.0"); str = dt.toString("%Y %m %d %H %M %S%K"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14.000"); str = dt.toString("%Y %m %d %H %M %S %k"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14 000"); str = dt.toString("%Y %m %d %H %M %S%U"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14.000000"); str = dt.toString("%Y %m %d %H %M %S %u"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14 000000"); str = dt.toString("%Y %m %d %H %M %S%j"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 17 01 14"); str = dt.toString("%Y %m %d %I %M %S%j %p"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03 05 01 14 pm"); } void names() { cxxtools::DateTime dt(2013, 5, 3, 17, 1, 14, 342, 800); std::string str = dt.toString("%O %N"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "May Fri"); dt += cxxtools::Days(30); str = dt.toString("%O %N"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "Jun Sun"); } void serialization() { { cxxtools::DateTime dt1; cxxtools::SerializationInfo si; si <<= dt1; cxxtools::DateTime dt2; si >>= dt2; CXXTOOLS_UNIT_ASSERT(dt1 == dt2); } { cxxtools::DateTime dt1(2014, 5, 3, 17, 1, 14); cxxtools::SerializationInfo si; si <<= dt1; cxxtools::DateTime dt2; si >>= dt2; CXXTOOLS_UNIT_ASSERT(dt1 == dt2); } } }; cxxtools::unit::RegisterTest register_DateTimeTest; cxxtools-3.0/test/cache-test.cpp0000664000175000017500000001254313644433072013700 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define DEBUG #include "cxxtools/cache.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class CacheTest : public cxxtools::unit::TestSuite { public: CacheTest() : cxxtools::unit::TestSuite("cache") { registerMethod("cacheTest", *this, &CacheTest::cacheTest); registerMethod("erase", *this, &CacheTest::erase); registerMethod("resize", *this, &CacheTest::resize); registerMethod("stats", *this, &CacheTest::stats); } void cacheTest() { cxxtools::Cache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); std::pair result; result = cache.getx(1); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 10); result = cache.getx(8); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 80); cache.put_top(11, 110); cache.put_top(12, 120); cache.put_top(13, 130); cache.put_top(14, 140); result = cache.getx(10); CXXTOOLS_UNIT_ASSERT(!result.first); result = cache.getx(11); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 110); } void erase() { cxxtools::Cache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); cache.erase(2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 5); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 3); cache.erase(9); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 3); } void resize() { cxxtools::Cache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 3); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 4); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 2); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 4); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 2); } void stats() { cxxtools::Cache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.getx(1); cache.getx(2); cache.getx(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getHits(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getMisses(), 1); } }; cxxtools::unit::RegisterTest register_CacheTest; cxxtools-3.0/test/query_params-test.cpp0000664000175000017500000002412413644433072015343 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/query_params.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/log.h" #include #include log_define("cxxtools.test.queryparams") class QueryParamsTest : public cxxtools::unit::TestSuite { public: QueryParamsTest() : cxxtools::unit::TestSuite("queryparams") { registerMethod("testQueryParams", *this, &QueryParamsTest::testQueryParams); registerMethod("testCopy", *this, &QueryParamsTest::testCopy); registerMethod("testParseUrl", *this, &QueryParamsTest::testParseUrl); registerMethod("testParseUrlSpecialChar", *this, &QueryParamsTest::testParseUrlSpecialChar); registerMethod("testParseDoublePercent", *this, &QueryParamsTest::testParseDoublePercent); registerMethod("testCount", *this, &QueryParamsTest::testCount); registerMethod("testCombine", *this, &QueryParamsTest::testCombine); registerMethod("testSet", *this, &QueryParamsTest::testSet); registerMethod("testIterator", *this, &QueryParamsTest::testIterator); registerMethod("testGetUrl", *this, &QueryParamsTest::testGetUrl); registerMethod("testGetNames", *this, &QueryParamsTest::testGetNames); registerMethod("testDeserialization", *this, &QueryParamsTest::testDeserialization); } void testQueryParams() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("value3"); CXXTOOLS_UNIT_ASSERT(q.has("p1")); CXXTOOLS_UNIT_ASSERT(q.has("p2")); CXXTOOLS_UNIT_ASSERT(!q.has("p3")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p1"], "value1"); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p2"], "value2"); CXXTOOLS_UNIT_ASSERT_EQUALS(q[0], "value3"); } void testCopy() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("value3"); cxxtools::QueryParams q2 = q; CXXTOOLS_UNIT_ASSERT(q2.has("p1")); CXXTOOLS_UNIT_ASSERT(q2.has("p2")); CXXTOOLS_UNIT_ASSERT(!q2.has("p3")); CXXTOOLS_UNIT_ASSERT_EQUALS(q2["p1"], "value1"); CXXTOOLS_UNIT_ASSERT_EQUALS(q2["p2"], "value2"); CXXTOOLS_UNIT_ASSERT_EQUALS(q2[0], "value3"); } void testParseUrl() { cxxtools::QueryParams q; q.parse_url("p2=value2&value3&p1=value1"); CXXTOOLS_UNIT_ASSERT(q.has("p1")); CXXTOOLS_UNIT_ASSERT(q.has("p2")); CXXTOOLS_UNIT_ASSERT(!q.has("p3")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p1"], "value1"); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p2"], "value2"); CXXTOOLS_UNIT_ASSERT_EQUALS(q[0], "value3"); } void testParseUrlSpecialChar() { cxxtools::QueryParams q; q.parse_url("p1=value+with%20spaces&m%a4kitalo=tommi+"); CXXTOOLS_UNIT_ASSERT(q.has("p1")); CXXTOOLS_UNIT_ASSERT(q.has("m\xa4kitalo")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p1"], "value with spaces"); CXXTOOLS_UNIT_ASSERT_EQUALS(q["m\xa4kitalo"], "tommi "); } void testParseDoublePercent() { cxxtools::QueryParams q; q.parse_url("%%=%%%"); CXXTOOLS_UNIT_ASSERT(q.has("%%")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["%%"], "%%%"); } void testCount() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("p2", "value3"); q.add("value4"); q.add("value5"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.paramcount(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(q.paramcount("p1"), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(q.paramcount("p2"), 2); } void testCombine() { cxxtools::QueryParams q; cxxtools::QueryParams q2; q.add("p1", "value1"); q2.add("p2", "value2"); q2.add("value3"); q.add(q2); } void testSet() { cxxtools::QueryParams q; q.set("a", "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), "a=Hi"); q.set("b", "foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), "a=Hi&b=foo"); q.set("a", "There"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), "b=foo&a=There"); q.clear(); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), ""); q.add("a", "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), "a=Hi"); q.add("b", "foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), "a=Hi&b=foo"); q.add("a", "There"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.getUrl(), "a=Hi&b=foo&a=There"); } void testIterator() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("p2", "value3"); q.add("value4"); q.add("value5"); cxxtools::QueryParams::const_iterator it; it = q.begin(); CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value4"); ++it; CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value5"); ++it; CXXTOOLS_UNIT_ASSERT(it == q.end()); it = q.begin("p1"); CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value1"); ++it; CXXTOOLS_UNIT_ASSERT(it == q.end()); it = q.begin("p2"); CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value2"); ++it; CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value3"); ++it; CXXTOOLS_UNIT_ASSERT(it == q.end()); } void testGetUrl() { cxxtools::QueryParams q; q.add("first name", "Tommi"); q.add("last name", "M\xa4kitalo"); q.add("some value"); std::string url = q.getUrl(); CXXTOOLS_UNIT_ASSERT_EQUALS(url, "first+name=Tommi&last+name=M%A4kitalo&some+value"); } void testGetNames() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("value3"); std::vector names; q.getNames(std::back_inserter(names)); CXXTOOLS_UNIT_ASSERT_EQUALS(names.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(names[0], "p1"); CXXTOOLS_UNIT_ASSERT_EQUALS(names[1], "p2"); CXXTOOLS_UNIT_ASSERT_EQUALS(names[2], ""); } void testDeserialization(); }; cxxtools::unit::RegisterTest register_QueryParamsTest; // helper classes for deserialization namespace { struct Columns { std::string name; std::string value; }; struct TableQuery { bool draw; std::vector columns; unsigned start; TableQuery() : draw(false), start(0) { } }; void operator>>= (const cxxtools::SerializationInfo& si, Columns& column) { si.getMember("name") >>= column.name; si.getMember("value") >>= column.value; } void operator>>= (const cxxtools::SerializationInfo& si, TableQuery& query) { si.getMember("draw") >>= query.draw; si.getMember("columns") >>= query.columns; si.getMember("start") >>= query.start; } } void QueryParamsTest::testDeserialization() { cxxtools::QueryParams qp; qp.add("draw", "1"); qp.add("columns[0][name]", "somename"); qp.add("columns[0][value]", "somevalue"); qp.add("columns[1][name]", "othername"); qp.add("columns[1][value]", "othervalue"); qp.add("start", "42"); cxxtools::SerializationInfo si; si <<= qp; CXXTOOLS_UNIT_ASSERT_EQUALS(si.memberCount(), 3); CXXTOOLS_UNIT_ASSERT(si.findMember("draw") != 0); CXXTOOLS_UNIT_ASSERT(si.findMember("columns") != 0); CXXTOOLS_UNIT_ASSERT(si.findMember("start") != 0); TableQuery query; si >>= query; CXXTOOLS_UNIT_ASSERT(query.draw); CXXTOOLS_UNIT_ASSERT_EQUALS(query.columns.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(query.columns[0].name, "somename"); CXXTOOLS_UNIT_ASSERT_EQUALS(query.columns[0].value, "somevalue"); CXXTOOLS_UNIT_ASSERT_EQUALS(query.columns[1].name, "othername"); CXXTOOLS_UNIT_ASSERT_EQUALS(query.columns[1].value, "othervalue"); CXXTOOLS_UNIT_ASSERT_EQUALS(query.start, 42); } cxxtools-3.0/test/xmlrpccallback-test.cpp0000664000175000017500000006577213644433072015633 00000000000000/* * Copyright (C) 2005-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/xmlrpc/service.h" #include "cxxtools/xmlrpc/httpclient.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/http/server.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include #include log_define("cxxtools.test.xmlrpc.callback") namespace { struct Color { int red; int green; int blue; }; typedef std::set IntSet; typedef std::multiset IntMultiset; typedef std::map IntMap; typedef std::multimap IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class XmlRpcCallbackTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::http::Server* _server; unsigned _count; std::string _listen; unsigned short _port; public: XmlRpcCallbackTest() : cxxtools::unit::TestSuite("xmlrpccallback"), _port(8001) { registerMethod("Nothing", *this, &XmlRpcCallbackTest::Nothing); registerMethod("Boolean", *this, &XmlRpcCallbackTest::Boolean); registerMethod("Integer", *this, &XmlRpcCallbackTest::Integer); registerMethod("Double", *this, &XmlRpcCallbackTest::Double); registerMethod("String", *this, &XmlRpcCallbackTest::String); registerMethod("EmptyValues", *this, &XmlRpcCallbackTest::EmptyValues); registerMethod("Array", *this, &XmlRpcCallbackTest::Array); registerMethod("EmptyArray", *this, &XmlRpcCallbackTest::EmptyArray); registerMethod("Struct", *this, &XmlRpcCallbackTest::Struct); registerMethod("Set", *this, &XmlRpcCallbackTest::Set); registerMethod("Multiset", *this, &XmlRpcCallbackTest::Multiset); registerMethod("Map", *this, &XmlRpcCallbackTest::Map); registerMethod("Multimap", *this, &XmlRpcCallbackTest::Multimap); registerMethod("UnknownMethod", *this, &XmlRpcCallbackTest::UnknownMethod); registerMethod("Fault", *this, &XmlRpcCallbackTest::Fault); registerMethod("Exception", *this, &XmlRpcCallbackTest::Exception); registerMethod("CallbackException", *this, &XmlRpcCallbackTest::CallbackException); registerMethod("ConnectError", *this, &XmlRpcCallbackTest::ConnectError); registerMethod("BigRequest", *this, &XmlRpcCallbackTest::BigRequest); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } char* LISTEN = getenv("UTEST_LISTEN"); if (LISTEN) _listen = LISTEN; } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &XmlRpcCallbackTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); _server = new cxxtools::http::Server(_loop, _listen, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onNothingFinished ); multiply.begin(); _loop.run(); } void onNothingFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), false); _loop.exit(); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(cxxtools::RemoteResult& /*r*/) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port + 1, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(cxxtools::RemoteResult& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyBoolean); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onBooleanFinished ); multiply.begin(true, true); _loop.run(); } void onBooleanFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), true); _loop.exit(); } bool multiplyBoolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyInt); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onIntegerFinished ); multiply.begin(2, 3); _loop.run(); } void onIntegerFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), 6); _loop.exit(); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyDouble); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onDoubleFinished ); multiply.begin(2.0, 3.0); _loop.run(); } void onDoubleFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), 6.0); _loop.exit(); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { cxxtools::xmlrpc::Service service; service.registerMethod("echoString", *this, &XmlRpcCallbackTest::echoString); _server->addService("/foo", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/foo"); cxxtools::RemoteProcedure echo(client, "echoString"); connect( echo.finished, *this, &XmlRpcCallbackTest::onStringEchoFinished ); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); _loop.run(); } void onStringEchoFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); _loop.exit(); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyEmpty); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onEmptyFinished ); multiply.begin("", ""); _loop.run(); } void onEmptyFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), "4"); _loop.exit(); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onArrayFinished ); std::vector vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); _loop.run(); } std::vector multiplyVector(const std::vector& a, const std::vector& b) { std::vector r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } void onArrayFinished(cxxtools::RemoteResult >& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().at(1), 400); _loop.exit(); } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onEmptyArrayFinished ); std::vector vec; multiply.begin(vec, vec); _loop.run(); } void onEmptyArrayFinished(cxxtools::RemoteResult >& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().size(), 0); _loop.exit(); } //////////////////////////////////////////////////////////// // Struct // void Struct() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyColor); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onStuctFinished ); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); _loop.run(); } void onStuctFinished(cxxtools::RemoteResult& color) { CXXTOOLS_UNIT_ASSERT_EQUALS(color.get().red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(color.get().green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(color.get().blue, 20); _loop.exit(); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcCallbackTest::multiplySet); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplyset"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onSetFinished ); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); _loop.run(); } void onSetFinished(cxxtools::RemoteResult& result) { const IntSet& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); _loop.exit(); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcCallbackTest::multiplyMultiset); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplyset"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onMultisetFinished ); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); _loop.run(); } void onMultisetFinished(cxxtools::RemoteResult& result) { const IntMultiset& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); _loop.exit(); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymap", *this, &XmlRpcCallbackTest::multiplyMap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplymap"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onMultiplyMapFinished ); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); _loop.run(); } void onMultiplyMapFinished(cxxtools::RemoteResult& result) { const IntMap& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); _loop.exit(); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymultimap", *this, &XmlRpcCallbackTest::multiplyMultimap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplymultimap"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onMultiplyMultimapFinished ); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); _loop.run(); } void onMultiplyMultimapFinished(cxxtools::RemoteResult& result) { const IntMultimap& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); _loop.exit(); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } void UnknownMethod() { cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure unknownMethod(client, "unknownMethod"); connect( unknownMethod.finished, *this, &XmlRpcCallbackTest::onBooleanFinished ); unknownMethod.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::exception); } //////////////////////////////////////////////////////////// // Fault // void Fault() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::throwFault); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onFault ); multiply.begin(); _loop.run(); } void onFault(cxxtools::RemoteResult& result) { try { result.get(); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } _loop.exit(); } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::throwException); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onException ); multiply.begin(); _loop.run(); } void onException(cxxtools::RemoteResult& result) { try { result.get(); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } _loop.exit(); } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { cxxtools::xmlrpc::Service service; service.registerMethod("countSize", *this, &XmlRpcCallbackTest::countSize); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure > countSize(client, "countSize"); connect( countSize.finished, *this, &XmlRpcCallbackTest::onCountSizeFinished ); std::vector v; v.resize(5000); countSize.begin(v); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onCountSizeFinished(cxxtools::RemoteResult& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), 5000); _loop.exit(); } unsigned countSize(const std::vector& v) { return v.size(); } }; cxxtools::unit::RegisterTest register_XmlRpcCallbackTest; cxxtools-3.0/test/jsonrpchttp-test.cpp0000664000175000017500000007235113644433072015216 00000000000000/* * Copyright (C) 2012 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/json/httpservice.h" #include "cxxtools/json/httpclient.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/http/server.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include "cxxtools/ioerror.h" #include "cxxtools/net/uri.h" #include "cxxtools/net/addrinfo.h" #include #include log_define("cxxtools.test.jsonrpchttp") namespace { struct Color { int red; int green; int blue; }; typedef std::set IntSet; typedef std::multiset IntMultiset; typedef std::map IntMap; typedef std::multimap IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class JsonRpcHttpTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::http::Server* _server; unsigned _count; std::string _listen; unsigned short _port; public: JsonRpcHttpTest() : cxxtools::unit::TestSuite("jsonrpchttp"), _port(8001) { registerMethod("Nothing", *this, &JsonRpcHttpTest::Nothing); registerMethod("Boolean", *this, &JsonRpcHttpTest::Boolean); registerMethod("Integer", *this, &JsonRpcHttpTest::Integer); registerMethod("Double", *this, &JsonRpcHttpTest::Double); registerMethod("String", *this, &JsonRpcHttpTest::String); registerMethod("EmptyValues", *this, &JsonRpcHttpTest::EmptyValues); registerMethod("Array", *this, &JsonRpcHttpTest::Array); registerMethod("EmptyArray", *this, &JsonRpcHttpTest::EmptyArray); registerMethod("Struct", *this, &JsonRpcHttpTest::Struct); registerMethod("Set", *this, &JsonRpcHttpTest::Set); registerMethod("Multiset", *this, &JsonRpcHttpTest::Multiset); registerMethod("Map", *this, &JsonRpcHttpTest::Map); registerMethod("Multimap", *this, &JsonRpcHttpTest::Multimap); registerMethod("UnknownMethod", *this, &JsonRpcHttpTest::UnknownMethod); registerMethod("Fault", *this, &JsonRpcHttpTest::Fault); registerMethod("Exception", *this, &JsonRpcHttpTest::Exception); registerMethod("CallbackException", *this, &JsonRpcHttpTest::CallbackException); registerMethod("ConnectError", *this, &JsonRpcHttpTest::ConnectError); registerMethod("BigRequest", *this, &JsonRpcHttpTest::BigRequest); registerMethod("PrepareConnect", *this, &JsonRpcHttpTest::PrepareConnect); registerMethod("Connect", *this, &JsonRpcHttpTest::Connect); registerMethod("Multiple", *this, &JsonRpcHttpTest::Multiple); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } char* LISTEN = getenv("UTEST_LISTEN"); if (LISTEN) _listen = LISTEN; _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &JsonRpcHttpTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _server = new cxxtools::http::Server(_loop, _listen, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyNothing); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyNothing); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcHttpTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(cxxtools::RemoteResult& /*r*/) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::json::HttpClient client(_loop, _listen, _port + 1, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcHttpTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(cxxtools::RemoteResult& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { cxxtools::json::HttpService service; service.registerMethod("boolean", *this, &JsonRpcHttpTest::boolean); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure boolean(client, "boolean"); boolean.begin(true, true); bool r = boolean.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r, true); } bool boolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyInt); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyDouble); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { cxxtools::json::HttpService service; service.registerMethod("echoString", *this, &JsonRpcHttpTest::echoString); _server->addService("/foo", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/foo"); cxxtools::RemoteProcedure echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyEmpty); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyVector); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector multiplyVector(const std::vector& a, const std::vector& b) { std::vector r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyVector); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyColor); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { cxxtools::json::HttpService service; service.registerMethod("multiplyset", *this, &JsonRpcHttpTest::multiplySet); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { cxxtools::json::HttpService service; service.registerMethod("multiplyset", *this, &JsonRpcHttpTest::multiplyMultiset); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { cxxtools::json::HttpService service; service.registerMethod("multiplymap", *this, &JsonRpcHttpTest::multiplyMap); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { cxxtools::json::HttpService service; service.registerMethod("multiplymultimap", *this, &JsonRpcHttpTest::multiplyMultimap); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // UnknownMethod // void UnknownMethod() { cxxtools::json::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::json::HttpService service; _server->addService("/test", service); cxxtools::RemoteProcedure unknownMethod(client, "unknownMethod"); unknownMethod.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::throwFault); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::throwException); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/calc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { cxxtools::json::HttpService service; service.registerMethod("countSize", *this, &JsonRpcHttpTest::countSize); _server->addService("/rpc", service); cxxtools::json::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure > countSize(client, "countSize"); std::vector v; v.resize(5000); countSize.begin(v); try { CXXTOOLS_UNIT_ASSERT_EQUALS(countSize.end(2000), 5000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector& v) { return v.size(); } //////////////////////////////////////////////////////////// // PrepareConnect // void PrepareConnect() { log_trace("PrepareConnect"); cxxtools::json::HttpService service; service.registerMethod("boolean", *this, &JsonRpcHttpTest::boolean); _server->addService("/rpc", service); // test connect using cxxtools::net::AddrInfo { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(cxxtools::net::AddrInfo(_listen, _port), "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(_listen, _port, "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "http://localhost:" << _port << "/rpc"; client.prepareConnect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect in connect { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1, "/rpc")); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(), cxxtools::IOError); } // test failing connect when calling function { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1, "/rpc")); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(boolean.end(2000), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Connect // void Connect() { cxxtools::json::HttpService service; service.registerMethod("boolean", *this, &JsonRpcHttpTest::boolean); _server->addService("/rpc", service); // test connect using cxxtools::net::AddrInfo { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(cxxtools::net::AddrInfo(_listen, _port), "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(_listen, _port, "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "http://localhost:" << _port << "/rpc"; client.connect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect { cxxtools::json::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(_listen, _port + 1, "/rpc"), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Multiple calls // void Multiple() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyDouble); _server->addService("/rpc", service); typedef cxxtools::RemoteProcedure Multiply; std::vector clients; std::vector procs; clients.reserve(16); procs.reserve(16); for (unsigned i = 0; i < 16; ++i) { clients.push_back(cxxtools::json::HttpClient(_loop, _listen, _port, "/rpc")); procs.push_back(Multiply(clients.back(), "multiply")); procs.back().begin(i, i); } for (unsigned i = 0; i < 16; ++i) { CXXTOOLS_UNIT_ASSERT_EQUALS(procs[i].end(2000), i*i); } } }; cxxtools::unit::RegisterTest register_JsonRpcHttpTest; cxxtools-3.0/test/Makefile.am0000664000175000017500000000646513657752564013234 00000000000000noinst_PROGRAMS = \ alltests \ foo \ logbench \ serializer-bench \ rpcbenchclient \ rpcbenchasyncclient \ rpcbenchserver noinst_HEADERS = \ color.h AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include alltests_SOURCES = \ arg-test.cpp \ base64-test.cpp \ binrpc-test.cpp \ binserializer-test.cpp \ cache-test.cpp \ clock-test.cpp \ csvdeserializer-test.cpp \ csvserializer-test.cpp \ convert-test.cpp \ date-test.cpp \ datetime-test.cpp \ envsubst-test.cpp \ eventloop-test.cpp \ file-test.cpp \ inifile-test.cpp \ iniparser-test.cpp \ iniserialization-test.cpp \ iso8859_1-test.cpp \ iso8859_15-test.cpp \ join-test.cpp \ json-test.cpp \ jsondeserializer-test.cpp \ jsonrpc-test.cpp \ jsonrpchttp-test.cpp \ jsonserializer-test.cpp \ limitstream-test.cpp \ logconfiguration-test.cpp \ lrucache-test.cpp \ mime-test.cpp \ md5-test.cpp \ pool-test.cpp \ properties-test.cpp \ propertiesserializer-test.cpp \ ptrstream-test.cpp \ query_params-test.cpp \ quotedprintable-test.cpp \ regex-test.cpp \ scopedincrement-test.cpp \ serialization-test.cpp \ serializationinfo-test.cpp \ smartptr-test.cpp \ split-test.cpp \ string-test.cpp \ test-main.cpp \ time-test.cpp \ timespan-test.cpp \ trim-test.cpp \ tz-test.cpp \ utf8-test.cpp \ uri-test.cpp \ win1252-test.cpp \ xmlreader-test.cpp \ xmlrpc-test.cpp \ xmlrpccallback-test.cpp \ xmldeserializer-test.cpp \ xmlserializer-test.cpp if MAKE_ICONVSTREAM alltests_SOURCES += \ iconvstream-test.cpp endif logbench_SOURCES = logbench.cpp logbench_LDADD = $(top_builddir)/src/libcxxtools.la alltests_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la \ $(top_builddir)/src/unit/libcxxtools-unit.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la serializer_bench_SOURCES = serializer-bench.cpp serializer_bench_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la rpcbenchclient_SOURCES = rpcbenchclient.cpp rpcbenchasyncclient_SOURCES = rpcbenchasyncclient.cpp rpcbenchclient_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la rpcbenchasyncclient_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la rpcbenchserver_SOURCES = rpcbenchserver.cpp rpcbenchserver_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la foo_SOURCES = foo.cpp foo_LDADD = $(top_builddir)/src/libcxxtools.la cxxtools-3.0/test/ptrstream-test.cpp0000664000175000017500000000563313644433072014660 00000000000000/* * Copyright (C) 2018 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class PtrStreamTest : public cxxtools::unit::TestSuite { public: PtrStreamTest() : cxxtools::unit::TestSuite("ptrstream") { registerMethod("testPtrIStream", *this, &PtrStreamTest::testPtrIStream); registerMethod("testPtrOStream", *this, &PtrStreamTest::testPtrOStream); } void testPtrIStream() { char data[] = "hi"; cxxtools::PtrStream in(data, data + 2); char ch = '\0'; in.get(ch); CXXTOOLS_UNIT_ASSERT(!in.eof()); CXXTOOLS_UNIT_ASSERT_EQUALS(ch, 'h'); in.get(ch); CXXTOOLS_UNIT_ASSERT(!in.eof()); CXXTOOLS_UNIT_ASSERT_EQUALS(ch, 'i'); in.get(ch); CXXTOOLS_UNIT_ASSERT(in.eof()); } void testPtrOStream() { char data[2] = "\0"; cxxtools::PtrStream out(data, data + 2); CXXTOOLS_UNIT_ASSERT(out.begin() == &data[0]); CXXTOOLS_UNIT_ASSERT(out.end() == &data[0]); out << "hi"; CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 'h'); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], 'i'); CXXTOOLS_UNIT_ASSERT(!out.fail()); out << 'h'; CXXTOOLS_UNIT_ASSERT(out.fail()); CXXTOOLS_UNIT_ASSERT(out.begin() == &data[0]); CXXTOOLS_UNIT_ASSERT(out.end() == &data[2]); } }; cxxtools::unit::RegisterTest register_PtrStreamTest; cxxtools-3.0/test/convert-test.cpp0000664000175000017500000002360213644433072014313 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/convert.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" #include "cxxtools/log.h" #include #include log_define("cxxtools.test.convert") namespace { bool nearBy(double v1, double v2, double e = 1e-6) { double q = v1 / v2; return q > 1 - e && q < 1 + e; } } class ConvertTest : public cxxtools::unit::TestSuite { public: ConvertTest() : cxxtools::unit::TestSuite("convert") { registerMethod("successTest", *this, &ConvertTest::successTest); registerMethod("failTest", *this, &ConvertTest::failTest); registerMethod("nanTest", *this, &ConvertTest::nanTest); registerMethod("infTest", *this, &ConvertTest::infTest); registerMethod("emptyTest", *this, &ConvertTest::emptyTest); registerMethod("floatTest", *this, &ConvertTest::floatTest); } void successTest() { std::string s(" -15 "); int n = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(n = cxxtools::convert(s)); CXXTOOLS_UNIT_ASSERT_EQUALS(n, -15); cxxtools::String S(L" -42 "); CXXTOOLS_UNIT_ASSERT_NOTHROW(n = cxxtools::convert(S)); CXXTOOLS_UNIT_ASSERT_EQUALS(n, -42); } void failTest() { std::string s(" -15 a"); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(s), cxxtools::ConversionError); cxxtools::String S(L" -42 a"); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(S), cxxtools::ConversionError); } void nanTest() { // test string to number // test nan double d = cxxtools::convert(std::string("NaN")); CXXTOOLS_UNIT_ASSERT(d != d); float f = cxxtools::convert(std::string("NaN")); CXXTOOLS_UNIT_ASSERT(f != f); d = cxxtools::convert(cxxtools::String(L"NaN")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert(cxxtools::String(L"NaN")); CXXTOOLS_UNIT_ASSERT(f != f); // test quiet nan d = cxxtools::convert(std::string("NaNQ")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert(std::string("NaNQ")); CXXTOOLS_UNIT_ASSERT(f != f); d = cxxtools::convert(cxxtools::String(L"NaNQ")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert(cxxtools::String(L"NaNQ")); CXXTOOLS_UNIT_ASSERT(f != f); // test signaling nan d = cxxtools::convert(std::string("NaNS")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert(std::string("NaNS")); CXXTOOLS_UNIT_ASSERT(f != f); d = cxxtools::convert(cxxtools::String(L"NaNS")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert(cxxtools::String(L"NaNS")); CXXTOOLS_UNIT_ASSERT(f != f); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(cxxtools::String(L"NaNF")), cxxtools::ConversionError); // test number to string std::string s = cxxtools::convert(d); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "nan"); s = cxxtools::convert(f); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "nan"); cxxtools::String ss = cxxtools::convert(d); CXXTOOLS_UNIT_ASSERT_EQUALS(ss.narrow(), "nan"); ss = cxxtools::convert(f); CXXTOOLS_UNIT_ASSERT_EQUALS(ss.narrow(), "nan"); } void infTest() { // test string to number double d = cxxtools::convert(std::string("inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits::infinity()); d = cxxtools::convert(std::string("infinity")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits::infinity()); float f = cxxtools::convert(std::string("inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits::infinity()); d = cxxtools::convert(cxxtools::String(L"iNf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits::infinity()); f = cxxtools::convert(cxxtools::String(L"inF")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits::infinity()); // test number to string std::string s = cxxtools::convert(d); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "inf"); s = cxxtools::convert(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(s.c_str(), "inf") == 0); cxxtools::String ss = cxxtools::convert(d); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "inf") == 0); ss = cxxtools::convert(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "inf") == 0); // negative inf // string to number d = cxxtools::convert(std::string("-inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits::infinity()); f = cxxtools::convert(std::string("-inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits::infinity()); d = cxxtools::convert(cxxtools::String(L"-iNf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits::infinity()); f = cxxtools::convert(cxxtools::String(L"-INF")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits::infinity()); // test number to string s = cxxtools::convert(d); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "-inf"); s = cxxtools::convert(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(s.c_str(), "-inf") == 0); ss = cxxtools::convert(d); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "-inf") == 0); ss = cxxtools::convert(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "-inf") == 0); } void emptyTest() { std::string emptyString; CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(std::string()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(cxxtools::String()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(std::string()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(cxxtools::String()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(std::string()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert(cxxtools::String()), cxxtools::ConversionError); } void t(double d) { std::string s = cxxtools::convert(d); double r = cxxtools::convert(s); if (r == 0) { CXXTOOLS_UNIT_ASSERT_EQUALS(d, 0); } else { double q = d / r; log_debug("d=" << d << " s=\"" << s << "\" r=" << r << " q=" << q); if (q < 0.999999999999 || q > 1.0000000000001) { CXXTOOLS_UNIT_ASSERT_EQUALS(d, r); } } } void floatTest() { double d; d = cxxtools::convert("1.5"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 1.5); d = cxxtools::convert(" -345.75 "); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -345.75); d = cxxtools::convert("\n1e6\r"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 1e6); d = cxxtools::convert("7.0e4"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 7e4); d = cxxtools::convert("-2e-3"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -2e-3)); d = cxxtools::convert("-8E-5"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -8e-5)); d = cxxtools::convert("-3.0e-12"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -3e-12)); d = cxxtools::convert("-8.5E-23"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -8.5e-23)); t(3.141592653579893); t(0.314); t(0.0314); t(0.00123); t(123456789.55555555); t(0); t(1); t(1.4567e17); t(12345); t(1.4567e-17); t(0.2); t(12); } }; cxxtools::unit::RegisterTest register_ConvertTest; cxxtools-3.0/test/timespan-test.cpp0000664000175000017500000004471113644433072014457 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "cxxtools/timespan.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" class TimespanTest : public cxxtools::unit::TestSuite { public: TimespanTest() : cxxtools::unit::TestSuite("timespan") { registerMethod("compare", *this, &TimespanTest::compare); registerMethod("arithmetic", *this, &TimespanTest::arithmetic); registerMethod("muldiv", *this, &TimespanTest::muldiv); registerMethod("microseconds", *this, &TimespanTest::microseconds); registerMethod("milliseconds", *this, &TimespanTest::milliseconds); registerMethod("seconds", *this, &TimespanTest::seconds); registerMethod("minutes", *this, &TimespanTest::minutes); registerMethod("hours", *this, &TimespanTest::hours); registerMethod("days", *this, &TimespanTest::days); registerMethod("serialize", *this, &TimespanTest::serialize); registerMethod("serializeunits", *this, &TimespanTest::serializeunits); registerMethod("deserializeunits", *this, &TimespanTest::deserializeunits); registerMethod("deserializeweaktimespan", *this, &TimespanTest::deserializeweaktimespan); registerMethod("ostream", *this, &TimespanTest::ostream); registerMethod("istream", *this, &TimespanTest::istream); registerMethod("istreamunits", *this, &TimespanTest::istreamunits); registerMethod("ceil", *this, &TimespanTest::ceil); } void compare() { cxxtools::Timespan t(1234567); cxxtools::Timespan t1(1234567); cxxtools::Timespan t2(1234568); CXXTOOLS_UNIT_ASSERT(t == t1); CXXTOOLS_UNIT_ASSERT(!(t == t2)); CXXTOOLS_UNIT_ASSERT(!(t != t1)); CXXTOOLS_UNIT_ASSERT(t != t2); CXXTOOLS_UNIT_ASSERT(t1 < t2); CXXTOOLS_UNIT_ASSERT(!(t2 < t1)); CXXTOOLS_UNIT_ASSERT(!(t2 <= t1)); CXXTOOLS_UNIT_ASSERT(t1 <= t1); CXXTOOLS_UNIT_ASSERT(t1 <= t2); CXXTOOLS_UNIT_ASSERT(t2 > t1); CXXTOOLS_UNIT_ASSERT(!(t1 > t2)); CXXTOOLS_UNIT_ASSERT(!(t1 >= t2)); CXXTOOLS_UNIT_ASSERT(t2 >= t2); CXXTOOLS_UNIT_ASSERT(t2 >= t1); } void arithmetic() { cxxtools::Timespan t1(4000); cxxtools::Timespan t2(100); cxxtools::Timespan sum = t1 + t2; CXXTOOLS_UNIT_ASSERT_EQUALS(sum, cxxtools::Timespan(4100)); cxxtools::Timespan diff = t1 - t2; CXXTOOLS_UNIT_ASSERT_EQUALS(diff, cxxtools::Timespan(3900)); cxxtools::Timespan t; t = t1; t += t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Timespan(4100)); t = t1; t -= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Timespan(3900)); t = -t1; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Timespan(-4000)); } void muldiv() { cxxtools::Seconds t1(2500); cxxtools::Timespan d = t1 * 2.0; CXXTOOLS_UNIT_ASSERT_EQUALS(d, cxxtools::Seconds(5000)); d = 3.0 * t1; CXXTOOLS_UNIT_ASSERT_EQUALS(d, cxxtools::Seconds(7500)); d = t1 / 2.0; CXXTOOLS_UNIT_ASSERT_EQUALS(d, cxxtools::Seconds(1250)); } void microseconds() { cxxtools::Timespan t = cxxtools::Microseconds(1234567); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalUSecs(), 1234567); // due to rounding errors msecs are just nearly equal: CXXTOOLS_UNIT_ASSERT(t.totalMSecs()/1234.567 > 0.999999 && t.totalMSecs()/1234.567 < 1.000001); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Microseconds(t), 1234567); } void milliseconds() { cxxtools::Timespan t = cxxtools::Milliseconds(1234567); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalUSecs(), 1234567000); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalMSecs(), 1234567); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(t), 1234567); } void seconds() { cxxtools::Timespan t = cxxtools::Seconds(1234); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalUSecs(), 1234000000); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalMSecs(), 1234000); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalSeconds(), 1234); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Seconds(t), 1234); } void minutes() { cxxtools::Timespan t = cxxtools::Minutes(17.5); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalUSecs(), (17*60+30)*1000000); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalMSecs(), (17*60+30)*1000); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalSeconds(), 17*60+30); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Minutes(t), 17.5); } void hours() { cxxtools::Timespan t = cxxtools::Hours(17.5); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalSeconds(), 17*3600+1800); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Hours(t), 17.5); } void days() { cxxtools::Timespan t = cxxtools::Days(17.5); CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalSeconds(), (17*3600+1800)*24); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Days(t), 17.5); } void serialize() { cxxtools::Timespan t(1234567); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); } void serializeunits() { { cxxtools::Microseconds t(12345678l); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "microseconds"); long number = 0; si >>= number; CXXTOOLS_UNIT_ASSERT_EQUALS(number, 12345678l); } { cxxtools::Milliseconds t(17.875); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "milliseconds"); double number = 0; si >>= number; CXXTOOLS_UNIT_ASSERT_EQUALS(number, 17.875); } { cxxtools::Seconds t(17.875); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "seconds"); double number = 0; si >>= number; CXXTOOLS_UNIT_ASSERT_EQUALS(number, 17.875); } { cxxtools::Seconds t(cxxtools::Timespan(14999999)); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalUSecs(), t2.totalUSecs()); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "seconds"); } { cxxtools::Seconds t(cxxtools::Timespan(14999998)); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "seconds"); } { cxxtools::Minutes t(17.875); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "minutes"); double number = 0; si >>= number; CXXTOOLS_UNIT_ASSERT_EQUALS(number, 17.875); } { cxxtools::Hours t(17.875); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "hours"); double number = 0; si >>= number; CXXTOOLS_UNIT_ASSERT_EQUALS(number, 17.875); } { cxxtools::Days t(17.875); cxxtools::SerializationInfo si; si <<= t; cxxtools::Timespan t2; si >>= t2; CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "days"); double number = 0; si >>= number; CXXTOOLS_UNIT_ASSERT_EQUALS(number, 17.875); } } void deserializeunits() { { cxxtools::SerializationInfo si; si <<= "2us"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Microseconds(2)); } { cxxtools::SerializationInfo si; si <<= "2.5ms"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Milliseconds(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5s"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Seconds(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5min"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Minutes(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5ho"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Hours(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5days"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Days(2.5)); } } void deserializeweaktimespan() { { cxxtools::SerializationInfo si; si <<= "2"; cxxtools::Timespan t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Microseconds(2)); } { cxxtools::SerializationInfo si; si <<= "2.5"; cxxtools::Milliseconds t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Milliseconds(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5"; cxxtools::Seconds t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Seconds(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5"; cxxtools::Minutes t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Minutes(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5"; cxxtools::Hours t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Hours(2.5)); } { cxxtools::SerializationInfo si; si <<= "2.5"; cxxtools::Days t; si >>= t; CXXTOOLS_UNIT_ASSERT_EQUALS(t, cxxtools::Days(2.5)); } } void ostream() { { std::ostringstream s; s << cxxtools::Microseconds(823); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "823us"); } { std::ostringstream s; s << cxxtools::Milliseconds(823); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "823ms"); } { std::ostringstream s; s << cxxtools::Seconds(823); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "823s"); } { std::ostringstream s; s << cxxtools::Minutes(823); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "823min"); } { std::ostringstream s; s << cxxtools::Hours(823); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "823h"); } { std::ostringstream s; s << cxxtools::Days(823); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "823d"); } } void istream() { { std::istringstream s("823"); cxxtools::Microseconds ts; s >> ts; CXXTOOLS_UNIT_ASSERT(!s.fail()); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Microseconds(823)); } { std::istringstream s("823"); cxxtools::Milliseconds ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Milliseconds(823)); } { std::istringstream s("823"); cxxtools::Seconds ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Seconds(823)); } { std::istringstream s("823"); cxxtools::Minutes ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Minutes(823)); } { std::istringstream s("823"); cxxtools::Hours ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Hours(823)); } { std::istringstream s("823"); cxxtools::Days ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Days(823)); } } void istreamunits() { { std::istringstream s("823u"); cxxtools::Timespan ts; s >> ts; CXXTOOLS_UNIT_ASSERT(!s.fail()); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Microseconds(823)); } { std::istringstream s("823ms"); cxxtools::Seconds ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Milliseconds(823)); } { std::istringstream s("823s"); cxxtools::Timespan ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Seconds(823)); } { std::istringstream s("823.5m"); cxxtools::Timespan ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Minutes(823.5)); } { std::istringstream s("823mi"); cxxtools::Timespan ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Minutes(823)); } { std::istringstream s("823h"); cxxtools::Timespan ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Hours(823)); } { std::istringstream s("823d"); cxxtools::Timespan ts; s >> ts; CXXTOOLS_UNIT_ASSERT(s); CXXTOOLS_UNIT_ASSERT_EQUALS(ts, cxxtools::Days(823)); } } void ceil() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(4).ceil(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(4.1).ceil(), 5); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(-1).ceil(), -1); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(-.9).ceil(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(-9).ceil(), -9); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::Milliseconds(-11.1).ceil(), -11); } }; cxxtools::unit::RegisterTest register_TimespanTest; cxxtools-3.0/test/iniparser-test.cpp0000664000175000017500000001222613644433072014627 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/iniparser.h" #include namespace { class E : public cxxtools::IniParser::Event { cxxtools::String _result; public: const cxxtools::String& result() const { return _result; } void clear() { _result.clear(); } virtual bool onSection(const cxxtools::String& section); virtual bool onKey(const cxxtools::String& key); virtual bool onValue(const cxxtools::String& value); virtual bool onComment(const cxxtools::String& comment); virtual bool onError(); }; bool E::onSection(const cxxtools::String& section) { _result += L"S("; _result += section; _result += L')'; return false; } bool E::onKey(const cxxtools::String& key) { _result += L"K("; _result += key; _result += L')'; return false; } bool E::onValue(const cxxtools::String& value) { _result += L"V("; _result += value; _result += L')'; return false; } bool E::onComment(const cxxtools::String& comment) { _result += L"C("; _result += comment; _result += L')'; return false; } bool E::onError() { _result += L"E"; return false; } } class IniParserTest : public cxxtools::unit::TestSuite { public: IniParserTest() : cxxtools::unit::TestSuite("iniparser") { registerMethod("testIniParser", *this, &IniParserTest::testIniParser); registerMethod("testEmptyValue", *this, &IniParserTest::testEmptyValue); registerMethod("testSingleQuotedValue", *this, &IniParserTest::testSingleQuotedValue); registerMethod("testDoubleQuotedValue", *this, &IniParserTest::testDoubleQuotedValue); registerMethod("testEscapedValue", *this, &IniParserTest::testEscapedValue); } void testIniParser() { std::istringstream inifile( "[s1]\n" "k1=v1 \n" "k2= v2\n" "k3=v3"); E e; cxxtools::IniParser p(e); p.parse(inifile); CXXTOOLS_UNIT_ASSERT_EQUALS(e.result(), "S(s1)K(k1)V(v1)K(k2)V(v2)K(k3)V(v3)"); } void testEmptyValue() { std::istringstream inifile( "[s1]\n" "k1=\n" "[s2]\n" "k2=\n" ); E e; cxxtools::IniParser p(e); p.parse(inifile); CXXTOOLS_UNIT_ASSERT_EQUALS(e.result(), "S(s1)K(k1)V()S(s2)K(k2)V()"); } void testSingleQuotedValue() { std::istringstream inifile( "[s1]\n" "k1= ' v1 ' \n"); E e; cxxtools::IniParser p(e); p.parse(inifile); CXXTOOLS_UNIT_ASSERT_EQUALS(e.result(), "S(s1)K(k1)V( v1 )"); } void testDoubleQuotedValue() { std::istringstream inifile( "[s1]\n" "k1= \" v1 \""); E e; cxxtools::IniParser p(e); p.parse(inifile); CXXTOOLS_UNIT_ASSERT_EQUALS(e.result(), "S(s1)K(k1)V( v1 )"); } void testEscapedValue() { std::istringstream inifile( "[s1]\n" "k1=\" \\r\\t\\n\\\"\\' \"\n" "k2=' \\r\\t\\n\\\"\\' '\n" "k3= v\\t\\\"\\' \n"); E e; cxxtools::IniParser p(e); p.parse(inifile); CXXTOOLS_UNIT_ASSERT_EQUALS(e.result(), "S(s1)K(k1)V( \r\t\n\"' )K(k2)V( \r\t\n\"' )K(k3)V(v\t\"')"); } }; cxxtools::unit::RegisterTest register_IniParserTest; cxxtools-3.0/test/iso8859_1-test.cpp0000664000175000017500000000432613644433072014205 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iso8859_1codec.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" class Iso8859_1Test : public cxxtools::unit::TestSuite { public: Iso8859_1Test() : cxxtools::unit::TestSuite("iso8859_1") { registerMethod("encode", *this, &Iso8859_1Test::encodeTest); registerMethod("decode", *this, &Iso8859_1Test::decodeTest); } void encodeTest() { cxxtools::String ustr(L"Hi \xe4 there"); std::string bstr = cxxtools::Iso8859_1Codec::encode(ustr); CXXTOOLS_UNIT_ASSERT_EQUALS(bstr, "Hi \xe4 there"); } void decodeTest() { std::string bstr("Hi \xe4 there"); cxxtools::String ustr = cxxtools::Iso8859_1Codec::decode(bstr); CXXTOOLS_UNIT_ASSERT(ustr == L"Hi \xe4 there"); } }; cxxtools::unit::RegisterTest register_Iso8859_1Test; cxxtools-3.0/test/split-test.cpp0000664000175000017500000000756413644433072013777 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/split.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include class SplitTest : public cxxtools::unit::TestSuite { public: SplitTest() : cxxtools::unit::TestSuite("split") { registerMethod("splitString", *this, &SplitTest::splitString); registerMethod("emptySplit", *this, &SplitTest::emptySplit); registerMethod("lastEmpty", *this, &SplitTest::lastEmpty); registerMethod("charsetSplit", *this, &SplitTest::charsetSplit); registerMethod("regexSplit", *this, &SplitTest::regexSplit); registerMethod("regexEmptySplit", *this, &SplitTest::regexEmptySplit); } void splitString() { std::vector d; std::string t = "Hello:World:!"; cxxtools::split(':', t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], "!"); } void emptySplit() { std::vector d; std::string t; cxxtools::split(':', t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 0); } void lastEmpty() { std::vector d; std::string t = "Hello:World:"; cxxtools::split(':', t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], ""); } void charsetSplit() { std::vector d; std::string t = "Hello:World;!"; cxxtools::split(";:,.", t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], "!"); } void regexSplit() { std::vector d; std::string t = "Hello:World)!"; cxxtools::split(cxxtools::Regex("[:)]"), t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], "!"); } void regexEmptySplit() { std::vector d; std::string t; cxxtools::split(cxxtools::Regex("[:)]"), t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 0); } }; cxxtools::unit::RegisterTest register_SplitTest; cxxtools-3.0/test/pool-test.cpp0000664000175000017500000000724713644433072013613 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/pool.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class PoolTest : public cxxtools::unit::TestSuite { struct Object { static unsigned instCount; static unsigned ctorCount; Object() { ++instCount; ++ctorCount; } ~Object() { --instCount; } }; public: PoolTest() : cxxtools::unit::TestSuite("pool") { registerMethod("poolTest", *this, &PoolTest::poolTest); registerMethod("maxspareTest", *this, &PoolTest::maxspareTest); } void setUp() { Object::instCount = 0; Object::ctorCount = 0; } void poolTest() { { typedef cxxtools::Pool PoolType; PoolType pool; { PoolType::Ptr p = pool.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 1); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); { PoolType::Ptr p = pool.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 1); } CXXTOOLS_UNIT_ASSERT_EQUALS(Object::instCount, 0); } void maxspareTest() { typedef cxxtools::Pool PoolType; PoolType pool(3); { std::vector p; while (p.size() < 10) p.push_back(pool.get()); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 10); p.pop_back(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); p.pop_back(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 2); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 3); { PoolType::Ptr b = pool.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 2); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 10); pool.drop(1); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); pool.drop(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::instCount, 0); } }; unsigned PoolTest::Object::instCount = 0; unsigned PoolTest::Object::ctorCount = 0; cxxtools::unit::RegisterTest register_PoolTest; cxxtools-3.0/test/file-test.cpp0000664000175000017500000001414113644433072013550 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/log.h" #include "cxxtools/file.h" #include "cxxtools/fileinfo.h" #include log_define("cxxtools.test.file") const std::string tmpFileName = "file-test.tmp"; const std::string tmpFileName2 = "file-test-2.tmp"; class FileTest : public cxxtools::unit::TestSuite { void forceRemoveFile(const std::string& fname) { try { cxxtools::FileInfo(fname).remove(); } catch (const cxxtools::FileNotFound&) { } } public: FileTest() : cxxtools::unit::TestSuite("file") { registerMethod("testCreateFile", *this, &FileTest::testCreateFile); registerMethod("testRemoveFile", *this, &FileTest::testRemoveFile); registerMethod("testMoveFile", *this, &FileTest::testMoveFile); registerMethod("testLinkFile", *this, &FileTest::testLinkFile); registerMethod("testSymlinkFile", *this, &FileTest::testSymlinkFile); registerMethod("testCopyFile", *this, &FileTest::testCopyFile); registerMethod("testFilesize", *this, &FileTest::testFilesize); registerMethod("testCopyBigFile", *this, &FileTest::testCopyBigFile); } void setUp() { forceRemoveFile(tmpFileName); forceRemoveFile(tmpFileName2); } void tearDown() { forceRemoveFile(tmpFileName); forceRemoveFile(tmpFileName2); } void testCreateFile() { CXXTOOLS_UNIT_ASSERT(!cxxtools::FileInfo::exists(tmpFileName)); cxxtools::File::create(tmpFileName); CXXTOOLS_UNIT_ASSERT(cxxtools::FileInfo::exists(tmpFileName)); } void testRemoveFile() { cxxtools::File::create(tmpFileName); cxxtools::File f(tmpFileName); f.remove(); CXXTOOLS_UNIT_ASSERT(!cxxtools::FileInfo::exists(tmpFileName)); } void testMoveFile() { cxxtools::File::create(tmpFileName); cxxtools::File f(tmpFileName); f.move(tmpFileName2); CXXTOOLS_UNIT_ASSERT(!cxxtools::FileInfo::exists(tmpFileName)); CXXTOOLS_UNIT_ASSERT(cxxtools::FileInfo::exists(tmpFileName2)); } void testLinkFile() { cxxtools::File::create(tmpFileName); cxxtools::File f(tmpFileName); f.link(tmpFileName2); cxxtools::FileInfo fi(tmpFileName); cxxtools::FileInfo fi2(tmpFileName2); CXXTOOLS_UNIT_ASSERT_EQUALS(fi.type(), cxxtools::FileInfo::File); CXXTOOLS_UNIT_ASSERT_EQUALS(fi2.type(), cxxtools::FileInfo::File); } void testSymlinkFile() { cxxtools::File::create(tmpFileName); cxxtools::File f(tmpFileName); f.symlink(tmpFileName2); cxxtools::FileInfo fi(tmpFileName); cxxtools::FileInfo fi2(tmpFileName2); CXXTOOLS_UNIT_ASSERT_EQUALS(fi.type(), cxxtools::FileInfo::File); CXXTOOLS_UNIT_ASSERT_EQUALS(fi2.type(), cxxtools::FileInfo::Symlink); } void testCopyFile() { cxxtools::File::create(tmpFileName); cxxtools::File f(tmpFileName); f.copy(tmpFileName2); cxxtools::FileInfo fi(tmpFileName); cxxtools::FileInfo fi2(tmpFileName2); CXXTOOLS_UNIT_ASSERT_EQUALS(fi.type(), cxxtools::FileInfo::File); CXXTOOLS_UNIT_ASSERT_EQUALS(fi2.type(), cxxtools::FileInfo::File); } void testFilesize() { std::string data; for (unsigned n = 0; n < 0x10003; ++n) data += static_cast(n); std::ofstream f(tmpFileName.c_str()); f << data; f.close(); cxxtools::FileInfo fi(tmpFileName); CXXTOOLS_UNIT_ASSERT_EQUALS(fi.size(), 0x10003); } void testCopyBigFile() { std::string data; for (unsigned n = 0; n < 0x10003; ++n) data += static_cast(n); std::ofstream of(tmpFileName.c_str()); of << data; of.close(); cxxtools::File f(tmpFileName); f.copy(tmpFileName2); cxxtools::FileInfo fi2(tmpFileName2); CXXTOOLS_UNIT_ASSERT_EQUALS(fi2.size(), 0x10003); std::ostringstream s; std::ifstream ifs(tmpFileName.c_str()); s << ifs.rdbuf(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str().size(), 0x10003); CXXTOOLS_UNIT_ASSERT(s.str() == data); } }; cxxtools::unit::RegisterTest register_FileTest; cxxtools-3.0/test/iniserialization-test.cpp0000664000175000017500000001446313644433072016215 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/ini.h" #include namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue; } struct TestObjects { TestObject s1; TestObject s2; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObjects& obj) { si.getMember("s1") >>= obj.s1; si.getMember("s2") >>= obj.s2; } void operator<<= (cxxtools::SerializationInfo& si, const TestObjects& obj) { si.addMember("s1") <<= obj.s1; si.addMember("s2") <<= obj.s2; } bool operator== (const TestObjects& obj1, const TestObjects& obj2) { return obj1.s1 == obj2.s1 && obj1.s2 == obj2.s2; } } class IniSerializationTest : public cxxtools::unit::TestSuite { public: IniSerializationTest() : cxxtools::unit::TestSuite("iniserialization") { registerMethod("testReadVector", *this, &IniSerializationTest::testReadVector); registerMethod("testWriteReadObject", *this, &IniSerializationTest::testWriteReadObject); registerMethod("testReadValues", *this, &IniSerializationTest::testReadValues); registerMethod("testWriteReadValues", *this, &IniSerializationTest::testWriteReadValues); } void testReadVector() { std::istringstream in( "[s1]\n" "intValue=42\n" "stringValue=foobar\n" "doubleValue=3.125\n" "boolValue=true\n" "[s2]\n" "intValue=17\n" "stringValue=baz\n" "doubleValue=-1.5\n" "boolValue=false\n" ); std::vector v; in >> cxxtools::Ini(v); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v[0].intValue, 42); CXXTOOLS_UNIT_ASSERT_EQUALS(v[0].stringValue, "foobar"); CXXTOOLS_UNIT_ASSERT_EQUALS(v[0].doubleValue, 3.125); CXXTOOLS_UNIT_ASSERT_EQUALS(v[0].boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(v[1].intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(v[1].stringValue, "baz"); CXXTOOLS_UNIT_ASSERT_EQUALS(v[1].doubleValue, -1.5); CXXTOOLS_UNIT_ASSERT_EQUALS(v[1].boolValue, false); } void testWriteReadObject() { TestObjects to; to.s1.intValue = 17; to.s1.stringValue = "baz"; to.s1.doubleValue = -345.5; to.s1.boolValue = true; to.s2.intValue = 42; to.s2.stringValue = "foobar"; to.s2.doubleValue = 3.125; to.s2.boolValue = false; std::stringstream inout; inout << cxxtools::Ini(to); TestObjects to2; inout >> cxxtools::Ini(to2); CXXTOOLS_UNIT_ASSERT(to == to2); } void testReadValues() { std::istringstream in( "intValue=42\n" "stringValue=foobar\n" "doubleValue=3.125\n" "boolValue=true\n"); TestObject obj; in >> cxxtools::Ini(obj); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, 42); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, "foobar"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, 3.125); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, true); } void testWriteReadValues() { TestObject obj; obj.intValue = 17; obj.stringValue = "baz"; obj.doubleValue = -345.5; obj.boolValue = true; std::stringstream inout; inout << cxxtools::Ini(obj); TestObject obj2; inout >> cxxtools::Ini(obj2); CXXTOOLS_UNIT_ASSERT(obj == obj2); } }; cxxtools::unit::RegisterTest register_IniSerializationTest; cxxtools-3.0/test/csvserializer-test.cpp0000664000175000017500000002153413644433072015522 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/csvserializer.h" #include "cxxtools/csv.h" #include "cxxtools/log.h" //log_define("cxxtools.test.csvserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } } class CsvSerializerTest : public cxxtools::unit::TestSuite { public: CsvSerializerTest() : cxxtools::unit::TestSuite("csvserializer") { registerMethod("testVectorVector", *this, &CsvSerializerTest::testVectorVector); registerMethod("testObjectVector", *this, &CsvSerializerTest::testObjectVector); registerMethod("testPartialObject", *this, &CsvSerializerTest::testPartialObject); registerMethod("testCustomTitles", *this, &CsvSerializerTest::testCustomTitles); registerMethod("testEmptyCsvWithTitles", *this, &CsvSerializerTest::testEmptyCsvWithTitles); registerMethod("testCustomChars", *this, &CsvSerializerTest::testCustomChars); registerMethod("testMultichar", *this, &CsvSerializerTest::testMultichar); registerMethod("testOStream", *this, &CsvSerializerTest::testOStream); registerMethod("testLinefeeddata", *this, &CsvSerializerTest::testLinefeeddata); } void testVectorVector() { std::vector > data; data.resize(2); data[0].push_back("Hello"); data[0].push_back("World"); data[1].push_back("34"); data[1].push_back("67"); std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "Hello,World\n" "34,67\n"); } void testObjectVector() { std::vector data; data.resize(2); data[0].intValue = 17; data[0].stringValue = "Hi"; data[0].doubleValue = 7.5; data[0].boolValue = true; data[1].intValue = -2; data[1].stringValue = "Foo"; data[1].doubleValue = -8; data[1].boolValue = false; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "intValue,stringValue,doubleValue,boolValue\n" "17,Hi,7.5,true\n" "-2,Foo,-8,false\n"); } void testPartialObject() { std::vector data; data.resize(2); data[0].intValue = 17; data[0].stringValue = "Hi"; data[0].doubleValue = 7.5; data[0].boolValue = true; data[1].intValue = -2; data[1].stringValue = "Foo"; data[1].doubleValue = -8; data[1].boolValue = false; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.selectColumn("stringValue"); serializer.selectColumn("intValue"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "stringValue,intValue\n" "Hi,17\n" "Foo,-2\n"); } void testCustomTitles() { std::vector data; data.resize(2); data[0].intValue = 17; data[0].stringValue = "Hi"; data[0].doubleValue = 7.5; data[0].boolValue = true; data[1].intValue = -2; data[1].stringValue = "Foo"; data[1].doubleValue = -8; data[1].boolValue = false; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.selectColumn("stringValue", "col1"); serializer.selectColumn("intValue", "col2"); serializer.selectColumn("doubleValue", "col3"); serializer.selectColumn("boolValue", "col4"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "col1,col2,col3,col4\n" "Hi,17,7.5,true\n" "Foo,-2,-8,false\n"); } void testEmptyCsvWithTitles() { std::vector data; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.selectColumn("stringValue", "col1"); serializer.selectColumn("intValue", "col2"); serializer.selectColumn("doubleValue", "col3"); serializer.selectColumn("boolValue", "col4"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "col1,col2,col3,col4\n"); } void testCustomChars() { std::vector > data; data.resize(2); data[0].push_back("Hello"); data[0].push_back("fWorld"); data[1].push_back("34"); data[1].push_back("67"); std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.delimiter('l'); serializer.quote('f'); serializer.lineEnding(L"Tab"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "fHelloflfffWorldfTab" "34l67Tab"); } void testMultichar() { std::vector > data; data.resize(2); data[0].push_back("Hello"); data[0].push_back("World"); data[1].push_back("34"); data[1].push_back("67"); std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.delimiter(L"foobar"); serializer.lineEnding(L"\r\n"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "HellofoobarWorld\r\n" "34foobar67\r\n"); } void testOStream() { std::vector > data(2); data[0].push_back("Hello"); data[0].push_back("World"); data[1].push_back("34"); data[1].push_back("67"); std::ostringstream out; out << cxxtools::Csv(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "Hello,World\n" "34,67\n"); } void testLinefeeddata() { std::vector > data(2); data[0].push_back("Hello"); data[0].push_back("World"); data[1].push_back("foo\nbar"); data[1].push_back("blub"); std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "Hello,World\n" "\"foo\nbar\",blub\n"); } }; cxxtools::unit::RegisterTest register_CsvSerializerTest; cxxtools-3.0/test/jsonrpc-test.cpp0000664000175000017500000006620413644433072014316 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/json/rpcclient.h" #include "cxxtools/json/rpcserver.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include "cxxtools/ioerror.h" #include "cxxtools/net/uri.h" #include "cxxtools/net/addrinfo.h" #include #include log_define("cxxtools.test.jsonrpc") namespace { struct Color { int red; int green; int blue; }; typedef std::set IntSet; typedef std::multiset IntMultiset; typedef std::map IntMap; typedef std::multimap IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class JsonRpcTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::json::RpcServer* _server; unsigned _count; std::string _listen; unsigned short _port; public: JsonRpcTest() : cxxtools::unit::TestSuite("jsonrpc"), _port(7003) { registerMethod("Nothing", *this, &JsonRpcTest::Nothing); registerMethod("Boolean", *this, &JsonRpcTest::Boolean); registerMethod("Integer", *this, &JsonRpcTest::Integer); registerMethod("Double", *this, &JsonRpcTest::Double); registerMethod("String", *this, &JsonRpcTest::String); registerMethod("EmptyValues", *this, &JsonRpcTest::EmptyValues); registerMethod("Array", *this, &JsonRpcTest::Array); registerMethod("EmptyArray", *this, &JsonRpcTest::EmptyArray); registerMethod("Struct", *this, &JsonRpcTest::Struct); registerMethod("Set", *this, &JsonRpcTest::Set); registerMethod("Multiset", *this, &JsonRpcTest::Multiset); registerMethod("Map", *this, &JsonRpcTest::Map); registerMethod("Multimap", *this, &JsonRpcTest::Multimap); registerMethod("UnknownMethod", *this, &JsonRpcTest::UnknownMethod); registerMethod("CallPrefix", *this, &JsonRpcTest::CallPrefix); registerMethod("Fault", *this, &JsonRpcTest::Fault); registerMethod("Exception", *this, &JsonRpcTest::Exception); registerMethod("CallbackException", *this, &JsonRpcTest::CallbackException); registerMethod("ConnectError", *this, &JsonRpcTest::ConnectError); registerMethod("BigRequest", *this, &JsonRpcTest::BigRequest); registerMethod("PrepareConnect", *this, &JsonRpcTest::PrepareConnect); registerMethod("Connect", *this, &JsonRpcTest::Connect); registerMethod("Multiple", *this, &JsonRpcTest::Multiple); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } char* LISTEN = getenv("UTEST_LISTEN"); if (LISTEN) _listen = LISTEN; } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &JsonRpcTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); _server = new cxxtools::json::RpcServer(_loop, _listen, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyNothing); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyNothing); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(cxxtools::RemoteResult& /*r*/) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::json::RpcClient client(_loop, _listen, _port + 1); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(cxxtools::RemoteResult& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { _server->registerMethod("boolean", *this, &JsonRpcTest::boolean); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "boolean"); multiply.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), true); } bool boolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyInt); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyDouble); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { _server->registerMethod("echoString", *this, &JsonRpcTest::echoString); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyEmpty); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyVector); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector multiplyVector(const std::vector& a, const std::vector& b) { std::vector r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyVector); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyColor); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { _server->registerMethod("multiplyset", *this, &JsonRpcTest::multiplySet); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { _server->registerMethod("multiplyset", *this, &JsonRpcTest::multiplyMultiset); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { _server->registerMethod("multiplymap", *this, &JsonRpcTest::multiplyMap); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { _server->registerMethod("multiplymultimap", *this, &JsonRpcTest::multiplyMultimap); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // CallPrefix // void CallPrefix() { _server->registerMethod("somePrefix.multiply", *this, &JsonRpcTest::multiplyInt); cxxtools::json::RpcClient client(_loop, _listen, _port); client.prefix("somePrefix."); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } void UnknownMethod() { cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure unknownMethod(client, "unknownMethod"); unknownMethod.begin(); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { _server->registerMethod("multiply", *this, &JsonRpcTest::throwFault); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { _server->registerMethod("multiply", *this, &JsonRpcTest::throwException); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { _server->registerMethod("countSize", *this, &JsonRpcTest::countSize); cxxtools::json::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure > countSize(client, "countSize"); std::vector v; v.resize(5000); countSize.begin(v); try { countSize.end(2000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector& v) { return v.size(); } //////////////////////////////////////////////////////////// // PrepareConnect // void PrepareConnect() { log_trace("PrepareConnect"); _server->registerMethod("boolean", *this, &JsonRpcTest::boolean); // test connect using cxxtools::net::AddrInfo { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(cxxtools::net::AddrInfo(_listen, _port)); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(_listen, _port); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "json://localhost:" << _port << '/'; client.prepareConnect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect in connect { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1)); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(), cxxtools::IOError); } // test failing connect when calling function { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1)); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(boolean.end(2000), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Connect // void Connect() { _server->registerMethod("boolean", *this, &JsonRpcTest::boolean); // test connect using cxxtools::net::AddrInfo { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(cxxtools::net::AddrInfo(_listen, _port)); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(_listen, _port); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "json://localhost:" << _port << '/'; client.connect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect { cxxtools::json::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(_listen, _port + 1), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Multiple calls // void Multiple() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyDouble); typedef cxxtools::RemoteProcedure Multiply; std::vector clients; std::vector procs; clients.reserve(16); procs.reserve(16); for (unsigned i = 0; i < 16; ++i) { clients.push_back(cxxtools::json::RpcClient(_loop, _listen, _port)); procs.push_back(Multiply(clients.back(), "multiply")); procs.back().begin(i, i); } for (unsigned i = 0; i < 16; ++i) { CXXTOOLS_UNIT_ASSERT_EQUALS(procs[i].end(2000), i*i); } } }; cxxtools::unit::RegisterTest register_JsonRpcTest; cxxtools-3.0/test/binserializer-test.cpp0000664000175000017500000005207213666667450015515 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/bin/bin.h" #include "cxxtools/bin/formatter.h" #include "cxxtools/log.h" #include "cxxtools/date.h" #include "cxxtools/time.h" #include "cxxtools/datetime.h" #include "cxxtools/timespan.h" #include "cxxtools/hexdump.h" #include #include #include log_define("cxxtools.test.binserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; const cxxtools::SerializationInfo* p = si.findMember("nullValue"); obj.nullValue = p != 0 && p->isNull(); } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue && obj1.nullValue == obj2.nullValue; } struct TestObject2 : public TestObject { typedef std::set SetType; typedef std::map MapType; SetType setValue; MapType mapValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast(obj); si.getMember("setValue") >>= obj.setValue; si.getMember("mapValue") >>= obj.mapValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject2& obj) { si <<= static_cast(obj); si.addMember("setValue") <<= obj.setValue; si.addMember("mapValue") <<= obj.mapValue; si.setTypeName("TestObject2"); } bool operator== (const TestObject2& obj1, const TestObject2& obj2) { return static_cast(obj1) == static_cast(obj2) && obj1.setValue == obj2.setValue && obj1.mapValue == obj2.mapValue; } template std::string toBin(const T& t) { std::ostringstream out; out << cxxtools::bin::Bin(t); return out.str(); } template T fromBin(const std::string& bin) { std::istringstream in(bin); T t; in >> cxxtools::bin::Bin(t); return t; } } class BinSerializerTest : public cxxtools::unit::TestSuite { public: BinSerializerTest() : cxxtools::unit::TestSuite("binserializer") { registerMethod("testScalar", *this, &BinSerializerTest::testScalar); registerMethod("testInt", *this, &BinSerializerTest::testInt); registerMethod("testChar", *this, &BinSerializerTest::testChar); registerMethod("testChar_0", *this, &BinSerializerTest::testChar_0); registerMethod("testString8", *this, &BinSerializerTest::testString8); registerMethod("testString8_0", *this, &BinSerializerTest::testString8_0); registerMethod("testString", *this, &BinSerializerTest::testString); registerMethod("testString_0", *this, &BinSerializerTest::testString_0); registerMethod("testDouble", *this, &BinSerializerTest::testDouble); registerMethod("testArray", *this, &BinSerializerTest::testArray); registerMethod("testObject", *this, &BinSerializerTest::testObject); registerMethod("testComplexObject", *this, &BinSerializerTest::testComplexObject); registerMethod("testObjectVector", *this, &BinSerializerTest::testObjectVector); registerMethod("testBinaryData", *this, &BinSerializerTest::testBinaryData); registerMethod("testReuse", *this, &BinSerializerTest::testReuse); registerMethod("testNamedVector", *this, &BinSerializerTest::testNamedVector); registerMethod("testDate", *this, &BinSerializerTest::testDate); registerMethod("testTime", *this, &BinSerializerTest::testTime); registerMethod("testDatetime", *this, &BinSerializerTest::testDatetime); registerMethod("testTimespan", *this, &BinSerializerTest::testTimespan); registerMethod("testRawString", *this, &BinSerializerTest::testRawString); } void testScalar() { std::stringstream data; int value = 5; data << cxxtools::bin::Bin(value); int value2 = 0; data >> cxxtools::bin::Bin(value2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, value2); } template void testIntValue(IntT value) { std::stringstream data; data << cxxtools::bin::Bin(value); IntT result = 0; data >> cxxtools::bin::Bin(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } template void testStreamableValue(T value, T initvalue) { std::stringstream data; data << cxxtools::bin::Bin(value); T result = initvalue; data >> cxxtools::bin::Bin(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } void testInt() { testIntValue(30); testIntValue(300); testIntValue(100000); testIntValue(-30); testIntValue(-300); testIntValue(-100000); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #endif testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(std::numeric_limits::min()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(std::numeric_limits::min()); #endif testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #endif } void testChar() { testStreamableValue('a', '\xff'); testStreamableValue('\1', '\xff'); } void testChar_0() { testStreamableValue('\0', '\xff'); } void testString8() { testStreamableValue(std::string(""), std::string("init")); testStreamableValue(std::string("Hi there"), std::string("init")); } void testString8_0() { testStreamableValue(std::string(1, '\0'), std::string("init")); } void testString() { testStreamableValue(cxxtools::String(L""), cxxtools::String(L"init")); testStreamableValue(cxxtools::String(L"Hi there"), cxxtools::String(L"init")); } void testString_0() { testStreamableValue(cxxtools::String(1, L'\0'), cxxtools::String(L"init")); } void testDoubleValue(double value) { std::stringstream data; data << cxxtools::bin::Bin(value); double result = 0.0; data >> cxxtools::bin::Bin(result); log_debug("test double value " << value << " =>\n" << cxxtools::hexDump(data.str()) << "\n=> " << result); if (value != value) // check for nan CXXTOOLS_UNIT_ASSERT(result != result); else if (value == std::numeric_limits::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::numeric_limits::infinity()); else if (value == -std::numeric_limits::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, -std::numeric_limits::infinity()); else if (value / result > 1.00001 || value / result < 0.99999) CXXTOOLS_UNIT_FAIL("double test failed; value " << value << " got " << result); } void testDouble() { testDoubleValue(0.0); testDoubleValue(1234.0); // short float testDoubleValue(-1234.0); // short float testDoubleValue(12345678.0); // medium float testDoubleValue(-12345678.0); // medium float testDoubleValue(123456789123456789.0); // long float testDoubleValue(-123456789123456789.0); // long float testDoubleValue(-3.877e-123); testDoubleValue(std::numeric_limits::max()); //testDoubleValue(std::numeric_limits::min()); testDoubleValue(std::numeric_limits::infinity()); testDoubleValue(-std::numeric_limits::infinity()); testDoubleValue(std::numeric_limits::quiet_NaN()); std::stringstream data; data << cxxtools::bin::Bin(std::numeric_limits::quiet_NaN()); double result = 0.0; data >> cxxtools::bin::Bin(result); CXXTOOLS_UNIT_ASSERT(result != result); } void testArray() { std::stringstream data; std::vector intvector; intvector.push_back(4711); intvector.push_back(4712); intvector.push_back(-3); intvector.push_back(-257); data << cxxtools::bin::Bin(intvector); log_debug("intvector:\n" << cxxtools::hexDump(data.str())); std::vector intvector2; data >> cxxtools::bin::Bin(intvector2); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector.size(), intvector2.size()); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[0], intvector2[0]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[1], intvector2[1]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[2], intvector2[2]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[3], intvector2[3]); } void testObject() { std::stringstream data; TestObject obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = true; obj.nullValue = true; data << cxxtools::bin::Bin(obj); log_debug("bindata testobject:\n" << cxxtools::hexDump(data.str())); TestObject obj2; data >> cxxtools::bin::Bin(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, obj2.intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, obj2.stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, obj2.doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, obj2.boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.nullValue, obj2.nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testComplexObject() { std::stringstream data; std::vector v; TestObject2 obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = false; obj.nullValue = true; obj.setValue.insert(17); obj.setValue.insert(23); obj.mapValue[45] = "fourtyfive"; obj.mapValue[88] = "eightyeight"; obj.mapValue[100] = "onehundred"; v.push_back(obj); obj.setValue.insert(88); v.push_back(obj); data << cxxtools::bin::Bin(v); log_debug("bindata complex object:\n" << cxxtools::hexDump(data.str())); std::vector v2; data >> cxxtools::bin::Bin(v2); CXXTOOLS_UNIT_ASSERT(v == v2); } void testObjectVector() { std::stringstream data; std::vector obj; obj.resize(2); obj[0].intValue = 17; obj[0].stringValue = "foobar"; obj[0].doubleValue = 3.125; obj[0].boolValue = true; obj[0].nullValue = true; obj[1].intValue = 18; obj[1].stringValue = "hi there"; obj[1].doubleValue = -17.25; obj[1].boolValue = false; obj[1].nullValue = true; data << cxxtools::bin::Bin(obj); std::vector obj2; data >> cxxtools::bin::Bin(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj2.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].intValue, obj2[0].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].stringValue, obj2[0].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].doubleValue, obj2[0].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].boolValue, obj2[0].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].nullValue, obj2[0].nullValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].intValue, obj2[1].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].stringValue, obj2[1].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].doubleValue, obj2[1].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].boolValue, obj2[1].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].nullValue, obj2[1].nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testBinaryData() { std::stringstream data; std::string v; for (unsigned n = 0; n < 1024; ++n) v.push_back(static_cast(n)); data << cxxtools::bin::Bin(v); std::string v2; data >> cxxtools::bin::Bin(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 1024); CXXTOOLS_UNIT_ASSERT(v == v2); for (unsigned n = 0; n < 0xffff; ++n) v.push_back(static_cast(n)); data << cxxtools::bin::Bin(v); data >> cxxtools::bin::Bin(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT(v == v2); } void testReuse(); void testNamedVector(); void testDate() { std::stringstream data; cxxtools::Date d(1966, 5, 3); data << cxxtools::bin::Bin(d); cxxtools::Date d2; data >> cxxtools::bin::Bin(d2); CXXTOOLS_UNIT_ASSERT(d2 == d); } void testTime() { std::stringstream data; cxxtools::Time d(23, 5, 17, 345); data << cxxtools::bin::Bin(d); cxxtools::Time d2; data >> cxxtools::bin::Bin(d2); CXXTOOLS_UNIT_ASSERT(d2 == d); } void testDatetime() { std::stringstream data; cxxtools::DateTime d(1966, 5, 3, 23, 5, 17, 345); data << cxxtools::bin::Bin(d); cxxtools::DateTime d2; data >> cxxtools::bin::Bin(d2); CXXTOOLS_UNIT_ASSERT(d2 == d); } template static void testTs(TS t) { std::stringstream s; s << cxxtools::bin::Bin(t); TS ts; s >> cxxtools::bin::Bin(ts); CXXTOOLS_UNIT_ASSERT_EQUALS(t, ts); log_info(s.str().size()); } void testTimespan() { testTs(cxxtools::Microseconds(34)); testTs(cxxtools::Milliseconds(124)); testTs(cxxtools::Seconds(cxxtools::Microseconds(34565432))); testTs(cxxtools::Seconds(3456)); testTs(cxxtools::Minutes(18)); testTs(cxxtools::Hours(67)); } void testRawString() { { std::string str = "FOObar"; std::stringstream ss; ss << cxxtools::bin::Bin(str); std::string binData = ss.str(); std::string raw = cxxtools::bin::Formatter::rawString(str); CXXTOOLS_UNIT_ASSERT(binData.find(str) != std::string::npos); CXXTOOLS_UNIT_ASSERT(binData.find(raw) != std::string::npos); } { std::string str = "123:45."; std::stringstream ss; ss << cxxtools::bin::Bin(str); std::string binData = ss.str(); std::string raw = cxxtools::bin::Formatter::rawString(str); CXXTOOLS_UNIT_ASSERT(binData.find(str) == std::string::npos); CXXTOOLS_UNIT_ASSERT(binData.find(raw) != std::string::npos); } } }; void BinSerializerTest::testReuse() { cxxtools::bin::Deserializer d; { std::stringstream data; cxxtools::SerializationInfo si; si.addMember("foo") <<= "bar"; data << cxxtools::bin::Bin(si); d.read(data); cxxtools::SerializationInfo si2; d.deserialize(si2); std::string bar; CXXTOOLS_UNIT_ASSERT_EQUALS(si2.memberCount(), 1); CXXTOOLS_UNIT_ASSERT_NOTHROW(si2.getMember("foo") >>= bar); CXXTOOLS_UNIT_ASSERT_EQUALS(bar, "bar"); } { std::stringstream data; cxxtools::SerializationInfo si; si.addMember("bar").addMember("bar") <<= 42; data << cxxtools::bin::Bin(si); d.read(data); cxxtools::SerializationInfo si2; d.deserialize(si2); int bar; CXXTOOLS_UNIT_ASSERT_EQUALS(si2.memberCount(), 1); CXXTOOLS_UNIT_ASSERT_NOTHROW(si2.getMember("bar").getMember("bar") >>= bar); CXXTOOLS_UNIT_ASSERT_EQUALS(bar, 42); } } namespace foo { typedef std::vector FooVector; void operator<<= (cxxtools::SerializationInfo& si, const FooVector& iv) { cxxtools::operator<<= (si, iv); si.setTypeName("FooVector"); } struct Foo { FooVector data; }; void operator<<= (cxxtools::SerializationInfo& si, const Foo& foo) { si.addMember("data") <<= foo.data; si.setTypeName("Foo"); } void operator>>= (const cxxtools::SerializationInfo& si, Foo& foo) { si.getMember("data") >>= foo.data; } } void BinSerializerTest::testNamedVector() { foo::Foo f; f.data.push_back(42); f.data.push_back(12); std::stringstream data; data << cxxtools::bin::Bin(f); log_debug("named foovector:\n" << cxxtools::hexDump(data.str())); foo::Foo f2; cxxtools::bin::Deserializer d(data); d.deserialize(f2); CXXTOOLS_UNIT_ASSERT_EQUALS(f2.data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(f2.data[0], 42); CXXTOOLS_UNIT_ASSERT_EQUALS(f2.data[1], 12); } cxxtools::unit::RegisterTest register_BinSerializerTest; cxxtools-3.0/test/iso8859_15-test.cpp0000664000175000017500000000440413644433072014267 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iso8859_15codec.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" class Iso8859_15Test : public cxxtools::unit::TestSuite { public: Iso8859_15Test() : cxxtools::unit::TestSuite("iso8859_15") { registerMethod("encode", *this, &Iso8859_15Test::encodeTest); registerMethod("decode", *this, &Iso8859_15Test::decodeTest); } void encodeTest() { cxxtools::String ustr(L"Hi \xe4 there, 5 \u20ac"); std::string bstr = cxxtools::Iso8859_15Codec::encode(ustr); CXXTOOLS_UNIT_ASSERT_EQUALS(bstr, "Hi \xe4 there, 5 \xa4"); } void decodeTest() { std::string bstr("Hi \xe4 there, 5 \xa4"); cxxtools::String ustr = cxxtools::Iso8859_15Codec::decode(bstr); CXXTOOLS_UNIT_ASSERT(ustr == L"Hi \xe4 there, 5 \u20ac"); } }; cxxtools::unit::RegisterTest register_Iso8859_15Test; cxxtools-3.0/test/xmlrpc-test.cpp0000664000175000017500000007205013644433072014141 00000000000000/* * Copyright (C) 2005-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/xmlrpc/service.h" #include "cxxtools/xmlrpc/httpclient.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/http/server.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include "cxxtools/ioerror.h" #include "cxxtools/net/uri.h" #include "cxxtools/net/addrinfo.h" #include #include log_define("cxxtools.test.xmlrpc") namespace { struct Color { int red; int green; int blue; }; typedef std::set IntSet; typedef std::multiset IntMultiset; typedef std::map IntMap; typedef std::multimap IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class XmlRpcTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::http::Server* _server; unsigned _count; std::string _listen; unsigned short _port; public: XmlRpcTest() : cxxtools::unit::TestSuite("xmlrpc"), _port(8001) { registerMethod("Nothing", *this, &XmlRpcTest::Nothing); registerMethod("Boolean", *this, &XmlRpcTest::Boolean); registerMethod("Integer", *this, &XmlRpcTest::Integer); registerMethod("Double", *this, &XmlRpcTest::Double); registerMethod("String", *this, &XmlRpcTest::String); registerMethod("EmptyValues", *this, &XmlRpcTest::EmptyValues); registerMethod("Array", *this, &XmlRpcTest::Array); registerMethod("EmptyArray", *this, &XmlRpcTest::EmptyArray); registerMethod("Struct", *this, &XmlRpcTest::Struct); registerMethod("Set", *this, &XmlRpcTest::Set); registerMethod("Multiset", *this, &XmlRpcTest::Multiset); registerMethod("Map", *this, &XmlRpcTest::Map); registerMethod("Multimap", *this, &XmlRpcTest::Multimap); registerMethod("UnknownMethod", *this, &XmlRpcTest::UnknownMethod); registerMethod("Fault", *this, &XmlRpcTest::Fault); registerMethod("Exception", *this, &XmlRpcTest::Exception); registerMethod("CallbackException", *this, &XmlRpcTest::CallbackException); registerMethod("ConnectError", *this, &XmlRpcTest::ConnectError); registerMethod("BigRequest", *this, &XmlRpcTest::BigRequest); registerMethod("PrepareConnect", *this, &XmlRpcTest::PrepareConnect); registerMethod("Connect", *this, &XmlRpcTest::Connect); registerMethod("Multiple", *this, &XmlRpcTest::Multiple); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } char* LISTEN = getenv("UTEST_LISTEN"); if (LISTEN) _listen = LISTEN; _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &XmlRpcTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _server = new cxxtools::http::Server(_loop, _listen, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(cxxtools::RemoteResult& /*r*/) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port + 1, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(cxxtools::RemoteResult& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::boolean); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(true, true); bool r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r, true); } bool boolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyInt); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyDouble); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { cxxtools::xmlrpc::Service service; service.registerMethod("echoString", *this, &XmlRpcTest::echoString); _server->addService("/foo", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/foo"); cxxtools::RemoteProcedure echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyEmpty); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector multiplyVector(const std::vector& a, const std::vector& b) { std::vector r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyColor); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcTest::multiplySet); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcTest::multiplyMultiset); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymap", *this, &XmlRpcTest::multiplyMap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymultimap", *this, &XmlRpcTest::multiplyMultimap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/test"); cxxtools::RemoteProcedure multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // UnknownMethod // void UnknownMethod() { cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::xmlrpc::Service service; _server->addService("/rpc", service); cxxtools::RemoteProcedure unknownMethod(client, "unknownMethod"); unknownMethod.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::throwFault); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::throwException); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { cxxtools::xmlrpc::Service service; service.registerMethod("countSize", *this, &XmlRpcTest::countSize); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, _listen, _port, "/rpc"); cxxtools::RemoteProcedure > countSize(client, "countSize"); std::vector v; v.resize(5000); countSize.begin(v); try { CXXTOOLS_UNIT_ASSERT_EQUALS(countSize.end(2000), 5000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector& v) { return v.size(); } //////////////////////////////////////////////////////////// // PrepareConnect // void PrepareConnect() { log_trace("PrepareConnect"); cxxtools::xmlrpc::Service service; service.registerMethod("boolean", *this, &XmlRpcTest::boolean); _server->addService("/rpc", service); // test connect using cxxtools::net::AddrInfo { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(cxxtools::net::AddrInfo(_listen, _port), "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(_listen, _port, "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "http://localhost:" << _port << "/rpc"; client.prepareConnect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect in connect { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1, "/rpc")); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(), cxxtools::IOError); } // test failing connect when calling function { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1, "/rpc")); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(boolean.end(2000), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Connect // void Connect() { cxxtools::xmlrpc::Service service; service.registerMethod("boolean", *this, &XmlRpcTest::boolean); _server->addService("/rpc", service); // test connect using cxxtools::net::AddrInfo { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(cxxtools::net::AddrInfo(_listen, _port), "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(_listen, _port, "/rpc"); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "http://localhost:" << _port << "/rpc"; client.connect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect { cxxtools::xmlrpc::HttpClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(_listen, _port + 1, "/rpc"), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Multiple calls // void Multiple() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyDouble); _server->addService("/rpc", service); typedef cxxtools::RemoteProcedure Multiply; std::vector clients; std::vector procs; clients.reserve(16); procs.reserve(16); for (unsigned i = 0; i < 16; ++i) { clients.push_back(cxxtools::xmlrpc::HttpClient(_loop, _listen, _port, "/rpc")); procs.push_back(Multiply(clients.back(), "multiply")); procs.back().begin(i, i); } for (unsigned i = 0; i < 16; ++i) { CXXTOOLS_UNIT_ASSERT_EQUALS(procs[i].end(2000), i*i); } } }; cxxtools::unit::RegisterTest register_XmlRpcTest; cxxtools-3.0/test/propertiesserializer-test.cpp0000664000175000017500000002404013644433072017116 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/propertiesserializer.h" #include "cxxtools/properties.h" namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; TestObject() : intValue(0), doubleValue(0), boolValue(false) { } }; inline void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); } // test object for plain key test struct PlainKeyObject { int a; int b; int c; int d; }; inline void operator<<= (cxxtools::SerializationInfo& si, const PlainKeyObject& obj) { si.addMember("a a") <<= obj.a; si.addMember("1b") <<= obj.b; si.addMember("c-c") <<= obj.c; si.addMember("ddd") <<= obj.d; } struct PropertiesData { int a; std::string propertiesData; }; void operator<<= (cxxtools::SerializationInfo& si, const PropertiesData& j) { si.addMember("a") <<= j.a; cxxtools::SerializationInfo& jsi = si.addMember("propertiesData"); jsi <<= j.propertiesData; jsi.setTypeName("properties"); } } class PropertiesSerializerTest : public cxxtools::unit::TestSuite { public: PropertiesSerializerTest() : cxxtools::unit::TestSuite("propertiesserializer") { registerMethod("testInt", *this, &PropertiesSerializerTest::testInt); registerMethod("testObject", *this, &PropertiesSerializerTest::testObject); registerMethod("testArray", *this, &PropertiesSerializerTest::testArray); registerMethod("testEmptyArrays", *this, &PropertiesSerializerTest::testEmptyArrays); registerMethod("testString", *this, &PropertiesSerializerTest::testString); registerMethod("testPlainInt", *this, &PropertiesSerializerTest::testPlainInt); registerMethod("testPlainObject", *this, &PropertiesSerializerTest::testPlainObject); registerMethod("testPlainArray", *this, &PropertiesSerializerTest::testPlainArray); registerMethod("testPlainString", *this, &PropertiesSerializerTest::testPlainString); registerMethod("testMultipleObjects", *this, &PropertiesSerializerTest::testMultipleObjects); registerMethod("testPlainEmpty", *this, &PropertiesSerializerTest::testPlainEmpty); registerMethod("testEasyProperties", *this, &PropertiesSerializerTest::testEasyProperties); registerMethod("testNoSizes", *this, &PropertiesSerializerTest::testNoSizes); } void testInt() { std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(-4711, "value").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "value = -4711\n"); } void testObject() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data, "testObject").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "# object testObject.size = 5\n" "testObject.intValue = 17\n" "testObject.stringValue = foobar\n" "testObject.doubleValue = 1.5\n" "testObject.boolValue = false\n" "testObject.nullValue =\n"); } void testArray() { std::vector data; data.push_back(3); data.push_back(4); data.push_back(-33); std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data, "array").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "# array array.size = 3\n" "array.0 = 3\n" "array.1 = 4\n" "array.2 = -33\n"); } void testEmptyArrays() { std::vector< std::vector > data; data.resize(2); std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "# array size = 2\n" "# array 0.size = 0\n" "# array 1.size = 0\n"); } void testString() { cxxtools::String data; data = L"hi\xc3a4\xc3b6\xc3bc"; std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data, "str").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "str = hi\\uc3a4\\uc3b6\\uc3bc\n"); } void testPlainInt() { std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(-4711).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "-4711\n"); } void testPlainObject() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "# object size = 5\n" "intValue = 17\n" "stringValue = foobar\n" "doubleValue = 1.5\n" "boolValue = false\n" "nullValue =\n"); } void testPlainArray() { std::vector data; data.push_back(3); data.push_back(4); data.push_back(-33); std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "# array size = 3\n" "0 = 3\n" "1 = 4\n" "2 = -33\n"); } void testPlainString() { cxxtools::String data; data = L"hi\xc3a4\xc3b6\xc3bc"; std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "hi\\uc3a4\\uc3b6\\uc3bc\n"); } void testMultipleObjects() { std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.serialize("Hi", "a") .serialize(42, "b") .finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "a = Hi\nb = 42\n"); } void testPlainEmpty() { std::ostringstream out; cxxtools::PropertiesSerializer serializer(out); serializer.finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), ""); } void testEasyProperties() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; out << cxxtools::Properties(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "# object size = 5\n" "intValue = 17\n" "stringValue = foobar\n" "doubleValue = 1.5\n" "boolValue = false\n" "nullValue =\n"); } void testNoSizes() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; out << cxxtools::Properties(data).outputSize(false); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "intValue = 17\n" "stringValue = foobar\n" "doubleValue = 1.5\n" "boolValue = false\n" "nullValue =\n"); } }; cxxtools::unit::RegisterTest register_PropertiesSerializerTest; cxxtools-3.0/test/rpcbenchasyncclient.cpp0000664000175000017500000003101513644433072015674 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "color.h" static cxxtools::Mutex mutex; class ClientCreator { public: virtual ~ClientCreator() { } virtual cxxtools::RemoteClient* create(cxxtools::SelectorBase& selector) = 0; }; class XmlRpcClientCreator : public ClientCreator { std::string _ip; unsigned short _port; std::string _url; public: XmlRpcClientCreator(const std::string& ip, unsigned short port, const std::string& url) : _ip(ip), _port(port), _url(url) { } virtual cxxtools::RemoteClient* create(cxxtools::SelectorBase& selector) { return new cxxtools::xmlrpc::HttpClient(selector, _ip, _port, _url); } }; class JsonHttpClientCreator : public ClientCreator { std::string _ip; unsigned short _port; std::string _url; public: JsonHttpClientCreator(const std::string& ip, unsigned short port, const std::string& url) : _ip(ip), _port(port), _url(url) { } virtual cxxtools::RemoteClient* create(cxxtools::SelectorBase& selector) { return new cxxtools::json::HttpClient(selector, _ip, _port, _url); } }; class JsonRpcClientCreator : public ClientCreator { std::string _ip; unsigned short _port; public: JsonRpcClientCreator(const std::string& ip, unsigned short port) : _ip(ip), _port(port) { } virtual cxxtools::RemoteClient* create(cxxtools::SelectorBase& selector) { return new cxxtools::json::RpcClient(selector, _ip, _port); } }; class BinRpcClientCreator : public ClientCreator { std::string _ip; unsigned short _port; public: BinRpcClientCreator(const std::string& ip, unsigned short port) : _ip(ip), _port(port) { } virtual cxxtools::RemoteClient* create(cxxtools::SelectorBase& selector) { return new cxxtools::bin::RpcClient(selector, _ip, _port); } }; class RemoteExecutor : public cxxtools::Connectable { public: virtual ~RemoteExecutor() { } virtual void begin() = 0; cxxtools::Signal finished; cxxtools::Signal failed; }; class EchoExecutor : public RemoteExecutor { cxxtools::RemoteProcedure _echo; std::string _msg; public: EchoExecutor(cxxtools::RemoteClient* client, const std::string& msg) : _echo(*client, "echo"), _msg(msg) { cxxtools::connect(_echo.finished, *this, &EchoExecutor::onEchoFinished); } void begin() { _echo.begin(_msg); } void onEchoFinished(cxxtools::RemoteResult& result) { std::string ret = result.get(); if (ret != _msg) { { cxxtools::MutexLock lock(mutex); std::cerr << "wrong response result \"" << ret << '"' << std::endl; } failed(this); } finished(this); } }; class SeqExecutor : public RemoteExecutor { cxxtools::RemoteProcedure, int, int> _seq; int _startValue; int _endValue; public: SeqExecutor(cxxtools::RemoteClient* client, int startValue, int endValue) : _seq(*client, "seq"), _startValue(startValue), _endValue(endValue) { cxxtools::connect(_seq.finished, *this, &SeqExecutor::onSeqFinished); } void begin() { _seq.begin(_startValue, _endValue); } void onSeqFinished(cxxtools::RemoteResult >& result) { std::vector ret = result.get(); if (ret.size() != static_cast::size_type>(_endValue - _startValue + 1)) { { cxxtools::MutexLock lock(mutex); std::cerr << "wrong response result size " << ret.size() << std::endl; } failed(this); } finished(this); } }; class ObjectsExecutor : public RemoteExecutor { cxxtools::RemoteProcedure, unsigned> _objects; unsigned _objectsCount; public: ObjectsExecutor(cxxtools::RemoteClient* client, unsigned objectsCount) : _objects(*client, "objects"), _objectsCount(objectsCount) { cxxtools::connect(_objects.finished, *this, &ObjectsExecutor::onObjectsFinished); } void begin() { _objects.begin(_objectsCount); } void onObjectsFinished(cxxtools::RemoteResult >& result) { std::vector ret = result.get(); if (ret.size() != _objectsCount) { { cxxtools::MutexLock lock(mutex); std::cerr << "wrong response result size " << ret.size() << std::endl; } failed(this); } finished(this); } }; class BenchClient : public cxxtools::Connectable { std::set clients; std::set executors; cxxtools::AttachedThread thread; cxxtools::EventLoop loop; static unsigned _numRequests; static unsigned _vectorSize; static unsigned _objectsSize; static std::atomic _requestsStarted; static std::atomic _requestsFinished; static std::atomic _requestsFailed; void onFinished(RemoteExecutor* e) { ++_requestsFinished; if (++_requestsStarted <= _numRequests) e->begin(); else { executors.erase(e); delete e; if (executors.empty()) loop.exit(); } } void onFailed(RemoteExecutor* /*e*/) { ++_requestsFailed; } public: explicit BenchClient(ClientCreator& clientCreator, unsigned numClients) : thread(cxxtools::callable(loop, &cxxtools::EventLoop::run)) { while (clients.size() < numClients) { cxxtools::RemoteClient* client = clientCreator.create(loop); clients.insert(client); RemoteExecutor* executor; if (_vectorSize > 0) executor = new SeqExecutor(client, 1, _vectorSize); else if (_objectsSize > 0) executor = new ObjectsExecutor(client, _objectsSize); else executor = new EchoExecutor(client, "Hi"); cxxtools::connect(executor->finished, *this, &BenchClient::onFinished); cxxtools::connect(executor->failed, *this, &BenchClient::onFailed); ++_requestsStarted; executor->begin(); executors.insert(executor); } } ~BenchClient() { for (std::set::iterator it = clients.begin(); it != clients.end(); ++it) delete *it; for (std::set::iterator it = executors.begin(); it != executors.end(); ++it) delete *it; } static unsigned numRequests() { return _numRequests; } static void numRequests(unsigned n) { _numRequests = n; } static unsigned vectorSize() { return _vectorSize; } static void vectorSize(unsigned n) { _vectorSize = n; } static unsigned objectsSize() { return _objectsSize; } static void objectsSize(unsigned n) { _objectsSize = n; } static unsigned requestsStarted() { return _requestsStarted; } static unsigned requestsFinished() { return _requestsFinished; } static unsigned requestsFailed() { return _requestsFailed; } void start() { thread.start(); } void join() { thread.join(); } }; std::atomic BenchClient::_requestsStarted(0); std::atomic BenchClient::_requestsFinished(0); std::atomic BenchClient::_requestsFailed(0); unsigned BenchClient::_numRequests = 0; unsigned BenchClient::_vectorSize = 0; unsigned BenchClient::_objectsSize = 0; typedef std::vector BenchClients; int main(int argc, char* argv[]) { try { log_init("rpcbenchclient.properties"); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg threads(argc, argv, 't', 4); cxxtools::Arg concurrentRequestsPerThread(argc, argv, 'c', 4); cxxtools::Arg xmlrpc(argc, argv, 'x'); cxxtools::Arg binary(argc, argv, 'b'); cxxtools::Arg json(argc, argv, 'j'); cxxtools::Arg jsonhttp(argc, argv, 'J'); cxxtools::Arg port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); BenchClient::numRequests(cxxtools::Arg(argc, argv, 'n', 10000)); BenchClient::vectorSize(cxxtools::Arg(argc, argv, 'v', 0)); BenchClient::objectsSize(cxxtools::Arg(argc, argv, 'o', 0)); if (!xmlrpc && !binary && !json && !jsonhttp) { std::cerr << "usage: " << argv[0] << " [options]\n" "options:\n" " -l ip set ip address of server (default: localhost)\n" " -p number set port number of server (default: 7002 for http, 7003 for binary and 7004 for json)\n" " -x use xmlrpc protocol\n" " -b use binary rpc protocol\n" " -j use json rpc protocol\n" " -J use json rpc over http protocol\n" " -c number concurrent request per thread (default: 4)\n" " -t number set number of threads (default: 4)\n" " -n number set number of requests (default: 10000)\n" "one protocol must be selected\n" << std::endl; return -1; } BenchClients clients; XmlRpcClientCreator xmlRpcClientCreator(ip, port, "/xmlrpc"); JsonHttpClientCreator jsonHttpClientCreator(ip, port, "/jsonrpc"); JsonRpcClientCreator jsonRpcClientCreator(ip, port); BinRpcClientCreator binRpcClientCreator(ip, port); ClientCreator& clientCreator = binary ? static_cast(binRpcClientCreator) : json ? static_cast(jsonRpcClientCreator) : jsonhttp ? static_cast(jsonHttpClientCreator) : static_cast(xmlRpcClientCreator); while (clients.size() < threads) { clients.push_back(new BenchClient(clientCreator, concurrentRequestsPerThread)); } cxxtools::Clock cl; cl.start(); for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) (*it)->start(); for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) (*it)->join(); cxxtools::Timespan t = cl.stop(); std::cout << BenchClient::numRequests() << " requests in " << t.totalMSecs()/1e3 << " s => " << (BenchClient::requestsStarted() / (t.totalMSecs()/1e3)) << "#/s\n" << BenchClient::requestsFinished() << " finished " << BenchClient::requestsFailed() << " failed" << std::endl; for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) delete *it; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/test/base64-test.cpp0000664000175000017500000002214713644433072013722 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "cxxtools/base64stream.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/log.h" log_define("cxxtools.test.base64") class Base64Test : public cxxtools::unit::TestSuite { static std::string encodeDecode(const std::string& data) { std::string b = cxxtools::encode(data); log_debug("data.size=" << data.size() << " data=\"" << data << "\" base64.size=" << b.size() << " base64=" << b); return cxxtools::decode(b); } public: Base64Test() : cxxtools::unit::TestSuite("base64") { registerMethod("encodeTest0", *this, &Base64Test::encodeTest0); registerMethod("encodeTest1", *this, &Base64Test::encodeTest1); registerMethod("encodeTest2", *this, &Base64Test::encodeTest2); registerMethod("encodeStreamTest0", *this, &Base64Test::encodeStreamTest0); registerMethod("encodeStreamTest1", *this, &Base64Test::encodeStreamTest1); registerMethod("encodeStreamTest2", *this, &Base64Test::encodeStreamTest2); registerMethod("encodeDecodeTest", *this, &Base64Test::encodeDecodeTest); registerMethod("whitespaceDecodeTest", *this, &Base64Test::whitespaceDecodeTest); registerMethod("binaryTest", *this, &Base64Test::binaryTest); registerMethod("artemTest", *this, &Base64Test::artemTest); registerMethod("maxcolTest", *this, &Base64Test::maxcolTest); registerMethod("lineendTest", *this, &Base64Test::lineendTest); registerMethod("paddingTest", *this, &Base64Test::paddingTest); } void encodeTest0() { std::string b64 = cxxtools::encode("123456789"); CXXTOOLS_UNIT_ASSERT_EQUALS(b64, "MTIzNDU2Nzg5"); } void encodeTest1() { std::string b64 = cxxtools::encode("1234567890"); CXXTOOLS_UNIT_ASSERT_EQUALS(b64, "MTIzNDU2Nzg5MA=="); } void encodeTest2() { std::string b64 = cxxtools::encode("12345678901"); CXXTOOLS_UNIT_ASSERT_EQUALS(b64, "MTIzNDU2Nzg5MDE="); } void encodeStreamTest0() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder << "123456789"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg5"); } void encodeStreamTest1() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder << "1234567890"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg5MA=="); } void encodeStreamTest2() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder << "12345678901"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg5MDE="); } void encodeDecodeTest() { std::string data; for (unsigned n = 0; n < 100; ++n) { data += static_cast('0' + n%10); for (char c = 'A'; c <= 'Z'; ++c) data += c; data += '\n'; } std::string data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); } void whitespaceDecodeTest() { std::string data = "SGk gd\tGhl\n\ncmU=\n"; std::string w = cxxtools::Base64Codec::decode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(w, "Hi there"); } void binaryTest() { std::string data2; std::string data; data.assign("\xff\xd8\xff\xe0\x00\x10\x4a\x46\x00\x01\x01\x00\x48", 13); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xef\xfe\xff\xca", 4); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xef\xfe\xff\xca\xea", 5); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xef\xfe\xff\xca\xea\xcc", 6); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xff\xd8\xff\xe0\x0\x10\x4a\x46\x49\x46" "\x0\x1\x1\x1\x0\x48\x0\x48\x0\x0" "\xff\xfe\x0\xd\x4c\x61\x76\x63\x35\x33" "\x2e\x34\x32\x2e\x34\xff\xdb\x0\x43\x0" "\x5\x3\x4\x4\x4\x3\x5\x4\x4\x4" "\x5\x5\x5\x6\x7\xc\x8\x7\x7\x7" "\x7\xf\xb\xb\x9\xc\x11\xf\x12\x12" "\x11\xf\x11\x11\x13\x16\x1c\x17\x13\x14" "\x1a\x15\x11\x11\x18\x21\x18\x1a\x1d\x1d" "\x1f\x1f\x1f\x13\x17\x22\x24\x22\x1e\x24" "\x1c\x1e\x1f\x1e\xff\xdb\x0\x43\x1\x5" "\x5\x5\x7\x6\x7\xe\x8\x8\xe\x1e" "\x14\x11\x14\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\xff\xc0\x0\x11\x8\x0\x12" "\x0\x17\x3\x1\x22\x0\x2\x11\x1\x3" "\x11\x1\xff\xc4\x0\x18\x0\x1\x1\x1" "\x1\x1\x0\x0\x0\x0\x0\x0\x0\x0" "\x0\x0\x0\x0\x2\x4\x3\x7\xff\xc4" "\x0\x21\x10\x0\x1\x4\x1\x3\x5\x0" "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" "\x1\x2\x3\x12\x21\x4\x11\x22\x13\x31" "\x32\x42\x43\xff\xc4\x0\x17\x1\x1\x1" "\x1\x1\x0\x0\x0\x0\x0\x0\x0\x0" "\x0\x0\x0\x0\x0\x2\x1\x4\xff\xc4" "\x0\x15\x11\x1\x1\x0\x0\x0\x0\x0" "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" "\x11\xff\xda\x0\xc\x3\x1\x0\x2\x11" "\x3\x11\x0\x3f\x0\xf4\x5e\xad\x79\x6d" "\x9f\x53\x2b\xe5\xce\x6a\x44\xee\xcb\x50" "\x9a\xdd\x76\x79\xd3\x5\x49\xa9\x8d\xa9" "\xe7\xc8\x13\x2c\x51\xba\xb8\x6\xd\x33" "\x22\x1c\x7e\xcc\x0\xa0\x7f\x60\x1\x23" "\xff\xd9", 362); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); } void artemTest() { for (unsigned n = 0; n < 256; ++n) { std::string data(n, 'a'); std::string data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); } } void maxcolTest() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder.maxcol(8); encoder << "123456789"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2\r\nNzg5"); } void lineendTest() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder.maxcol(8); encoder.lineend("\n"); encoder << "123456789"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2\nNzg5"); } void paddingTest() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder.padding(false); encoder << "12345678"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg"); } }; cxxtools::unit::RegisterTest register_Base64Test; cxxtools-3.0/test/foo.cpp0000664000175000017500000000177613657504222012451 00000000000000#include #include #include #include #include int main(int argc, char* argv[]) { try { cxxtools::ArgIn in(argc, argv); cxxtools::TextIStream tin(in, new cxxtools::Utf8Codec()); std::vector cc; while(true) { auto c = tin.rdbuf()->sbumpc(); if (c == std::char_traits::eof()) break; cc.emplace_back(c); } for (auto c: cc) std::cout << std::hex << c << ' '; std::cout << '\n'; for (auto c: cc) std::cout << char(c); std::cout << '\n'; cxxtools::TextOStream tout(std::cout, new cxxtools::Utf8Codec()); for (auto c: cc) tout << cxxtools::Char(c); std::cout << '\n'; //std::cout << tin.rdbuf() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/test/uri-test.cpp0000664000175000017500000002164213644433072013434 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/net/uri.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class UriTest : public cxxtools::unit::TestSuite { public: UriTest() : cxxtools::unit::TestSuite("uri") { registerMethod("testUri_UPHP", *this, &UriTest::testUri_UPHP); registerMethod("testUri_UHP", *this, &UriTest::testUri_UHP); registerMethod("testUri_UPH", *this, &UriTest::testUri_UPH); registerMethod("testUri_HP", *this, &UriTest::testUri_HP); registerMethod("testUri_H", *this, &UriTest::testUri_H); registerMethod("testUri_UPH6P", *this, &UriTest::testUri_UPH6P); registerMethod("testUri_UH6P", *this, &UriTest::testUri_UH6P); registerMethod("testUri_UPH6", *this, &UriTest::testUri_UPH6); registerMethod("testUri_H6P", *this, &UriTest::testUri_H6P); registerMethod("testUri_H6", *this, &UriTest::testUri_H6); registerMethod("testQuery", *this, &UriTest::testQuery); registerMethod("testFragment", *this, &UriTest::testFragment); registerMethod("testQueryFragment", *this, &UriTest::testQueryFragment); registerMethod("testHttpPort", *this, &UriTest::testHttpPort); registerMethod("testHttpsPort", *this, &UriTest::testHttpsPort); registerMethod("testFtpPort", *this, &UriTest::testFtpPort); registerMethod("testUriStr", *this, &UriTest::testUriStr); } void testUri_UPHP() { cxxtools::net::Uri uri("http://user:password@host:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UHP() { cxxtools::net::Uri uri("http://user@host:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UPH() { cxxtools::net::Uri uri("http://user:password@host/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_HP() { cxxtools::net::Uri uri("http://host:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_H() { cxxtools::net::Uri uri("http://host/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UPH6P() { cxxtools::net::Uri uri("http://user:password@[::1]:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UH6P() { cxxtools::net::Uri uri("http://user@[::1]:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UPH6() { cxxtools::net::Uri uri("http://user:password@[::1]/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_H6P() { cxxtools::net::Uri uri("http://[::1]:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_H6() { cxxtools::net::Uri uri("http://[::1]/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testQuery() { cxxtools::net::Uri uri("http://host/?abc=1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.query(), "abc=1"); } void testFragment() { cxxtools::net::Uri uri("http://host/#foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.fragment(), "foo"); } void testQueryFragment() { cxxtools::net::Uri uri("http://host/?abc=1#foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.query(), "abc=1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.fragment(), "foo"); } void testHttpPort() { cxxtools::net::Uri uri("http://host/"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); } void testHttpsPort() { cxxtools::net::Uri uri("https://host/"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 443); } void testFtpPort() { cxxtools::net::Uri uri("ftp://host/"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 21); } void testUriStr() { cxxtools::net::Uri uri("http://user:password@host:80/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.str(), "http://user:password@host/blah.html"); } }; cxxtools::unit::RegisterTest register_UriTest; cxxtools-3.0/test/csvdeserializer-test.cpp0000664000175000017500000003650313644433072016035 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/csvdeserializer.h" #include "cxxtools/csv.h" #include "cxxtools/log.h" //log_define("cxxtools.test.csvdeserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; } } class CsvDeserializerTest : public cxxtools::unit::TestSuite { public: CsvDeserializerTest() : cxxtools::unit::TestSuite("csvdeserializer") { registerMethod("testVectorVector", *this, &CsvDeserializerTest::testVectorVector); registerMethod("testVectorVectorNoTitle", *this, &CsvDeserializerTest::testVectorVectorNoTitle); registerMethod("testIntVector", *this, &CsvDeserializerTest::testIntVector); registerMethod("testObjectVector", *this, &CsvDeserializerTest::testObjectVector); registerMethod("testMissigColumn", *this, &CsvDeserializerTest::testMissingColumn); registerMethod("testTooManyColumns", *this, &CsvDeserializerTest::testTooManyColumns); registerMethod("testCr", *this, &CsvDeserializerTest::testCr); registerMethod("testEmptyLines", *this, &CsvDeserializerTest::testEmptyLines); registerMethod("testSingleColumn", *this, &CsvDeserializerTest::testSingleColumn); registerMethod("testSetDelimiter", *this, &CsvDeserializerTest::testSetDelimiter); registerMethod("testQuotedTitle", *this, &CsvDeserializerTest::testQuotedTitle); registerMethod("testDoubleQuoteData", *this, &CsvDeserializerTest::testDoubleQuoteData); registerMethod("testFailDecoding", *this, &CsvDeserializerTest::testFailDecoding); registerMethod("testLinefeed", *this, &CsvDeserializerTest::testLinefeed); registerMethod("testUnicode", *this, &CsvDeserializerTest::testUnicode); } void testVectorVector() { std::vector > data; std::istringstream in( "A|B|C\n" "Hello|World|\n" "34|67|\"23\"\n" "col1|'col2'|col3\n"); in >> cxxtools::Csv(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "34"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "67"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], "23"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][0], "col1"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][1], "col2"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][2], "col3"); } void testVectorVectorNoTitle() { std::vector > data; std::istringstream in( "Hello|World|\n" "34|67|\"23\"\n" "col1|'col2'|col3\n"); in >> cxxtools::Csv(data).readTitle(false).delimiter('|'); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "34"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "67"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], "23"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][0], "col1"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][1], "col2"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][2], "col3"); } void testIntVector() { std::vector > data; std::istringstream in( "A|B|C\n" "12|'23'|0\n" "34|67|\"23\""); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], 12); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], 23); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][2], 0); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], 34); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], 67); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], 23); } void testObjectVector() { std::vector data; std::istringstream in( "intValue\tstringValue\tdoubleValue\n" "17\t'Hi'\t2.5\n" "-6\tFoo\t-1000"); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].stringValue, "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].doubleValue, 2.5); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].intValue, -6); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].stringValue, "Foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].doubleValue, -1000); } void testMissingColumn() { std::istringstream in( "A|B|C\n" "Hello|World\n" "34|67|\"23\"|someValue\n" "col1|'col2'|col3\n"); cxxtools::CsvDeserializer deserializer; CXXTOOLS_UNIT_ASSERT_THROW(deserializer.read(in), std::exception); } void testTooManyColumns() { std::istringstream in( "A|B|C\n" "Hello|World|blah\n" "34|67|\"23\"|someValue\n" "col1|'col2'|col3|col4"); cxxtools::CsvDeserializer deserializer; CXXTOOLS_UNIT_ASSERT_THROW(deserializer.read(in), std::exception); } void testCr() { std::vector > data; std::istringstream in( "A|B|C\r\n" "Hello|World|\r" "34|67|\"23\"\n" "col1|'col2'|col3\r\n"); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "34"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "67"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], "23"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][0], "col1"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][1], "col2"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][2], "col3"); } void testEmptyLines() { std::vector > data; std::istringstream in( "A;B;C\n" ";;\n" ";;\n"); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][2], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], ""); } void testSingleColumn() { std::vector > data; std::istringstream in( "A\n" "1\n" "2\n" "\n"); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 1); } void testSetDelimiter() { std::vector > data; std::istringstream in( "A;|B|C\n" "12|'23'|0\n" "34|67|\"23\""); cxxtools::CsvDeserializer deserializer; deserializer.delimiter('|'); deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], 12); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], 23); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][2], 0); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], 34); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], 67); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], 23); } void testQuotedTitle() { std::vector data; std::istringstream in( "\"intValue\",'stringValue',\"doubleValue\"\n" "17,'Hi',2.5\n" "-6,Foo,-1000"); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].stringValue, "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].doubleValue, 2.5); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].intValue, -6); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].stringValue, "Foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].doubleValue, -1000); } void testQuoteData() { std::vector > data; std::istringstream in( "A|B\n" "He'llo|Wor'ld'\n" "He\"llo|Wor\"'ld\n"); in >> cxxtools::Csv(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "He'llo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "Wor'ld'"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "He\"llo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "Wor\"'ld"); } void testDoubleQuoteData() { std::vector > data; std::istringstream in( "A|B\n" "\"Hello\"|\"\"\"World\"\"\"\n" "\"He\"\"llo\"|'''World'"); in >> cxxtools::Csv(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "\"World\""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "He\"llo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "'World"); } void testFailDecoding() { std::istringstream in( "A\xff|B|C\n"); cxxtools::CsvDeserializer deserializer; CXXTOOLS_UNIT_ASSERT_THROW(deserializer.read(in), std::exception); } void testLinefeed() { std::vector > data; std::istringstream in( "Hello,World\n" "\"foo\nbar\",blub\n"); cxxtools::CsvDeserializer deserializer; deserializer.readTitle(false); deserializer.delimiter(','); deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "foo\nbar"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "blub"); } void testUnicode() { std::vector > data; std::istringstream in( "a;b\n" "M\xc3\xa4kitalo;42\n"); cxxtools::CsvDeserializer deserializer; deserializer.read(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], L"M\xe4kitalo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], L"42"); } }; cxxtools::unit::RegisterTest register_CsvDeserializerTest; cxxtools-3.0/test/envsubst-test.cpp0000664000175000017500000001514013644433072014502 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/envsubst.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include #include class EnvSubstTest : public cxxtools::unit::TestSuite { public: EnvSubstTest() : cxxtools::unit::TestSuite("envsubst") { registerMethod("testSimple", *this, &EnvSubstTest::testSimple); registerMethod("testSimpleEnvVar", *this, &EnvSubstTest::testSimpleEnvVar); registerMethod("testBracketedEnvVar", *this, &EnvSubstTest::testBracketedEnvVar); registerMethod("testUnsetEnvVar", *this, &EnvSubstTest::testUnsetEnvVar); registerMethod("testEsc", *this, &EnvSubstTest::testEsc); registerMethod("testPlainEsc", *this, &EnvSubstTest::testPlainEsc); registerMethod("testUseDefvalue", *this, &EnvSubstTest::testUseDefvalue); registerMethod("testSkipDefvalue", *this, &EnvSubstTest::testSkipDefvalue); registerMethod("testUseOtherVar", *this, &EnvSubstTest::testUseOtherVar); registerMethod("testUseOtherBVar", *this, &EnvSubstTest::testUseOtherBVar); } void testSimple() { std::string value = "abc def foobar"; std::string exvalue = cxxtools::envSubst(value); CXXTOOLS_UNIT_ASSERT_EQUALS(value, exvalue); } void testSimpleEnvVar() { std::string value = "abc $USER def foobar"; std::string exvalue = cxxtools::envSubst(value); const char* user = getenv("USER"); assert(user != 0); std::string expected = "abc "; expected += user; expected += " def foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } void testBracketedEnvVar() { std::string value = "abc ${USER}def foobar"; std::string exvalue = cxxtools::envSubst(value); const char* user = getenv("USER"); assert(user != 0); std::string expected = "abc "; expected += user; expected += "def foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } void testUnsetEnvVar() { std::string value = "abc $UNSET_VAR def foobar"; std::string exvalue = cxxtools::envSubst(value); const char* unsetVar = getenv("UNSET_VAR"); assert(unsetVar == 0); CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, "abc def foobar"); } void testEsc() { std::string value = "abc \\$USER def foobar"; std::string exvalue = cxxtools::envSubst(value); const char* user = getenv("USER"); assert(user != 0); std::string expected = "abc $USER def foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } void testPlainEsc() { { std::string value = "\\"; std::string exvalue = cxxtools::envSubst(value); std::string expected = "\\"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } { std::string value = "\\ t"; std::string exvalue = cxxtools::envSubst(value); std::string expected = "\\ t"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } } void testUseDefvalue() { std::string value = "abc ${UNSET_VAR:-no user} def foobar"; std::string exvalue = cxxtools::envSubst(value); const char* unsetVar = getenv("UNSET_VAR"); assert(unsetVar == 0); std::string expected = "abc no user def foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } void testSkipDefvalue() { std::string value = "abc ${USER:-no user}def foobar"; std::string exvalue = cxxtools::envSubst(value); const char* user = getenv("USER"); assert(user != 0); std::string expected = "abc "; expected += user; expected += "def foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } void testUseOtherVar() { std::string value = "abc ${UNSET_VAR:-$USER} foobar"; std::string exvalue = cxxtools::envSubst(value); const char* unsetVar = getenv("UNSET_VAR"); assert(unsetVar == 0); const char* user = getenv("USER"); assert(user != 0); std::string expected = "abc "; expected += user; expected += " foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } void testUseOtherBVar() { std::string value = "abc ${UNSET_VAR:-${USER}} foobar"; std::string exvalue = cxxtools::envSubst(value); const char* unsetVar = getenv("UNSET_VAR"); assert(unsetVar == 0); const char* user = getenv("USER"); assert(user != 0); std::string expected = "abc "; expected += user; expected += " foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(exvalue, expected); } }; cxxtools::unit::RegisterTest register_EnvSubstTest; cxxtools-3.0/test/color.h0000664000175000017500000000367613644433072012452 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_COLOR_H #define CXXTOOLS_COLOR_H #include struct Color { int red; int green; int blue; }; inline void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } inline void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.setTypeName("color"); si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } #endif // CXXTOOLS_COLOR_H cxxtools-3.0/test/scopedincrement-test.cpp0000664000175000017500000000754113644433072016021 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/scopedincrement.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class ScopedIncrementTest : public cxxtools::unit::TestSuite { public: ScopedIncrementTest() : cxxtools::unit::TestSuite("scopedincrement") { registerMethod("testIncrementInt", *this, &ScopedIncrementTest::testIncrementInt); registerMethod("testIncrementAtomic", *this, &ScopedIncrementTest::testIncrementAtomic); } void testIncrementInt() { int value = 7; { cxxtools::ScopedIncrement inc(value); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 8); } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); { cxxtools::ScopedIncrement inc(value, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 12); } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); { cxxtools::ScopedIncrement dec(value, -9); CXXTOOLS_UNIT_ASSERT_EQUALS(value, -2); } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); try { cxxtools::ScopedIncrement inc(value, 2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 9); throw 1; } catch (int) { } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); } void testIncrementAtomic() { typedef std::atomic atomic_t; atomic_t value(7); { cxxtools::ScopedIncrement inc(value); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 8); } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); { cxxtools::ScopedIncrement inc(value, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 12); } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); { cxxtools::ScopedIncrement dec(value, -9); CXXTOOLS_UNIT_ASSERT_EQUALS(value, -2); } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); try { cxxtools::ScopedIncrement inc(value, 2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 9); throw 1; } catch (int) { } CXXTOOLS_UNIT_ASSERT_EQUALS(value, 7); } }; cxxtools::unit::RegisterTest register_ScopedIncrementTest; cxxtools-3.0/test/binrpc-test.cpp0000664000175000017500000006675313644433072014126 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/bin/rpcclient.h" #include "cxxtools/bin/rpcserver.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include "cxxtools/ioerror.h" #include "cxxtools/net/uri.h" #include "cxxtools/net/addrinfo.h" #include #include #include "color.h" log_define("cxxtools.test.binrpc") namespace { typedef std::set IntSet; typedef std::multiset IntMultiset; typedef std::map IntMap; typedef std::multimap IntMultimap; } class BinRpcTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::bin::RpcServer* _server; unsigned _count; std::string _listen; unsigned short _port; public: BinRpcTest() : cxxtools::unit::TestSuite("binrpc"), _port(7003) { registerMethod("Nothing", *this, &BinRpcTest::Nothing); registerMethod("Boolean", *this, &BinRpcTest::Boolean); registerMethod("Integer", *this, &BinRpcTest::Integer); registerMethod("Double", *this, &BinRpcTest::Double); registerMethod("String", *this, &BinRpcTest::String); registerMethod("EmptyValues", *this, &BinRpcTest::EmptyValues); registerMethod("Array", *this, &BinRpcTest::Array); registerMethod("EmptyArray", *this, &BinRpcTest::EmptyArray); registerMethod("Struct", *this, &BinRpcTest::Struct); registerMethod("Set", *this, &BinRpcTest::Set); registerMethod("Multiset", *this, &BinRpcTest::Multiset); registerMethod("Map", *this, &BinRpcTest::Map); registerMethod("Multimap", *this, &BinRpcTest::Multimap); registerMethod("UnknownMethod", *this, &BinRpcTest::UnknownMethod); registerMethod("Domain", *this, &BinRpcTest::Domain); registerMethod("WrongDomain", *this, &BinRpcTest::WrongDomain); registerMethod("Fault", *this, &BinRpcTest::Fault); registerMethod("Exception", *this, &BinRpcTest::Exception); registerMethod("CallbackException", *this, &BinRpcTest::CallbackException); registerMethod("ConnectError", *this, &BinRpcTest::ConnectError); registerMethod("BigRequest", *this, &BinRpcTest::BigRequest); registerMethod("PrepareConnect", *this, &BinRpcTest::PrepareConnect); registerMethod("Connect", *this, &BinRpcTest::Connect); registerMethod("Multiple", *this, &BinRpcTest::Multiple); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } char* LISTEN = getenv("UTEST_LISTEN"); if (LISTEN) _listen = LISTEN; } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &BinRpcTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); _server = new cxxtools::bin::RpcServer(_loop, _listen, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyNothing); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyNothing); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &BinRpcTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(cxxtools::RemoteResult& /*r*/) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::bin::RpcClient client(_loop, _listen, _port + 1); cxxtools::RemoteProcedure multiply(client, "multiply"); connect( multiply.finished, *this, &BinRpcTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(cxxtools::RemoteResult& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { _server->registerMethod("boolean", *this, &BinRpcTest::boolean); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "boolean"); multiply.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), true); } bool boolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyInt); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyDouble); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { _server->registerMethod("echoString", *this, &BinRpcTest::echoString); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyEmpty); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyVector); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector multiplyVector(const std::vector& a, const std::vector& b) { std::vector r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyVector); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure< std::vector, std::vector, std::vector > multiply(client, "multiply"); std::vector vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyColor); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { _server->registerMethod("multiplyset", *this, &BinRpcTest::multiplySet); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { _server->registerMethod("multiplyset", *this, &BinRpcTest::multiplyMultiset); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { _server->registerMethod("multiplymap", *this, &BinRpcTest::multiplyMap); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { _server->registerMethod("multiplymultimap", *this, &BinRpcTest::multiplyMultimap); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // Domain // void Domain() { cxxtools::ServiceRegistry registry; registry.registerMethod("multiply", *this, &BinRpcTest::multiplyInt); _server->addService("myDomain", registry); cxxtools::bin::RpcClient client(_loop, _listen, _port); client.domain("myDomain"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } //////////////////////////////////////////////////////////// // WrongDomain // void WrongDomain() { cxxtools::ServiceRegistry registry; registry.registerMethod("multiply", *this, &BinRpcTest::multiplyInt); _server->addService("myDomain", registry); cxxtools::bin::RpcClient client(_loop, _listen, _port); client.domain("unknownDomain"); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_THROW(multiply.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // UnknownMethod // void UnknownMethod() { cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure unknownMethod(client, "unknownMethod"); unknownMethod.begin(); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { _server->registerMethod("multiply", *this, &BinRpcTest::throwFault); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { _server->registerMethod("multiply", *this, &BinRpcTest::throwException); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { _server->registerMethod("countSize", *this, &BinRpcTest::countSize); cxxtools::bin::RpcClient client(_loop, _listen, _port); cxxtools::RemoteProcedure > countSize(client, "countSize"); std::vector v; v.resize(5000); countSize.begin(v); try { countSize.end(2000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector& v) { return v.size(); } //////////////////////////////////////////////////////////// // PrepareConnect // void PrepareConnect() { log_trace("PrepareConnect"); _server->registerMethod("boolean", *this, &BinRpcTest::boolean); // test connect using cxxtools::net::AddrInfo { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(cxxtools::net::AddrInfo(_listen, _port)); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.prepareConnect(_listen, _port); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "bin://localhost:" << _port << '/'; client.prepareConnect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect in connect { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1)); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(), cxxtools::IOError); } // test failing connect when calling function { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_NOTHROW(client.prepareConnect(_listen, _port + 1)); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(boolean.end(2000), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Connect // void Connect() { _server->registerMethod("boolean", *this, &BinRpcTest::boolean); // test connect using cxxtools::net::AddrInfo { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(cxxtools::net::AddrInfo(_listen, _port)); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using host and port { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); client.connect(_listen, _port); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test connect using uri { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); std::ostringstream uri; uri << "bin://localhost:" << _port << '/'; client.connect(cxxtools::net::Uri(uri.str())); boolean.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(boolean.end(2000), true); } // test failing connect { cxxtools::bin::RpcClient client(_loop); cxxtools::RemoteProcedure boolean(client, "boolean"); CXXTOOLS_UNIT_ASSERT_THROW(client.connect(_listen, _port + 1), cxxtools::IOError); } } //////////////////////////////////////////////////////////// // Multiple calls // void Multiple() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyDouble); typedef cxxtools::RemoteProcedure Multiply; std::vector clients; std::vector procs; clients.reserve(16); procs.reserve(16); for (unsigned i = 0; i < 16; ++i) { clients.push_back(cxxtools::bin::RpcClient(_loop, _listen, _port)); procs.push_back(Multiply(clients.back(), "multiply")); procs.back().begin(i, i); } for (unsigned i = 0; i < 16; ++i) { CXXTOOLS_UNIT_ASSERT_EQUALS(procs[i].end(2000), i*i); } } }; cxxtools::unit::RegisterTest register_BinRpcTest; cxxtools-3.0/test/quotedprintable-test.cpp0000664000175000017500000000660013644433072016034 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/quotedprintablecodec.h" #include "cxxtools/quotedprintablestream.h" class QuotedPrintableTest : public cxxtools::unit::TestSuite { public: QuotedPrintableTest() : cxxtools::unit::TestSuite("quotedprintable") { registerMethod("encode", *this, &QuotedPrintableTest::encode); registerMethod("decode", *this, &QuotedPrintableTest::decode); registerMethod("stream", *this, &QuotedPrintableTest::stream); } void encode() { std::string s = "H\xe4tten H\xfcte ein \xdf im Namen, w\xe4ren sie m\xfcglicherweise keine H\xfcte mehr, sondern H\xfc\xdf""e."; std::string q = "H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=FCglicherweise keine H=FCte m=\r\nehr, sondern H=FC=DFe."; std::string enc = cxxtools::encode(s); CXXTOOLS_UNIT_ASSERT_EQUALS(enc, q); } void decode() { std::string s = "H\xe4tten H\xfcte ein \xdf im Namen, w\xe4ren sie m\xfcglicherweise keine H\xfcte mehr, sondern H\xfc\xdf""e."; std::string q = "H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=FCglicherweise keine H=FCte m=\r\nehr, sondern H=FC=DFe."; std::string dec = cxxtools::decode(q); CXXTOOLS_UNIT_ASSERT_EQUALS(dec, s); } void stream() { std::ostringstream s; cxxtools::QuotedPrintable_ostream q(s); q << "H\xe4tten H\xfcte ein \xdf im Namen, w\xe4ren sie m\xf6glicherweise keine H\xfcte mehr,\nsondern H\xfc\xdf" "e."; q.flush(); std::string qq = s.str(); CXXTOOLS_UNIT_ASSERT_EQUALS(qq, "H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=F6glicherweise keine H=FCte m=\r\n" "ehr,\n" "sondern H=FC=DFe."); } }; cxxtools::unit::RegisterTest register_QuotedPrintableTest; cxxtools-3.0/test/regex-test.cpp0000664000175000017500000001017313644433072013744 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/regex.h" class RegexTest : public cxxtools::unit::TestSuite { public: RegexTest() : cxxtools::unit::TestSuite("regex") { registerMethod("testRegex", *this, &RegexTest::testRegex); registerMethod("testSubexpression", *this, &RegexTest::testSubexpression); registerMethod("testEmptyRegex", *this, &RegexTest::testEmptyRegex); registerMethod("testFormat", *this, &RegexTest::testFormat); registerMethod("testFormatBrace", *this, &RegexTest::testFormatBrace); registerMethod("testSubst", *this, &RegexTest::testSubst); } void testRegex() { cxxtools::Regex r("^hel*o"); CXXTOOLS_UNIT_ASSERT(r.match("hello world")); CXXTOOLS_UNIT_ASSERT(!r.match(" hello world")); CXXTOOLS_UNIT_ASSERT(r.match("hellllo world")); CXXTOOLS_UNIT_ASSERT(r.match("heo world")); } void testSubexpression() { cxxtools::Regex r("([0-9]+)\\.([0-9]+)"); cxxtools::RegexSMatch s; CXXTOOLS_UNIT_ASSERT(r.match("hello 6.7 world", s)); CXXTOOLS_UNIT_ASSERT_EQUALS(s.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s[0], "6.7"); CXXTOOLS_UNIT_ASSERT_EQUALS(s[1], "6"); CXXTOOLS_UNIT_ASSERT_EQUALS(s[2], "7"); } void testEmptyRegex() { cxxtools::Regex r(""); CXXTOOLS_UNIT_ASSERT(r.match("hello world")); CXXTOOLS_UNIT_ASSERT(r.match(" hello world")); CXXTOOLS_UNIT_ASSERT(r.match("hellllo world")); CXXTOOLS_UNIT_ASSERT(r.match("heo world")); } void testFormat() { cxxtools::Regex r("[ \t]*([,;])[ \t]*"); std::string a = "a , b ; c"; cxxtools::RegexSMatch m; r.match(a, m); std::string b = m.format("blah=<$1>"); // => , CXXTOOLS_UNIT_ASSERT_EQUALS(b, "blah=<,>"); } void testFormatBrace() { cxxtools::Regex r("[ \t]*([,;])[ \t]*"); std::string a = "a , b ; c"; cxxtools::RegexSMatch m; r.match(a, m); std::string b = m.format("blah=<${1}1>"); // => , CXXTOOLS_UNIT_ASSERT_EQUALS(b, "blah=<,1>"); } void testSubst() { cxxtools::Regex r("[ \t]*([,;])[ \t]*"); std::string a = "a , b ; c"; std::string b = r.subst(a, "$1"); // => a,b;c CXXTOOLS_UNIT_ASSERT_EQUALS(b, "a,b;c"); std::string c = r.subst(a, "|"); CXXTOOLS_UNIT_ASSERT_EQUALS(c, "a|b|c"); } }; cxxtools::unit::RegisterTest register_RegexTest; cxxtools-3.0/test/join-test.cpp0000664000175000017500000000500213644433072013564 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/join.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class JoinTest : public cxxtools::unit::TestSuite { public: JoinTest() : cxxtools::unit::TestSuite("join") { registerMethod("joinString", *this, &JoinTest::joinString); registerMethod("joinInt", *this, &JoinTest::joinInt); registerMethod("emptyJoin", *this, &JoinTest::emptyJoin); } void joinString() { std::vector d; d.push_back("Hello"); d.push_back("World"); d.push_back("!"); std::string result = cxxtools::join(d.begin(), d.end(), " "); CXXTOOLS_UNIT_ASSERT_EQUALS(result, "Hello World !"); } void joinInt() { std::vector d; d.push_back(4); d.push_back(17); d.push_back(-12); std::string result = cxxtools::join(d.begin(), d.end(), ", "); CXXTOOLS_UNIT_ASSERT_EQUALS(result, "4, 17, -12"); } void emptyJoin() { std::vector d; std::string result = cxxtools::join(d.begin(), d.end(), ", "); CXXTOOLS_UNIT_ASSERT_EQUALS(result, ""); } }; cxxtools::unit::RegisterTest register_JoinTest; cxxtools-3.0/test/arg-test.cpp0000664000175000017500000002136413644433072013407 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "cxxtools/arg.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class ArgTest : public cxxtools::unit::TestSuite { std::vector argp; char* arg(const char* value) { argp.push_back(new char [strlen(value) + 1]); strcpy(argp.back(), value); return argp.back(); } public: ArgTest() : cxxtools::unit::TestSuite("arg") { registerMethod("testArgBool", *this, &ArgTest::testArgBool); registerMethod("testArgCharP", *this, &ArgTest::testArgCharP); registerMethod("testArgpInt", *this, &ArgTest::testArgpInt); registerMethod("testArgpCharp", *this, &ArgTest::testArgpCharp); registerMethod("testArgpStdString", *this, &ArgTest::testArgpStdString); registerMethod("testArgChar", *this, &ArgTest::testArgChar); } void setUp() { } void tearDown() { for (std::vector::iterator it = argp.begin(); it != argp.end(); ++it) delete[] *it; argp.clear(); } void testArgBool() { int argc = 7; char* argv[] = { arg("prog"), arg("-i"), arg("-j"), arg("-k"), arg("-cf"), arg("--foo"), arg("foo"), 0 }; cxxtools::Arg optionJ(argc, argv, 'j'); cxxtools::Arg optionL(argc, argv, 'l'); cxxtools::Arg optionC(argc, argv, 'c'); cxxtools::Arg optionFoo(argc, argv, "--foo"); cxxtools::Arg optionBar(argc, argv, "--bar"); CXXTOOLS_UNIT_ASSERT(optionJ); CXXTOOLS_UNIT_ASSERT(!optionL); CXXTOOLS_UNIT_ASSERT(optionC); CXXTOOLS_UNIT_ASSERT(optionFoo); CXXTOOLS_UNIT_ASSERT(!optionBar); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-i"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "-k"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[3], "-f"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[4], "foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[5], static_cast(0)); } void testArgCharP() { int argc = 7; char* argv[] = { arg("prog"), arg("-i"), arg("foo"), arg("--foo"), arg("inp"), arg("-k"), arg("bar"), 0 }; cxxtools::Arg optionI(argc, argv, 'i'); cxxtools::Arg optionL(argc, argv, 'l', "blah"); cxxtools::Arg optionFoo(argc, argv, "--foo"); cxxtools::Arg optionBar(argc, argv, "--bar"); CXXTOOLS_UNIT_ASSERT(optionI.isSet()); CXXTOOLS_UNIT_ASSERT(!optionL.isSet()); CXXTOOLS_UNIT_ASSERT(optionFoo.isSet()); CXXTOOLS_UNIT_ASSERT(!optionBar.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionI.getValue(), "foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionL.getValue(), "blah"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionFoo.getValue(), "inp"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(optionBar.getValue(), static_cast(0)); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-k"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "bar"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], static_cast(0)); } void testArgpInt() { int argc = 6; char* argv[] = { arg("prog"), arg("-v"), arg("42"), arg("-i"), arg("-j5"), arg("--foo"), 0 }; cxxtools::Arg optionJ(argc, argv, 'j'); cxxtools::Arg optionV(argc, argv, 'v'); CXXTOOLS_UNIT_ASSERT(optionJ.isSet()); CXXTOOLS_UNIT_ASSERT(optionV.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(optionJ, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(optionV, 42); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-i"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "--foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], static_cast(0)); } void testArgpCharp() { int argc = 7; char* argv[] = { arg("prog"), arg("-v"), arg("42"), arg("-I"), arg("include"), arg("-Jfoo"), arg("-Khello world"), 0 }; cxxtools::Arg optionI(argc, argv, 'I'); cxxtools::Arg optionJ(argc, argv, 'J'); cxxtools::Arg optionK(argc, argv, 'K'); CXXTOOLS_UNIT_ASSERT(optionI.isSet()); CXXTOOLS_UNIT_ASSERT(optionJ.isSet()); CXXTOOLS_UNIT_ASSERT(optionK.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionI, "include"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionJ, "foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionK, "hello world"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-v"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "42"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], static_cast(0)); } void testArgpStdString() { int argc = 7; char* argv[] = { arg("prog"), arg("-v"), arg("42"), arg("-Jfoo"), arg("-I"), arg("include"), arg("-Khello world"), 0 }; cxxtools::Arg optionI(argc, argv, 'I'); cxxtools::Arg optionJ(argc, argv, 'J'); cxxtools::Arg optionK(argc, argv, 'K'); CXXTOOLS_UNIT_ASSERT(optionI.isSet()); CXXTOOLS_UNIT_ASSERT(optionJ.isSet()); CXXTOOLS_UNIT_ASSERT(optionK.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(optionI.getValue(), "include"); CXXTOOLS_UNIT_ASSERT_EQUALS(optionJ.getValue(), "foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(optionK.getValue(), "hello world"); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-v"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "42"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], static_cast(0)); } void testArgChar() { int argc = 5; char* argv[] = { arg("prog"), arg("-D"), arg("A"), arg("-F"), arg("\t"), 0 }; cxxtools::Arg optionA(argc, argv, 'A'); cxxtools::Arg optionD(argc, argv, 'D'); cxxtools::Arg optionF(argc, argv, 'F'); CXXTOOLS_UNIT_ASSERT(!optionA.isSet()); CXXTOOLS_UNIT_ASSERT(optionD.isSet()); CXXTOOLS_UNIT_ASSERT(optionF.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(*optionD, 'A'); CXXTOOLS_UNIT_ASSERT_EQUALS(*optionF, '\t'); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 1); } }; cxxtools::unit::RegisterTest register_ArgTest; cxxtools-3.0/test/json-test.cpp0000664000175000017500000003252213644433072013605 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/json.h" #include "cxxtools/log.h" #include "cxxtools/hexdump.h" #include #include #include log_define("cxxtools.test.json") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; const cxxtools::SerializationInfo* p = si.findMember("nullValue"); obj.nullValue = p != 0 && p->isNull(); } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue && obj1.nullValue == obj2.nullValue; } struct TestObject2 : public TestObject { typedef std::set SetType; typedef std::map MapType; SetType setValue; MapType mapValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast(obj); si.getMember("setValue") >>= obj.setValue; si.getMember("mapValue") >>= obj.mapValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject2& obj) { si <<= static_cast(obj); si.addMember("setValue") <<= obj.setValue; si.addMember("mapValue") <<= obj.mapValue; si.setTypeName("TestObject2"); } bool operator== (const TestObject2& obj1, const TestObject2& obj2) { return static_cast(obj1) == static_cast(obj2) && obj1.setValue == obj2.setValue && obj1.mapValue == obj2.mapValue; } } class JsonTest : public cxxtools::unit::TestSuite { public: JsonTest() : cxxtools::unit::TestSuite("json") { registerMethod("testScalar", *this, &JsonTest::testScalar); registerMethod("testInt", *this, &JsonTest::testInt); registerMethod("testDouble", *this, &JsonTest::testDouble); registerMethod("testNan", *this, &JsonTest::testNan); registerMethod("testArray", *this, &JsonTest::testArray); registerMethod("testObject", *this, &JsonTest::testObject); registerMethod("testComplexObject", *this, &JsonTest::testComplexObject); registerMethod("testObjectVector", *this, &JsonTest::testObjectVector); registerMethod("testBinaryData", *this, &JsonTest::testBinaryData); } void testScalar() { std::stringstream data; int value = 5; data << cxxtools::Json(value); log_debug("scalar: " << data.str()); int value2 = 0; data >> cxxtools::Json(value2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, value2); } template void testIntValue(IntT value) { std::stringstream data; data << cxxtools::Json(value); log_debug("int: " << data.str()); IntT result = 0; data >> cxxtools::Json(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } void testInt() { testIntValue(30); testIntValue(300); testIntValue(100000); testIntValue(-30); testIntValue(-300); testIntValue(-100000); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #endif testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(std::numeric_limits::min()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(std::numeric_limits::min()); #endif testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #endif } void testDoubleValue(double value) { std::stringstream data; data << cxxtools::Json(value); double result = 0.0; data >> cxxtools::Json(result); log_debug("test double value " << value << " => " << result); if (value != value) // check for nan CXXTOOLS_UNIT_ASSERT(result != result); else if (value == std::numeric_limits::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::numeric_limits::infinity()); else if (value == -std::numeric_limits::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, -std::numeric_limits::infinity()); else CXXTOOLS_UNIT_ASSERT(value / result < 1.00001 && value / result > 0.99999); } void testDouble() { testDoubleValue(3.14159); testDoubleValue(-3.877e-12); } void testNan() { { std::ostringstream data; data << cxxtools::Json(std::numeric_limits::quiet_NaN()); CXXTOOLS_UNIT_ASSERT_EQUALS(data.str(), "null"); } { std::ostringstream data; data << cxxtools::Json(std::numeric_limits::quiet_NaN()); CXXTOOLS_UNIT_ASSERT_EQUALS(data.str(), "null"); } { std::ostringstream data; data << cxxtools::Json(std::numeric_limits::quiet_NaN()); CXXTOOLS_UNIT_ASSERT_EQUALS(data.str(), "null"); } } void testArray() { std::stringstream data; std::vector intvector; intvector.push_back(4711); intvector.push_back(4712); intvector.push_back(-3); intvector.push_back(-257); data << cxxtools::Json(intvector); log_debug("intvector: " << data.str()); std::vector intvector2; data >> cxxtools::Json(intvector2); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector.size(), intvector2.size()); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[0], intvector2[0]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[1], intvector2[1]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[2], intvector2[2]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[3], intvector2[3]); } void testObject() { std::stringstream data; TestObject obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = true; obj.nullValue = true; data << cxxtools::Json(obj); TestObject obj2; data >> cxxtools::Json(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, obj2.intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, obj2.stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, obj2.doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, obj2.boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.nullValue, obj2.nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testComplexObject() { std::stringstream data; std::vector v; TestObject2 obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = false; obj.nullValue = true; obj.setValue.insert(17); obj.setValue.insert(23); obj.mapValue[45] = "fourtyfive"; obj.mapValue[88] = "eightyeight"; obj.mapValue[100] = "onehundred"; v.push_back(obj); obj.setValue.insert(88); v.push_back(obj); data << cxxtools::Json(v); std::vector v2; data >> cxxtools::Json(v2); CXXTOOLS_UNIT_ASSERT(v == v2); } void testObjectVector() { std::stringstream data; std::vector obj; obj.resize(2); obj[0].intValue = 17; obj[0].stringValue = "foobar"; obj[0].doubleValue = 3.125; obj[0].boolValue = true; obj[0].nullValue = true; obj[1].intValue = 18; obj[1].stringValue = "hi there"; obj[1].doubleValue = -17.25; obj[1].boolValue = false; obj[1].nullValue = true; data << cxxtools::Json(obj); std::vector obj2; data >> cxxtools::Json(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj2.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].intValue, obj2[0].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].stringValue, obj2[0].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].doubleValue, obj2[0].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].boolValue, obj2[0].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].nullValue, obj2[0].nullValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].intValue, obj2[1].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].stringValue, obj2[1].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].doubleValue, obj2[1].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].boolValue, obj2[1].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].nullValue, obj2[1].nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testBinaryData() { std::stringstream data; std::string v; for (unsigned n = 0; n < 1024; ++n) v.push_back(static_cast(n)); data << cxxtools::Json(v); log_debug("v.data:\n" << cxxtools::hexDump(data.str())); std::string v2; data >> cxxtools::Json(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 1024); CXXTOOLS_UNIT_ASSERT(v == v2); data.str(std::string()); for (unsigned n = 0; n < 0xffff; ++n) v.push_back(static_cast(n)); data << cxxtools::Json(v); log_debug("v.data:\n" << cxxtools::hexDump(data.str())); data >> cxxtools::Json(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT(v == v2); } }; cxxtools::unit::RegisterTest register_JsonTest; cxxtools-3.0/test/trim-test.cpp0000664000175000017500000001576113644433072013615 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/trim.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" static const std::string ws = " \t"; static const cxxtools::String wsu = L" \t"; class TrimTest : public cxxtools::unit::TestSuite { public: TrimTest() : cxxtools::unit::TestSuite("trim") { registerMethod("ltrimTest", *this, &TrimTest::ltrimTest); registerMethod("rtrimTest", *this, &TrimTest::rtrimTest); registerMethod("trimTest", *this, &TrimTest::trimTest); registerMethod("trimTestU", *this, &TrimTest::trimTestU); registerMethod("ltrimiTest", *this, &TrimTest::ltrimiTest); registerMethod("rtrimiTest", *this, &TrimTest::rtrimiTest); registerMethod("trimiTest", *this, &TrimTest::trimiTest); } void ltrimTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string("foo bar")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t foo bar ")), "foo bar "); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t\n foo bar ")), "foo bar "); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t\n foo bar "), ws), "\n foo bar "); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t ")), ""); } void rtrimTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string("foo bar")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t foo bar ")), " \t foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t\n foo bar \n ")), " \t\n foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t\n foo bar \n "), ws), " \t\n foo bar \n"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t ")), ""); } void trimTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string("foo bar")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t foo bar ")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t\n foo bar \n ")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t\n foo bar \n "), ws), "\n foo bar \n"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t ")), ""); } void trimTestU() { CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String("foo bar")) == L"foo bar"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t foo bar ")) == L"foo bar"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t\n foo bar \n ")) == L"foo bar"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t\n foo bar \n "), wsu) == L"\n foo bar \n"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t ")) == L""); } void ltrimiTest() { std::string s; s = "foo bar"; cxxtools::ltrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar"); s = " \t foo bar "; cxxtools::ltrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar "); s = " \t\n foo bar "; cxxtools::ltrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar "); s = " \t\n foo bar "; cxxtools::ltrimi(s, ws); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "\n foo bar "); s = " \t "; cxxtools::ltrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, ""); } void rtrimiTest() { std::string s; s = "foo bar"; cxxtools::rtrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar"); s = " \t foo bar "; cxxtools::rtrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, " \t foo bar"); s = " \t\n foo bar \n "; cxxtools::rtrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, " \t\n foo bar"); s = " \t\n foo bar \n "; cxxtools::rtrimi(s, ws); CXXTOOLS_UNIT_ASSERT_EQUALS(s, " \t\n foo bar \n"); s = " \t "; cxxtools::rtrimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, ""); } void trimiTest() { std::string s; s = "foo bar"; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar"); s = " \t foo bar "; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar"); s = " \t\n foo bar \n "; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo bar"); s = " \t\n foo bar \n "; cxxtools::trimi(s, ws); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "\n foo bar \n"); s = " \t "; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, ""); } void trimiTestU() { cxxtools::String s; s = L"foo bar"; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, L"foo bar"); s = L" \t foo bar "; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, L"foo bar"); s = L" \t\n foo bar \n "; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, L"foo bar"); s = L" \t\n foo bar \n "; cxxtools::trimi(s, wsu); CXXTOOLS_UNIT_ASSERT_EQUALS(s, L"\n foo bar \n"); s = L" \t "; cxxtools::trimi(s); CXXTOOLS_UNIT_ASSERT_EQUALS(s, L""); } }; cxxtools::unit::RegisterTest register_TrimTest; cxxtools-3.0/test/eventloop-test.cpp0000664000175000017500000000551113644433072014645 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/eventloop.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/event.h" #include "cxxtools/eventloop.h" namespace { class TestEvent1 : public cxxtools::BasicEvent { }; class TestEvent2 : public cxxtools::BasicEvent { }; } class EventLoopTest : public cxxtools::unit::TestSuite { cxxtools::EventLoop _loop; std::string _events; void onTestEvent1(const TestEvent1&) { _events += "1"; } void onTestEvent2(const TestEvent2&) { _events += "2"; } public: EventLoopTest() : cxxtools::unit::TestSuite("eventloop") { registerMethod("commitEvent", *this, &EventLoopTest::commitEvent); registerMethod("priorityEvent", *this, &EventLoopTest::priorityEvent); _loop.event.subscribe(slot(*this, &EventLoopTest::onTestEvent1)); _loop.event.subscribe(slot(*this, &EventLoopTest::onTestEvent2)); } void setUp() { _events.clear(); } void commitEvent() { _loop.commitEvent(TestEvent1()); _loop.commitEvent(TestEvent2()); _loop.processEvents(); CXXTOOLS_UNIT_ASSERT_EQUALS(_events, "12"); } void priorityEvent() { _loop.commitEvent(TestEvent1()); _loop.commitPriorityEvent(TestEvent2()); _loop.processEvents(); CXXTOOLS_UNIT_ASSERT_EQUALS(_events, "21"); } }; cxxtools::unit::RegisterTest register_EventLoopTest; cxxtools-3.0/test/properties-test.cpp0000664000175000017500000003436513644433072015037 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/propertiesdeserializer.h" #include "cxxtools/propertiesparser.h" #include "cxxtools/properties.h" namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue; } } class PropertiesTest : public cxxtools::unit::TestSuite { public: PropertiesTest() : cxxtools::unit::TestSuite("properties") { registerMethod("testProperties", *this, &PropertiesTest::testProperties); registerMethod("testFailProperties", *this, &PropertiesTest::testFailProperties); registerMethod("testScalar", *this, &PropertiesTest::testScalar); registerMethod("testStruct", *this, &PropertiesTest::testStruct); registerMethod("testVector", *this, &PropertiesTest::testVector); registerMethod("testMember", *this, &PropertiesTest::testMember); registerMethod("testIStream", *this, &PropertiesTest::testIStream); registerMethod("testStrangeKeys", *this, &PropertiesTest::testStrangeKeys); registerMethod("testMultilineValues", *this, &PropertiesTest::testMultilineValues); registerMethod("testEmptyValue", *this, &PropertiesTest::testEmptyValue); registerMethod("testTab", *this, &PropertiesTest::testTab); registerMethod("testTrim", *this, &PropertiesTest::testTrim); } void testProperties() { std::istringstream data( "a\\ b = 42\n" "b=\\u9\\r\\n\\t\n" "\\ufoo =Hi there\n" "l:Hi \\\n" "there\n" "c=\\uabc\\5\\u0000abCD1\\u1234"); cxxtools::PropertiesDeserializer deserializer(data); // the first call to the deserialize method will parse the input // and create a SerializationInfo object int v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "a b")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 42); CXXTOOLS_UNIT_ASSERT_THROW(deserializer.deserialize(v, "a b "), cxxtools::SerializationError); cxxtools::String b; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(b, "b")); CXXTOOLS_UNIT_ASSERT_EQUALS(b, "\t\r\n\t"); cxxtools::String c; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(c, "c")); CXXTOOLS_UNIT_ASSERT(c.size() >= 1); CXXTOOLS_UNIT_ASSERT_EQUALS(c[0].value(), 0xabc); CXXTOOLS_UNIT_ASSERT(c.size() >= 2); CXXTOOLS_UNIT_ASSERT_EQUALS(c[1], '5'); CXXTOOLS_UNIT_ASSERT(c.size() >= 3); CXXTOOLS_UNIT_ASSERT_EQUALS(c[2].value(), 0xabcd); CXXTOOLS_UNIT_ASSERT(c.size() >= 4); CXXTOOLS_UNIT_ASSERT_EQUALS(c[3], '1'); CXXTOOLS_UNIT_ASSERT(c.size() >= 5); CXXTOOLS_UNIT_ASSERT_EQUALS(c[4].value(), 0x1234); CXXTOOLS_UNIT_ASSERT_EQUALS(c.size(), 5); cxxtools::String l; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(l, "l")); CXXTOOLS_UNIT_ASSERT_EQUALS(l, "Hi there"); cxxtools::String f; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(f, "\x0foo")); CXXTOOLS_UNIT_ASSERT_EQUALS(f, "Hi there"); } void testFailProperties() { std::istringstream data( "ab = \\uz42\n"); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::PropertiesDeserializer deserializer(data), cxxtools::PropertiesParserError); } void testScalar() { std::istringstream data( "rootlogger=I\n" "value.a=17\n" "a.b.c=3.25" ); cxxtools::PropertiesDeserializer deserializer(data); int value = 5; deserializer.deserialize(value, "value.a"); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 17); double d = 0; deserializer.deserialize(d, "a.b.c"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 3.25); } void testStruct() { std::istringstream data( "s.foo.intValue=5\n" "s.foo.stringValue=Hi there\n" "s.foo.doubleValue=45.5\n" "s.foo.boolValue=true\n" ); cxxtools::PropertiesDeserializer deserializer(data); TestObject obj; deserializer.deserialize(obj, "s.foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, "Hi there"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, 45.5); CXXTOOLS_UNIT_ASSERT(obj.boolValue); } void testVector() { std::istringstream data( "myvector.0=4\n" "myvector.1=Hi\n" "myvector.2=foo\n" ); cxxtools::PropertiesDeserializer deserializer(data); std::vector v; deserializer.deserialize(v, "myvector"); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(v[0], "4"); CXXTOOLS_UNIT_ASSERT_EQUALS(v[1], "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(v[2], "foo"); } void testMember() { std::istringstream data( "a.b.c.d=5\n" "a.e.f.g=7\n"); cxxtools::PropertiesDeserializer deserializer(data); const cxxtools::SerializationInfo& si = deserializer.si(); int v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a").getMember("b.c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a.b").getMember("c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a.b.c").getMember("d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a.b.c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW( si.getMember("a").getMember("b").getMember("c").getMember("d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW( si.getMember("a.b").getMember("c").getMember("d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW( si.getMember("a").getMember("b.c").getMember("d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW( si.getMember("a").getMember("b.c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW( si.getMember("a.b").getMember("c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW( si.getMember("a.e.f.g") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 7); } void testIStream() { std::istringstream data( "s.foo.intValue=5\n" "s.foo.stringValue=Hi there\n" "s.foo.doubleValue=45.5\n" "s.foo.boolValue=true\n" ); TestObject obj; data >> cxxtools::Properties(obj, "s.foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, "Hi there"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, 45.5); CXXTOOLS_UNIT_ASSERT(obj.boolValue); } void testStrangeKeys() { std::istringstream data( "a-b*+\\==5\n" "\\:\\::7\n"); cxxtools::PropertiesDeserializer deserializer(data); const cxxtools::SerializationInfo& si = deserializer.si(); int v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a-b*+=") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("::") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 7); } void testMultilineValues() { std::istringstream data( "fruits apple, banana, pear, \\\n" " cantaloupe, watermelon, \\\n" " kiwi, mango"); cxxtools::PropertiesDeserializer deserializer(data); const cxxtools::SerializationInfo& si = deserializer.si(); std::string v; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("fruits") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, "apple, banana, pear, cantaloupe, watermelon, kiwi, mango"); } void testEmptyValue() { std::istringstream data("apple\n" "banana \n" "pear : \n" "cantaloupe"); cxxtools::PropertiesDeserializer deserializer(data); const cxxtools::SerializationInfo& si = deserializer.si(); std::string v; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("apple") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, ""); CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("banana") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, ""); CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("pear") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, ""); CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("cantaloupe") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, ""); } void testTab() { std::istringstream data( "a \\t\n" "b : \\t\n"); cxxtools::PropertiesDeserializer deserializer(data); cxxtools::Char v; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "a")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, L'\t'); v = L' '; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "b")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, L'\t'); } void testTrim() { std::istringstream data( "a = hi\t\n" "b = \thi\n" "c = hi\\t\n" "d = \t\\thi\\ \n" "e blah \n" "f blah\x9\n" "g blah\\t"); cxxtools::PropertiesDeserializer deserializer; deserializer.trim(true); deserializer.read(data); cxxtools::String v; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "a")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"hi")); v.clear(); CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "b")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"hi")); v.clear(); CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "c")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"hi\t")); v.clear(); CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "d")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"\thi ")); v.clear(); CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "e")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"blah")); v.clear(); CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "f")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"blah")); v.clear(); CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "g")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, cxxtools::String(L"blah\t")); } }; cxxtools::unit::RegisterTest register_PropertiesTest; cxxtools-3.0/test/iconvstream-test.cpp0000664000175000017500000000566513644433072015176 00000000000000/* * Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/iconvstream.h" class IconvstreamTest : public cxxtools::unit::TestSuite { public: IconvstreamTest() : cxxtools::unit::TestSuite("iconvstream") { registerMethod("testIconvstream", *this, &IconvstreamTest::testIconvstream); } void testIconvstream() { const std::string src("iconv error for Ω test"); const std::string res_cut("iconv error for "); const std::string res_skip("iconv error for test"); std::ostringstream out; cxxtools::iconvstreambuf ic; ic.open(out, "ascii", "UTF-8"); ic.sputn(src.data(), src.size()); ic.sync(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), res_cut); out.str(""); ic.open(out, "ascii", "UTF-8", cxxtools::iconvstreambuf::mode_skip); ic.sputn(src.data(), src.size()); ic.sync(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), res_skip); CXXTOOLS_UNIT_ASSERT_EQUALS( ic.pubseekoff(0, std::ios_base::cur, std::ios_base::in), res_skip.size()); out.str(""); ic.open(out, "ascii", "UTF-8", cxxtools::iconvstreambuf::mode_throw); ic.sputn(src.data(), src.size()); CXXTOOLS_UNIT_ASSERT_THROW(ic.sync(), cxxtools::iconv_error); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), res_cut); } }; cxxtools::unit::RegisterTest register_IconvstreamTest; cxxtools-3.0/test/md5-test.cpp0000664000175000017500000000624513644433072013324 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/md5stream.h" #include "cxxtools/md5.h" #include "cxxtools/hmac.h" class MD5Test : public cxxtools::unit::TestSuite { public: MD5Test() : cxxtools::unit::TestSuite("md5") { registerMethod("testMD5", *this, &MD5Test::testMD5); registerMethod("testMD5stream", *this, &MD5Test::testMD5stream); registerMethod("testHMAC_MD5", *this, &MD5Test::testHMAC_MD5); } void testMD5stream() { cxxtools::Md5stream md5; std::string hexDigest; hexDigest = md5.getHexDigest(); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "d41d8cd98f00b204e9800998ecf8427e"); md5 << "The quick brown fox jumps over the lazy dog."; hexDigest = md5.getHexDigest(); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "e4d909c290d0fb1ca068ffaddf22cbd0"); } void testMD5() { std::string hexDigest; hexDigest = cxxtools::md5(""); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "d41d8cd98f00b204e9800998ecf8427e"); hexDigest = cxxtools::md5("The quick brown fox jumps over the lazy dog."); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "e4d909c290d0fb1ca068ffaddf22cbd0"); } void testHMAC_MD5() { std::string hmac; hmac = cxxtools::hmac >("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(hmac, "74e6f7298a9c2d168935f58c001bad88"); hmac = cxxtools::hmac >("key", "The quick brown fox jumps over the lazy dog"); CXXTOOLS_UNIT_ASSERT_EQUALS(hmac, "80070713463e7749b90c2dc24911e275"); } }; cxxtools::unit::RegisterTest register_MD5Test; cxxtools-3.0/test/serialization-test.cpp0000664000175000017500000003734413644433072015520 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/serializationinfo.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class SerializationTest : public cxxtools::unit::TestSuite { public: SerializationTest() : cxxtools::unit::TestSuite("serialization") { registerMethod("testBool", *this, &SerializationTest::testBool); registerMethod("testSignedChar", *this, &SerializationTest::testSignedChar); registerMethod("testUnsignedChar", *this, &SerializationTest::testUnsignedChar); registerMethod("testChar", *this, &SerializationTest::testChar); registerMethod("testShort", *this, &SerializationTest::testShort); registerMethod("testUnsignedShort", *this, &SerializationTest::testUnsignedShort); registerMethod("testInt", *this, &SerializationTest::testInt); registerMethod("testUnsignedInt", *this, &SerializationTest::testUnsignedInt); registerMethod("testLong", *this, &SerializationTest::testLong); registerMethod("testUnsingedLong", *this, &SerializationTest::testUnsingedLong); registerMethod("testDouble", *this, &SerializationTest::testDouble); registerMethod("testStdString", *this, &SerializationTest::testStdString); registerMethod("testUnicodeString", *this, &SerializationTest::testUnicodeString); registerMethod("testStringToInt", *this, &SerializationTest::testStringToInt); registerMethod("testIntToString", *this, &SerializationTest::testIntToString); registerMethod("testVector", *this, &SerializationTest::testVector); registerMethod("testBoolVector", *this, &SerializationTest::testBoolVector); registerMethod("testList", *this, &SerializationTest::testList); registerMethod("testDeque", *this, &SerializationTest::testDeque); registerMethod("testSet", *this, &SerializationTest::testSet); registerMethod("testMultiset", *this, &SerializationTest::testMultiset); registerMethod("testMap", *this, &SerializationTest::testMap); registerMethod("testMultimap", *this, &SerializationTest::testMultimap); registerMethod("testCArray", *this, &SerializationTest::testCArray); #if __cplusplus >= 201103L registerMethod("testForwardList", *this, &SerializationTest::testForwardList); registerMethod("testUnorderedSet", *this, &SerializationTest::testUnorderedSet); registerMethod("testUnorderedMultiset", *this, &SerializationTest::testUnorderedMultiset); registerMethod("testUnorderedMap", *this, &SerializationTest::testUnorderedMap); registerMethod("testUnorderedMultimap", *this, &SerializationTest::testUnorderedMultimap); registerMethod("testTuple", *this, &SerializationTest::testTuple); registerMethod("testArray", *this, &SerializationTest::testArray); registerMethod("testEnum", *this, &SerializationTest::testEnum); registerMethod("testCast", *this, &SerializationTest::testCast); #endif } void testBool() { cxxtools::SerializationInfo si; bool b = true; bool bb = false; si <<= b; si >>= bb; CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, bb); b = false; si <<= b; si >>= bb; CXXTOOLS_UNIT_ASSERT_EQUALS(b, false); CXXTOOLS_UNIT_ASSERT_EQUALS(b, bb); } void testSignedChar() { cxxtools::SerializationInfo si; const signed char c = 'h'; signed char cc = '\0'; si <<= c; si >>= cc; CXXTOOLS_UNIT_ASSERT_EQUALS(c, cc); } void testUnsignedChar() { cxxtools::SerializationInfo si; const unsigned char c = 'U'; unsigned char cc = '\0'; si <<= c; si >>= cc; CXXTOOLS_UNIT_ASSERT_EQUALS(c, cc); } void testChar() { cxxtools::SerializationInfo si; const char c = 'e'; char cc = '\0'; si <<= c; si >>= cc; CXXTOOLS_UNIT_ASSERT_EQUALS(c, cc); } void testShort() { cxxtools::SerializationInfo si; const short v = -42; short vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testUnsignedShort() { cxxtools::SerializationInfo si; const unsigned short v = 42; unsigned short vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testInt() { cxxtools::SerializationInfo si; const int v = 442; int vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testUnsignedInt() { cxxtools::SerializationInfo si; const unsigned int v = 42; unsigned int vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testLong() { cxxtools::SerializationInfo si; const long v = -1234567890l; long vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testUnsingedLong() { cxxtools::SerializationInfo si; const unsigned long v = 1234567890l; unsigned long vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testDouble() { cxxtools::SerializationInfo si; const double v = 1.252; double vv = 0; si <<= v; si >>= vv; // Equality between doubles is no problem here since doubles are // kept as doubles inside SerializationInfo CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testStdString() { cxxtools::SerializationInfo si; const char v[] = "Hi there"; std::string vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testUnicodeString() { cxxtools::SerializationInfo si; const cxxtools::String v = L"Hi there"; cxxtools::String vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, v); } void testStringToInt() { cxxtools::SerializationInfo si; const char v[] = " -42 "; int vv = 0; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, -42); } void testIntToString() { cxxtools::SerializationInfo si; const int v = -42; std::string vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv, "-42"); } void testVector() { cxxtools::SerializationInfo si; std::vector v; v.push_back(42); v.push_back(23); v.push_back(-754); std::vector vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(v == vv); } void testBoolVector() { cxxtools::SerializationInfo si; std::vector v; v.push_back(true); v.push_back(false); v.push_back(true); std::vector vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(v == vv); } void testList() { cxxtools::SerializationInfo si; std::list v; v.push_back(42); v.push_back(23); v.push_back(-754); std::list vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testDeque() { cxxtools::SerializationInfo si; std::deque v; v.push_back(42); v.push_back(23); v.push_back(-754); std::deque vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testSet() { cxxtools::SerializationInfo si; std::set v; v.insert("Hello"); v.insert("World"); std::set vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testMultiset() { cxxtools::SerializationInfo si; std::multiset v; v.insert("Hello"); v.insert("Hello"); v.insert("World"); std::multiset vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv.size(), 3); CXXTOOLS_UNIT_ASSERT(vv == v); } void testMap() { cxxtools::SerializationInfo si; std::map v; v[17] = "Hello"; v[56] = "World"; std::map vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testMultimap() { cxxtools::SerializationInfo si; typedef std::multimap M; M v; v.insert(M::value_type(17, "Hello")); v.insert(M::value_type(56, "World")); v.insert(M::value_type(17, "blah")); std::multimap vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv.size(), 3); CXXTOOLS_UNIT_ASSERT(vv == v); } void testCArray() { cxxtools::SerializationInfo si; int v[3], vv[3]; v[0] = 19; v[1] = -4; v[2] = 42; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv[0], 19); CXXTOOLS_UNIT_ASSERT_EQUALS(vv[1], -4); CXXTOOLS_UNIT_ASSERT_EQUALS(vv[2], 42); } #if __cplusplus >= 201103L void testForwardList() { cxxtools::SerializationInfo si; std::forward_list v; v.push_front("Hello"); v.push_front("World"); std::forward_list vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testUnorderedSet() { cxxtools::SerializationInfo si; std::unordered_set v; v.insert("Hello"); v.insert("World"); std::unordered_set vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testUnorderedMultiset() { cxxtools::SerializationInfo si; std::unordered_multiset v; v.insert("Hello"); v.insert("Hello"); v.insert("World"); std::unordered_multiset vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv.size(), 3); CXXTOOLS_UNIT_ASSERT(vv == v); } void testUnorderedMap() { cxxtools::SerializationInfo si; std::unordered_map v; v[17] = "Hello"; v[56] = "World"; std::unordered_map vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT(vv == v); } void testUnorderedMultimap() { cxxtools::SerializationInfo si; typedef std::unordered_multimap M; M v; v.insert(M::value_type(17, "Hello")); v.insert(M::value_type(56, "World")); v.insert(M::value_type(17, "blah")); std::unordered_multimap vv; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv.size(), 3); CXXTOOLS_UNIT_ASSERT(vv == v); } void testTuple() { cxxtools::SerializationInfo si; std::tuple v; si <<= std::make_tuple(42, "Hello", 3.5); si >>= v; CXXTOOLS_UNIT_ASSERT_EQUALS(std::get<0>(v), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(std::get<1>(v), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(std::get<2>(v), 3.5); } void testArray() { cxxtools::SerializationInfo si; std::array v, vv; v[0] = 19; v[1] = -4; v[2] = 42; si <<= v; si >>= vv; CXXTOOLS_UNIT_ASSERT_EQUALS(vv[0], 19); CXXTOOLS_UNIT_ASSERT_EQUALS(vv[1], -4); CXXTOOLS_UNIT_ASSERT_EQUALS(vv[2], 42); } void testEnum() { enum class Foo : char { FOO, BAR, BAZ }; { Foo foo(Foo::FOO); Foo foo2(Foo::BAR); cxxtools::SerializationInfo si; si <<= cxxtools::EnumClass(foo); si >>= cxxtools::EnumClass(foo2); CXXTOOLS_UNIT_ASSERT(foo == foo2); } { const Foo foo(Foo::BAZ); Foo foo2(Foo::BAR); cxxtools::SerializationInfo si; si <<= cxxtools::EnumClass(foo); si >>= cxxtools::EnumClass(foo2); CXXTOOLS_UNIT_ASSERT(foo == foo2); } } void testCast() { std::set foo; foo.insert(56); foo.insert(42); std::vector bar = cxxtools::serialization_cast >(foo); CXXTOOLS_UNIT_ASSERT_EQUALS(bar.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(bar[0], 42); CXXTOOLS_UNIT_ASSERT_EQUALS(bar[1], 56); } #endif }; cxxtools::unit::RegisterTest register_SerializationTest; cxxtools-3.0/test/clock-test.cpp0000664000175000017500000000563313644433072013732 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/log.h" #include "cxxtools/clock.h" #include "cxxtools/timespan.h" #include "cxxtools/thread.h" log_define("cxxtools.test.clock") class ClockTest : public cxxtools::unit::TestSuite { public: ClockTest() : cxxtools::unit::TestSuite("clock") { registerMethod("testClock", *this, &ClockTest::testClock); // test for one second commented out since sleeping one second would slow down unit testing //registerMethod("testClockS", *this, &ClockTest::testClockS); } void testClock() { cxxtools::Clock cl; cl.start(); cxxtools::Thread::sleep(1); cxxtools::Timespan t = cl.stop(); log_debug("timespan=" << t.totalMSecs() << "ms"); CXXTOOLS_UNIT_ASSERT(t.totalMSecs() >= 1); // lets assume, that the test is below 1 second since the sleep is just one millisecond // without that test we wouldn't detect overflows in the implementation CXXTOOLS_UNIT_ASSERT(t.totalMSecs() < 1000); } void testClockS() { cxxtools::Clock cl; cl.start(); cxxtools::Thread::sleep(1001); cxxtools::Timespan t = cl.stop(); log_debug("timespan=" << t.totalMSecs() << "ms"); CXXTOOLS_UNIT_ASSERT(t.totalMSecs() > 1000); CXXTOOLS_UNIT_ASSERT(t.totalMSecs() < 2000); } }; cxxtools::unit::RegisterTest register_ClockTest; cxxtools-3.0/test/rpcbenchserver.cpp0000664000175000017500000001063013644433072014666 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include "color.h" std::string echo(const std::string& msg) { return msg; } std::vector seq(int from, int to) { std::vector ret; for (int n = from; n <= to; ++n) ret.push_back(n); return ret; } std::vector objects(unsigned count) { std::vector ret(count); for (unsigned n = 0; n < count; ++n) { ret[n].red = n; ret[n].green = n + 1; ret[n].blue = n + 2; } return ret; } int main(int argc, char* argv[]) { try { log_init("rpcbenchserver.properties"); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7002); cxxtools::Arg bport(argc, argv, 'b', 7003); cxxtools::Arg jport(argc, argv, 'j', 7004); cxxtools::Arg sslCert(argc, argv, 'c'); cxxtools::Arg threads(argc, argv, 't', 4); cxxtools::Arg maxThreads(argc, argv, 'T', 200); std::cout << "rpc echo server running on port " << port.getValue() << "\n\n" "options:\n\n" " -i ip set interface address to listen on (default: all interfaces)\n" " -p number set port number for http (xmlrpc and json over http, default: 7002)\n" " -b number set port number run binary rpc server (default: 7003)\n" " -j number set port number run json rpc server (default: 7004)\n" " -c cert enable ssl using the specified server certificate\n" " -t number set minimum number of threads (default: 4)\n" " -T number set maximum number of threads (default: 200)\n" << std::endl; cxxtools::EventLoop loop; cxxtools::http::Server server(loop, ip, port, sslCert); server.minThreads(threads); server.maxThreads(maxThreads); cxxtools::xmlrpc::Service service; service.registerFunction("echo", echo); service.registerFunction("seq", seq); service.registerFunction("objects", objects); server.addService("/xmlrpc", service); cxxtools::bin::RpcServer binServer(loop, ip, bport, sslCert); binServer.minThreads(threads); binServer.maxThreads(maxThreads); binServer.addService(service); cxxtools::json::RpcServer jsonServer(loop, ip, jport, sslCert); jsonServer.minThreads(threads); jsonServer.maxThreads(maxThreads); jsonServer.addService("", service); cxxtools::json::HttpService jsonhttpService; jsonhttpService.registerFunction("echo", echo); jsonhttpService.registerFunction("seq", seq); jsonhttpService.registerFunction("objects", objects); server.addService("/jsonrpc", jsonhttpService); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/test/logbench.cpp0000664000175000017500000001232713644433072013441 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include namespace bench { log_define("bench") class Logtester : public cxxtools::RefCounted { cxxtools::AttachedThread thread; unsigned long count; unsigned long loops; unsigned long enabled; public: Logtester(unsigned long count_, unsigned long loops_, unsigned long enabled_) : thread( cxxtools::callable(*this, &Logtester::run) ), count(count_), loops(loops_), enabled(enabled_) { } void start() { thread.start(); } void join() { thread.join(); } void setCount(unsigned long count_) { count = count_; } void setLoops(unsigned long loops_) { loops = loops_; } void setEnabled(bool sw = true) { enabled = sw; } void run(); }; void Logtester::run() { for (unsigned long l = 0; l < loops; ++l) { if (enabled) for (unsigned long i = 0; i < count; ++i) log_info("info message"); else for (unsigned long i = 0; i < count; ++i) log_debug("debug message"); } } } int main(int argc, char* argv[]) { try { cxxtools::Arg total(argc, argv, 'T', 5.0); // minimum runtime cxxtools::Arg loops(argc, argv, 'l', 1000); cxxtools::Arg numthreads(argc, argv, 't', 1); cxxtools::Arg enable(argc, argv, 'e'); cxxtools::Arg consolelog(argc, argv, 'c'); cxxtools::Arg udpport(argc, argv, 'u'); cxxtools::Arg logfile(argc, argv, 'f', "/dev/null"); cxxtools::Arg norollingfile(argc, argv, 'r'); cxxtools::LogConfiguration logConfiguration; logConfiguration.setRootLevel(cxxtools::Logger::LOG_LEVEL_INFO); unsigned settingCount = 0; if (consolelog) ++settingCount; if (logfile.isSet()) ++settingCount; if (udpport.isSet()) { ++settingCount; logConfiguration.setLoghost("", udpport); } if (settingCount > 1) { std::cerr << "only one of -c, -u or -f must be specified" << std::endl; return -1; } if (logfile.isSet() || settingCount == 0) { if (norollingfile || !logfile.isSet()) logConfiguration.setFile(logfile); else logConfiguration.setFile(logfile, 1024*1024, 0); } log_init(logConfiguration); unsigned long count = 1; double T; typedef std::vector > Threads; Threads threads; for (unsigned t = 0; t < numthreads; ++t) threads.push_back(new bench::Logtester(count, loops.getValue() / numthreads.getValue(), enable)); while (count > 0) { std::cout << "count=" << (count * loops) << '\t' << std::flush; for (Threads::iterator it = threads.begin(); it != threads.end(); ++it) (*it)->setCount(count); struct timeval tv0; struct timeval tv1; gettimeofday(&tv0, 0); if (threads.size() == 1) { (*threads.begin())->run(); } else { for (Threads::iterator it = threads.begin(); it != threads.end(); ++it) (*it)->start(); for (Threads::iterator it = threads.begin(); it != threads.end(); ++it) (*it)->join(); } gettimeofday(&tv1, 0); double t0 = tv0.tv_sec + tv0.tv_usec / 1e6; double t1 = tv1.tv_sec + tv1.tv_usec / 1e6; T = t1 - t0; std::cout.precision(6); std::cout << " T=" << T << '\t' << std::setprecision(12) << (count / T * loops) << " msg/s" << std::endl; if (T >= total) break; count <<= 1; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return -1; } } cxxtools-3.0/test/inifile-test.cpp0000664000175000017500000000637113644433072014256 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/inifile.h" #include class IniFileTest : public cxxtools::unit::TestSuite { public: IniFileTest() : cxxtools::unit::TestSuite("inifile") { registerMethod("testReadIniFile", *this, &IniFileTest::testReadIniFile); registerMethod("testWriteIniFile", *this, &IniFileTest::testWriteIniFile); } void testReadIniFile() { std::istringstream in( "[s1]\n" "k1=v1\n" "k2=v2\n" "[s2]\n" "k1=17\n" "k2=1.5" ); cxxtools::IniFile inifile(in); CXXTOOLS_UNIT_ASSERT(inifile.exists(L"s1")); CXXTOOLS_UNIT_ASSERT(!inifile.exists(L"s3")); CXXTOOLS_UNIT_ASSERT(inifile.exists(L"s1", L"k1")); CXXTOOLS_UNIT_ASSERT(!inifile.exists(L"s1", L"k3")); CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValue(L"s1", L"k1"), L"v1"); CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValueT(L"s1", L"k1", 42), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValueT(L"s2", L"k1", 42), 17); CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValueT(L"s2", L"k2", 42.25), 1.5); CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValueT(L"s2", L"k3", 42.25), 42.25); } void testWriteIniFile() { cxxtools::IniFile src; src.setValue(L"s1", L"k1", L"v1"); src.setValueT(L"s2", L"k1", 17); std::stringstream st; st << src; cxxtools::IniFile inifile; st >> inifile; CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValue(L"s1", L"k1"), L"v1"); CXXTOOLS_UNIT_ASSERT_EQUALS(inifile.getValueT(L"s2", L"k1", 42), 17); } }; cxxtools::unit::RegisterTest register_IniFileTest; cxxtools-3.0/test/test-main.cpp0000664000175000017500000000256513644433072013564 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testmain.h" cxxtools-3.0/test/xmlserializer-test.cpp0000664000175000017500000003137013644433072015526 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/xml/xmlserializer.h" #include "cxxtools/xml/xmldeserializer.h" #include "cxxtools/xml/xml.h" #include "cxxtools/log.h" #include "cxxtools/hexdump.h" #include #include #include log_define("cxxtools.test.xmlserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue; } struct TestObject2 : public TestObject { typedef std::set SetType; typedef std::map MapType; SetType setValue; MapType mapValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast(obj); si.getMember("setValue") >>= obj.setValue; si.getMember("mapValue") >>= obj.mapValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject2& obj) { si <<= static_cast(obj); si.addMember("setValue") <<= obj.setValue; si.addMember("mapValue") <<= obj.mapValue; si.setTypeName("TestObject2"); } bool operator== (const TestObject2& obj1, const TestObject2& obj2) { return static_cast(obj1) == static_cast(obj2) && obj1.setValue == obj2.setValue && obj1.mapValue == obj2.mapValue; } } class XmlSerializerTest : public cxxtools::unit::TestSuite { public: XmlSerializerTest() : cxxtools::unit::TestSuite("xmlserializer") { registerMethod("testScalar", *this, &XmlSerializerTest::testScalar); registerMethod("testInt", *this, &XmlSerializerTest::testInt); registerMethod("testDouble", *this, &XmlSerializerTest::testDouble); registerMethod("testArray", *this, &XmlSerializerTest::testArray); registerMethod("testObject", *this, &XmlSerializerTest::testObject); registerMethod("testComplexObject", *this, &XmlSerializerTest::testComplexObject); registerMethod("testObjectVector", *this, &XmlSerializerTest::testObjectVector); registerMethod("testBinaryData", *this, &XmlSerializerTest::testBinaryData); } void testScalar() { std::stringstream data; int value = 5; data << cxxtools::xml::Xml(value, "value"); int value2 = 0; data >> cxxtools::xml::Xml(value2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, value2); } template void testIntValue(IntT value) { std::stringstream data; data << cxxtools::xml::Xml(value, "value"); IntT result = 0; data >> cxxtools::xml::Xml(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } void testInt() { testIntValue(30); testIntValue(300); testIntValue(100000); testIntValue(-30); testIntValue(-300); testIntValue(-100000); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #endif testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(std::numeric_limits::min()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::min()) - 1); testIntValue(std::numeric_limits::min()); #endif testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast(std::numeric_limits::max()) + 1); testIntValue(std::numeric_limits::max()); #endif } void testDoubleValue(double value) { std::stringstream data; data << cxxtools::xml::Xml(value, "value"); double result = 0.0; data >> cxxtools::xml::Xml(result); log_debug("test double value " << value << " => " << result); if (value != value) // check for nan CXXTOOLS_UNIT_ASSERT(result != result); else if (value == std::numeric_limits::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::numeric_limits::infinity()); else if (value == -std::numeric_limits::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, -std::numeric_limits::infinity()); else CXXTOOLS_UNIT_ASSERT(value / result < 1.00001 && value / result > 0.99999); } void testDouble() { testDoubleValue(-3.877e-123); testDoubleValue(std::numeric_limits::max()); //testDoubleValue(std::numeric_limits::min()); testDoubleValue(std::numeric_limits::infinity()); testDoubleValue(-std::numeric_limits::infinity()); testDoubleValue(std::numeric_limits::quiet_NaN()); std::stringstream data; data << cxxtools::xml::Xml(std::numeric_limits::quiet_NaN(), "value"); double result = 0.0; data >> cxxtools::xml::Xml(result); CXXTOOLS_UNIT_ASSERT(result != result); } void testArray() { std::stringstream data; std::vector intvector; intvector.push_back(4711); intvector.push_back(4712); intvector.push_back(-3); intvector.push_back(-257); data << cxxtools::xml::Xml(intvector, "intvector"); log_debug("intvector: " << data.str()); std::vector intvector2; data >> cxxtools::xml::Xml(intvector2); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector.size(), intvector2.size()); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[0], intvector2[0]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[1], intvector2[1]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[2], intvector2[2]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[3], intvector2[3]); } void testObject() { std::stringstream data; TestObject obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = true; data << cxxtools::xml::Xml(obj, "obj"); TestObject obj2; data >> cxxtools::xml::Xml(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, obj2.intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, obj2.stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, obj2.doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, obj2.boolValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testComplexObject() { std::stringstream data; std::vector v; TestObject2 obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = false; obj.setValue.insert(17); obj.setValue.insert(23); obj.mapValue[45] = "fourtyfive"; obj.mapValue[88] = "eightyeight"; obj.mapValue[100] = "onehundred"; v.push_back(obj); obj.setValue.insert(88); v.push_back(obj); data << cxxtools::xml::Xml(v, "v"); std::vector v2; data >> cxxtools::xml::Xml(v2); CXXTOOLS_UNIT_ASSERT(v == v2); } void testObjectVector() { std::stringstream data; std::vector obj; obj.resize(2); obj[0].intValue = 17; obj[0].stringValue = "foobar"; obj[0].doubleValue = 3.125; obj[0].boolValue = true; obj[1].intValue = 18; obj[1].stringValue = "hi there"; obj[1].doubleValue = -17.25; obj[1].boolValue = false; data << cxxtools::xml::Xml(obj, "v"); std::vector obj2; data >> cxxtools::xml::Xml(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj2.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].intValue, obj2[0].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].stringValue, obj2[0].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].doubleValue, obj2[0].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].boolValue, obj2[0].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].intValue, obj2[1].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].stringValue, obj2[1].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].doubleValue, obj2[1].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].boolValue, obj2[1].boolValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testBinaryData() { std::stringstream data; std::string v; for (unsigned n = 0; n < 1024; ++n) v.push_back(static_cast(n)); data << cxxtools::xml::Xml(v, "v"); log_debug("v.data:\n" << cxxtools::hexDump(data.str())); std::string v2; data >> cxxtools::xml::Xml(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 1024); CXXTOOLS_UNIT_ASSERT(v == v2); data.str(std::string()); for (unsigned n = 0; n < 0xffff; ++n) v.push_back(static_cast(n)); data << cxxtools::xml::Xml(v, "v"); data >> cxxtools::xml::Xml(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT(v == v2); } }; cxxtools::unit::RegisterTest register_XmlSerializerTest; cxxtools-3.0/test/win1252-test.cpp0000664000175000017500000000434413644433072013744 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/win1252codec.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" class Win1252Test : public cxxtools::unit::TestSuite { public: Win1252Test() : cxxtools::unit::TestSuite("win1252") { registerMethod("encode", *this, &Win1252Test::encodeTest); registerMethod("decode", *this, &Win1252Test::decodeTest); } void encodeTest() { cxxtools::String ustr(L"Hi \xe4 there, 5 \u20ac"); std::string bstr = cxxtools::Win1252Codec::encode(ustr); CXXTOOLS_UNIT_ASSERT_EQUALS(bstr, "Hi \xe4 there, 5 \x80"); } void decodeTest() { std::string bstr("\xe4\xf6\xfc\xdf\x80"); cxxtools::String ustr = cxxtools::Win1252Codec::decode(bstr); CXXTOOLS_UNIT_ASSERT(ustr == L"\xe4\xf6\xfc\xdf\u20ac"); } }; cxxtools::unit::RegisterTest register_Win1252Test; cxxtools-3.0/test/jsondeserializer-test.cpp0000664000175000017500000003501513644433072016210 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/jsondeserializer.h" #include "cxxtools/json.h" #include "cxxtools/log.h" //log_define("cxxtools.test.jsondeserializer") // namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; TestObject() : intValue(0), doubleValue(0), boolValue(false), nullValue(false) { } }; inline void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; const cxxtools::SerializationInfo* p = si.findMember("nullValue"); obj.nullValue = p != 0 && p->isNull(); } struct TestObject2 : public TestObject { std::set setValue; struct { unsigned n; cxxtools::String s; } structValue; }; inline void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast(obj); si.getMember("setValue") >>= obj.setValue; const cxxtools::SerializationInfo& ssi = si.getMember("structValue"); ssi.getMember("n") >>= obj.structValue.n; ssi.getMember("s") >>= obj.structValue.s; } struct EmptyObject { }; inline void operator>>= (const cxxtools::SerializationInfo& /*si*/, EmptyObject& /*obj*/) { } } class JsonDeserializerTest : public cxxtools::unit::TestSuite { public: JsonDeserializerTest() : cxxtools::unit::TestSuite("jsondeserializer") { registerMethod("testInt", *this, &JsonDeserializerTest::testInt); registerMethod("testObject", *this, &JsonDeserializerTest::testObject); registerMethod("testObjectPlainKeys", *this, &JsonDeserializerTest::testObjectPlainKeys); registerMethod("testEmptyObject", *this, &JsonDeserializerTest::testEmptyObject); registerMethod("testArray", *this, &JsonDeserializerTest::testArray); registerMethod("testEmptyArrays", *this, &JsonDeserializerTest::testEmptyArrays); registerMethod("testStrings", *this, &JsonDeserializerTest::testStrings); registerMethod("testUnicodeString", *this, &JsonDeserializerTest::testUnicodeString); registerMethod("testUnicodeHighSurrogate", *this, &JsonDeserializerTest::testUnicodeHighSurrogate); registerMethod("testComplexObject", *this, &JsonDeserializerTest::testComplexObject); registerMethod("testCommentLine", *this, &JsonDeserializerTest::testCommentLine); registerMethod("testCommentMultiline", *this, &JsonDeserializerTest::testCommentMultiline); registerMethod("testMultipleObjectsT", *this, &JsonDeserializerTest::testMultipleObjectsT); registerMethod("testMultipleObjectsI", *this, &JsonDeserializerTest::testMultipleObjectsI); registerMethod("testTrailingComma", *this, &JsonDeserializerTest::testTrailingComma); } void testInt() { int data = 0; std::istringstream in("-4711"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, -4711); } void testObject() { TestObject data; std::istringstream in(" {" "\"intValue\": 17, " "\"stringValue\": \"foo bar\t\"," "\"doubleValue\": \"1000\", " "\"boolValue\" : true," "\"nullValue\" : null" "}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); } void testObjectPlainKeys() { TestObject data; std::istringstream in(" {" "intValue: 17, " "stringValue: \"foo bar\t\"," "doubleValue: \"1000\", " "boolValue : true," "nullValue : null" "}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); } void testEmptyObject() { EmptyObject data; std::istringstream in("{}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); } void testArray() { std::vector data; std::istringstream in(" [ 3,4, -3]"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], 4); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2], -3); } void testEmptyArrays() { std::vector data; std::istringstream in("[[],[]]"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 0); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], 0); } void testStrings() { std::vector data; std::istringstream in(" [ \"3\", \"\\t\\b\", \"\", \"\\u1e044\"]"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], "3"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], "\t\b"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[3].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[3][0].value(), 0x1e04); CXXTOOLS_UNIT_ASSERT_EQUALS(data[3][1], '4'); } void testUnicodeString() { cxxtools::String data; std::istringstream in("\"M\xc3\xa4kitalo\xf0\x90\xa4\x80\""); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 9); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].value(), 0xe4); CXXTOOLS_UNIT_ASSERT_EQUALS(data[8].value(), 0x10900); } void testUnicodeHighSurrogate() { { cxxtools::String data; std::istringstream in("\"\\ud834\\udd1e\""); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].value(), 0x1d11e); } { // autodetection of byte order cxxtools::String data; std::istringstream in("\"\\udd1e\\ud834\""); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].value(), 0x1d11e); } } void testComplexObject() { TestObject2 data; std::istringstream in(" {" "\"intValue\": 17, " "\"stringValue\": \"foo bar\t\"," "\"doubleValue\": \"1000\", " "\"boolValue\" : true," "\"nullValue\" : null," "\"setValue\":[5,7,8]," "\"structValue\" : { \"n\":3,\"s\":\"sss\"}" "}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.setValue.size(), 3); CXXTOOLS_UNIT_ASSERT(data.setValue.find(5) != data.setValue.end()); CXXTOOLS_UNIT_ASSERT(data.setValue.find(7) != data.setValue.end()); CXXTOOLS_UNIT_ASSERT(data.setValue.find(8) != data.setValue.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(data.structValue.n, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data.structValue.s, "sss"); } void testCommentLine() { TestObject data; std::istringstream in("// \n { //\n" "\"intValue\"//\n: //\n 17 //\n, " "\"stringValue\": //\n\"foo bar\t\"//\n," "\"doubleValue\": \"1000\", " "\"boolValue\" : //\n true," "\"nullValue\" : null" "//\n}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); { int data = 0; std::istringstream in("//\n-4711"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, -4711); } } void testCommentMultiline() { TestObject data; std::istringstream in("/* */ { /* */" "\"intValue\"/* */: /* */ 17 /* */, " "\"stringValue\": /* */\"foo bar\t\"/* */," "\"doubleValue\": \"1000\", " "\"boolValue\" : /* \n */ true," "\"nullValue\" : null" "/* */}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); } void testMultipleObjectsT() { std::vector data; std::istringstream in("[3][4] [5]"); cxxtools::TextIStream tin(in, new cxxtools::Utf8Codec()); tin >> cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 3); tin >> cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 4); tin >> cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 5); } void testMultipleObjectsI() { std::vector data; std::istringstream in("[3][4] [5]"); in >> cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 3); in >> cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 4); in >> cxxtools::Json(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 5); } void testTrailingComma() { std::istringstream in("{ a: 5, b: [ 2,3,], }"); cxxtools::JsonDeserializer deserializer(in); cxxtools::SerializationInfo si; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(si)); int value = 0; si.getMember("a") >>= value; CXXTOOLS_UNIT_ASSERT_EQUALS(value, 5); std::vector data; si.getMember("b") >>= data; CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], 3); } }; cxxtools::unit::RegisterTest register_JsonDeserializerTest; cxxtools-3.0/test/tz-test.cpp0000664000175000017500000000645113644433072013273 00000000000000#include #include #include class TzTest : public cxxtools::unit::TestSuite { public: TzTest() : cxxtools::unit::TestSuite("tz") { registerMethod("local2utc", *this, &TzTest::local2utc); registerMethod("local2utcNonUnique", *this, &TzTest::local2utcNonUnique); registerMethod("utc2local", *this, &TzTest::utc2local); registerMethod("offset", *this, &TzTest::offset); registerMethod("isDst", *this, &TzTest::isDst); registerMethod("ownTz", *this, &TzTest::ownTz); } void local2utc(); void local2utcNonUnique(); void utc2local(); void offset(); void isDst(); void ownTz(); }; void TzTest::local2utc() { { cxxtools::Tz tz("Europe/Berlin"); cxxtools::LocalDateTime lt(2018, 11, 7, 13, 0, 5); cxxtools::UtcDateTime ut = tz.toUtc(lt); CXXTOOLS_UNIT_ASSERT_EQUALS(ut.toString(), cxxtools::UtcDateTime(2018, 11, 7, 12, 0, 5).toString()); } { cxxtools::Tz tz("Pacific/Samoa"); cxxtools::LocalDateTime lt(2018, 11, 7, 13, 0, 5); cxxtools::UtcDateTime ut = tz.toUtc(lt); CXXTOOLS_UNIT_ASSERT_EQUALS(ut.toString(), cxxtools::UtcDateTime(2018, 11, 8, 0, 0, 5).toString()); } } void TzTest::local2utcNonUnique() { cxxtools::Tz tz("Europe/Berlin"); cxxtools::LocalDateTime lt(2018, 10, 28, 2, 30, 6); CXXTOOLS_UNIT_ASSERT_THROW(tz.toUtc(lt), cxxtools::TzAmbiguousLocalTime); CXXTOOLS_UNIT_ASSERT_NOTHROW(tz.toUtc(lt, true)); CXXTOOLS_UNIT_ASSERT_NOTHROW(tz.toUtc(lt, false)); CXXTOOLS_UNIT_ASSERT_EQUALS(tz.toUtc(lt, true).toString(), "2018-10-28 00:30:06"); CXXTOOLS_UNIT_ASSERT_EQUALS(tz.toUtc(lt, false).toString(), "2018-10-28 01:30:06"); } void TzTest::utc2local() { { cxxtools::Tz tz("Europe/Berlin"); cxxtools::UtcDateTime ut(2018, 11, 7, 13, 0, 5); cxxtools::LocalDateTime lt = tz.toLocal(ut); CXXTOOLS_UNIT_ASSERT_EQUALS(lt.toString(), cxxtools::LocalDateTime(2018, 11, 7, 14, 0, 5).toString()); } { cxxtools::Tz tz("Pacific/Samoa"); cxxtools::UtcDateTime ut(2018, 11, 7, 13, 10, 5); cxxtools::LocalDateTime lt = tz.toLocal(ut); CXXTOOLS_UNIT_ASSERT_EQUALS(lt.toString(), cxxtools::LocalDateTime(2018, 11, 7, 2, 10, 5).toString()); } } void TzTest::offset() { cxxtools::Tz tz("Europe/Berlin"); cxxtools::Hours offset = tz.offset(cxxtools::UtcDateTime(2018, 11, 7, 13, 0, 6)); CXXTOOLS_UNIT_ASSERT_EQUALS(offset, cxxtools::Hours(1)); } void TzTest::isDst() { cxxtools::Tz tz("Europe/Berlin"); bool dst = tz.toLocal(cxxtools::UtcDateTime(2018, 11, 7, 13, 0, 4)).isdst(); CXXTOOLS_UNIT_ASSERT(!dst); dst = tz.toLocal(cxxtools::UtcDateTime(2018, 8, 7, 13, 0, 4)).isdst(); CXXTOOLS_UNIT_ASSERT(dst); } void TzTest::ownTz() { cxxtools::Tz tz; // we assume, that reading the current time does not take more that 1 second cxxtools::DateTime local = cxxtools::DateTime::localtime(); cxxtools::LocalDateTime lt = tz.toLocal(cxxtools::UtcDateTime(cxxtools::DateTime::gmtime())); cxxtools::Seconds diff = lt - local; CXXTOOLS_UNIT_ASSERT(diff >= cxxtools::Seconds(0) && diff <= cxxtools::Seconds(1)); } cxxtools::unit::RegisterTest register_TzTest; cxxtools-3.0/test/rpcbenchclient.cpp0000664000175000017500000002106013644433072014635 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "color.h" class BenchClient { void exec(); cxxtools::RemoteClient* client; cxxtools::AttachedThread thread; static unsigned _numRequests; static cxxtools::DateTime _until; static unsigned _vectorSize; static unsigned _objectsSize; static std::atomic _requestsStarted; static std::atomic _requestsFinished; static std::atomic _requestsFailed; public: explicit BenchClient(cxxtools::RemoteClient* client_) : client(client_), thread(cxxtools::callable(*this, &BenchClient::exec)) { } ~BenchClient() { delete client; } static unsigned numRequests() { return _numRequests; } static void numRequests(unsigned n) { _numRequests = n; } static cxxtools::DateTime until() { return _until; } static void until(cxxtools::DateTime n) { _until = n; } static unsigned vectorSize() { return _vectorSize; } static void vectorSize(unsigned n) { _vectorSize = n; } static unsigned objectsSize() { return _objectsSize; } static void objectsSize(unsigned n) { _objectsSize = n; } static unsigned requestsStarted() { return _requestsStarted; } static unsigned requestsFinished() { return _requestsFinished; } static unsigned requestsFailed() { return _requestsFailed; } void start() { thread.start(); } void join() { thread.join(); } }; std::atomic BenchClient::_requestsStarted(0); std::atomic BenchClient::_requestsFinished(0); std::atomic BenchClient::_requestsFailed(0); unsigned BenchClient::_numRequests = 0; cxxtools::DateTime BenchClient::_until(2999, 12, 31, 23, 59, 59, 999); unsigned BenchClient::_vectorSize = 0; unsigned BenchClient::_objectsSize = 0; typedef std::vector BenchClients; static cxxtools::Mutex mutex; void BenchClient::exec() { cxxtools::RemoteProcedure echo(*client, "echo"); cxxtools::RemoteProcedure, int, int> seq(*client, "seq"); cxxtools::RemoteProcedure, unsigned> objects(*client, "objects"); while (_requestsStarted <= _numRequests && cxxtools::DateTime::gmtime() < _until) { try { if (_vectorSize > 0) { std::vector ret = seq(1, _vectorSize); ++_requestsFinished; if (ret.size() != _vectorSize) { std::cerr << "wrong response result size " << ret.size() << std::endl; ++_requestsFailed; } } else if (_objectsSize > 0) { std::vector ret = objects(_objectsSize); ++_requestsFinished; if (ret.size() != _objectsSize) { std::cerr << "wrong response result size " << ret.size() << std::endl; ++_requestsFailed; } } else { std::string ret = echo("hi"); ++_requestsFinished; if (ret != "hi") { std::cerr << "wrong response result \"" << ret << '"' << std::endl; ++_requestsFailed; } } } catch (const std::exception& e) { { cxxtools::MutexLock lock(mutex); std::cerr << "request failed with error message \"" << e.what() << '"' << std::endl; } ++_requestsFailed; } } } int main(int argc, char* argv[]) { try { log_init("rpcbenchclient.properties"); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg threads(argc, argv, 't', 4); cxxtools::Arg xmlrpc(argc, argv, 'x'); cxxtools::Arg binary(argc, argv, 'b'); cxxtools::Arg json(argc, argv, 'j'); cxxtools::Arg jsonhttp(argc, argv, 'J'); cxxtools::Arg port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); cxxtools::Arg ssl(argc, argv, 's'); cxxtools::Arg maxtime(argc, argv, 'T'); BenchClient::numRequests(cxxtools::Arg(argc, argv, 'n', 10000)); BenchClient::vectorSize(cxxtools::Arg(argc, argv, 'v', 0)); BenchClient::objectsSize(cxxtools::Arg(argc, argv, 'o', 0)); if (maxtime.isSet()) BenchClient::until(cxxtools::DateTime::gmtime() + maxtime); if (!xmlrpc && !binary && !json && !jsonhttp) { std::cerr << "usage: " << argv[0] << " [options]\n" "options:\n" " -l ip set ip address of server (default: localhost)\n" " -p number set port number of server (default: 7002 for http, 7003 for binary and 7004 for json)\n" " -x use xmlrpc protocol\n" " -b use binary rpc protocol\n" " -j use json rpc protocol\n" " -J use json rpc over http protocol\n" " -s enable ssl\n" " -t number set number of threads (default: 4)\n" " -n number set number of requests (default: 10000)\n" " -T seconds set maximum runtime after which the test stops\n" " -v number test int vector with of elements\n" " -o number test vector of objects\n" "one protocol must be selected\n" << std::endl; return -1; } BenchClients clients; while (clients.size() < threads) { cxxtools::RemoteClient* client; if (binary) { cxxtools::bin::RpcClient* c = new cxxtools::bin::RpcClient(ip, port, ssl); client = c; } else if (json) { cxxtools::json::RpcClient* c = new cxxtools::json::RpcClient(ip, port, ssl); client = c; } else if (jsonhttp) { cxxtools::json::HttpClient* c = new cxxtools::json::HttpClient(ip, port, "/jsonrpc", ssl); client = c; } else // if (xmlrpc) { cxxtools::xmlrpc::HttpClient* c = new cxxtools::xmlrpc::HttpClient(ip, port, "/xmlrpc", ssl); client = c; } clients.push_back(new BenchClient(client)); } cxxtools::Clock cl; cl.start(); for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) (*it)->start(); for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) (*it)->join(); cxxtools::Timespan t = cl.stop(); std::cout << BenchClient::requestsStarted() << " requests in " << t.totalMSecs()/1e3 << " s => " << (BenchClient::requestsStarted() / (t.totalMSecs()/1e3)) << "#/s\n" << BenchClient::requestsFinished() << " finished " << BenchClient::requestsFailed() << " failed" << std::endl; for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) delete *it; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/test/lrucache-test.cpp0000664000175000017500000001117213644433072014420 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/lrucache.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class LruCacheTest : public cxxtools::unit::TestSuite { public: LruCacheTest() : cxxtools::unit::TestSuite("lrucache") { registerMethod("cacheTest", *this, &LruCacheTest::cacheTest); registerMethod("erase", *this, &LruCacheTest::erase); registerMethod("resize", *this, &LruCacheTest::resize); registerMethod("stats", *this, &LruCacheTest::stats); } void cacheTest() { cxxtools::LruCache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); std::pair result; result = cache.getx(1); CXXTOOLS_UNIT_ASSERT(!result.first); result = cache.getx(8); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 80); } void erase() { cxxtools::LruCache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.erase(2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.erase(9); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 5); } void resize() { cxxtools::LruCache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); } void stats() { cxxtools::LruCache cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.getx(1); cache.getx(2); cache.getx(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getHits(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getMisses(), 1); } }; cxxtools::unit::RegisterTest register_LruCacheTest; cxxtools-3.0/test/logconfiguration-test.cpp0000664000175000017500000002730413644433072016207 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/log.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include #include log_define("cxxtools.test.logconfiguration") class LogconfigurationTest : public cxxtools::unit::TestSuite { public: LogconfigurationTest() : cxxtools::unit::TestSuite("logconfiguration") { registerMethod("logLevelTest", *this, &LogconfigurationTest::logLevelTest); registerMethod("logLevelWithTraceTest", *this, &LogconfigurationTest::logLevelWithTraceTest); registerMethod("logSingleFlagTest", *this, &LogconfigurationTest::logSingleFlagTest); registerMethod("logFlagsTest", *this, &LogconfigurationTest::logFlagsTest); registerMethod("rootLevelTest", *this, &LogconfigurationTest::rootLevelTest); registerMethod("hierachicalTest", *this, &LogconfigurationTest::hierachicalTest); registerMethod("convertLogFlagsTest", *this, &LogconfigurationTest::convertLogFlagsTest); } void logLevelTest(); void logLevelWithTraceTest(); void logSingleFlagTest(); void logFlagsTest(); void rootLevelTest(); void hierachicalTest(); void convertLogFlagsTest(); }; void LogconfigurationTest::logLevelTest() { std::istringstream properties( "rootlogger=WARN\n" "logger.fatal=FATAL\n" "logger.error=ERROR\n" "logger.warn=WARN\n" "logger.info=INFO\n" "logger.debug=DEBUG\n" "logger.fine=FINE\n" "logger.finer=FINER\n" "logger.finest=FINEST\n" "logger.trace=TRACE\n"); cxxtools::LogConfiguration config; properties >> cxxtools::Properties(config); cxxtools::Logger rootLogger("", config.rootFlags()); CXXTOOLS_UNIT_ASSERT(rootLogger.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(rootLogger.isEnabled(cxxtools::Logger::LOG_ERROR)); CXXTOOLS_UNIT_ASSERT(!rootLogger.isEnabled(cxxtools::Logger::LOG_INFO)); cxxtools::Logger fatalLogger("fatal", config.logFlags("fatal")); CXXTOOLS_UNIT_ASSERT(fatalLogger.isEnabled(cxxtools::Logger::LOG_FATAL)); CXXTOOLS_UNIT_ASSERT(!fatalLogger.isEnabled(cxxtools::Logger::LOG_ERROR)); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("fatal"), 0x01); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("error"), 0x03); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("warn"), 0x07); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("info"), 0x0f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("debug"), 0x1f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("fine"), 0x1f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("finer"), 0x3f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("finest"), 0x7f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("trace"), 0x9f); } void LogconfigurationTest::logLevelWithTraceTest() { std::istringstream properties( "rootlogger=WARN\n" "logger.fatal=TFATAL\n" "logger.error=TERROR\n" "logger.warn=TWARN\n" "logger.info=TINFO\n" "logger.debug=TDEBUG\n" "logger.fine=TFINE\n" "logger.finer=TFINER\n" "logger.finest=TFINEST\n"); cxxtools::LogConfiguration config; properties >> cxxtools::Properties(config); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("fatal"), 0x81); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("error"), 0x83); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("warn"), 0x87); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("info"), 0x8f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("debug"), 0x9f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("fine"), 0x9f); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("finer"), 0xbf); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("finest"), 0xff); } void LogconfigurationTest::logSingleFlagTest() { std::istringstream properties( "rootlogger=WARN\n" "logger.fatal=|FATAL\n" "logger.error=|ERROR\n" "logger.warn=|WARN\n" "logger.info=|INFO\n" "logger.debug=|DEBUG\n" "logger.fine=|FINE\n" "logger.finer=|FINER\n" "logger.finest=|FINEST\n" "logger.trace=|TRACE\n"); cxxtools::LogConfiguration config; properties >> cxxtools::Properties(config); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("fatal"), cxxtools::Logger::LOG_FATAL); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("error"), cxxtools::Logger::LOG_ERROR); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("warn"), cxxtools::Logger::LOG_WARN); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("info"), cxxtools::Logger::LOG_INFO); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("debug"), cxxtools::Logger::LOG_DEBUG); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("fine"), cxxtools::Logger::LOG_FINE); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("finer"), cxxtools::Logger::LOG_FINER); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("finest"), cxxtools::Logger::LOG_FINEST); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("trace"), cxxtools::Logger::LOG_TRACE); } void LogconfigurationTest::logFlagsTest() { std::istringstream properties( "rootlogger=WARN\n" "logger.cat1=WARN|INFO\n" "logger.cat2=TRACE|D\n" "logger.cat3=I|T\n"); cxxtools::LogConfiguration config; properties >> cxxtools::Properties(config); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("cat1"), cxxtools::Logger::LOG_WARN | cxxtools::Logger::LOG_INFO); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("cat2"), cxxtools::Logger::LOG_DEBUG | cxxtools::Logger::LOG_TRACE); CXXTOOLS_UNIT_ASSERT_EQUALS(config.logFlags("cat3"), cxxtools::Logger::LOG_INFO | cxxtools::Logger::LOG_TRACE); } void LogconfigurationTest::rootLevelTest() { std::istringstream properties( "rootlogger=WARN\n" "logger.cat1=INFO\n"); cxxtools::LogConfiguration config; properties >> cxxtools::Properties(config); cxxtools::Logger cat1("cat1", config.logFlags("cat1")); cxxtools::Logger cat2("cat2", config.logFlags("cat2")); CXXTOOLS_UNIT_ASSERT(cat1.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(cat1.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!cat1.isEnabled(cxxtools::Logger::LOG_DEBUG)); CXXTOOLS_UNIT_ASSERT(cat2.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(!cat2.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!cat2.isEnabled(cxxtools::Logger::LOG_DEBUG)); } void LogconfigurationTest::hierachicalTest() { std::istringstream properties( "rootlogger=WARN\n" "logger.cat1=INFO\n" "logger.cat1.sub1=ERROR\n" "logger.cat2.sub3=|INFO\n"); cxxtools::LogConfiguration config; properties >> cxxtools::Properties(config); cxxtools::Logger cat1("cat1", config.logFlags("cat1")); cxxtools::Logger cat2("cat2", config.logFlags("cat2")); cxxtools::Logger sub1("sub1", config.logFlags("cat1.sub1")); cxxtools::Logger sub2("sub2", config.logFlags("cat1.sub2")); cxxtools::Logger sub3("sub3", config.logFlags("cat2.sub3")); CXXTOOLS_UNIT_ASSERT(cat1.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(cat1.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!cat1.isEnabled(cxxtools::Logger::LOG_DEBUG)); CXXTOOLS_UNIT_ASSERT(cat2.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(!cat2.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!cat2.isEnabled(cxxtools::Logger::LOG_DEBUG)); CXXTOOLS_UNIT_ASSERT(!sub1.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(!sub1.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!sub1.isEnabled(cxxtools::Logger::LOG_DEBUG)); CXXTOOLS_UNIT_ASSERT(sub2.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(sub2.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!sub2.isEnabled(cxxtools::Logger::LOG_DEBUG)); CXXTOOLS_UNIT_ASSERT(!sub3.isEnabled(cxxtools::Logger::LOG_WARN)); CXXTOOLS_UNIT_ASSERT(sub3.isEnabled(cxxtools::Logger::LOG_INFO)); CXXTOOLS_UNIT_ASSERT(!sub3.isEnabled(cxxtools::Logger::LOG_DEBUG)); } void LogconfigurationTest::convertLogFlagsTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|FATAL"), 0x01); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("FATAL"), 0x01); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("TFATAL"), 0x81); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("F"), 0x01); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("TF"), 0x81); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|ERROR"), 0x02); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("ERROR"), 0x03); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("TERROR"), 0x83); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("E"), 0x03); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("ERROR|FATAL"), 0x03); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|WARN"), 0x04); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("ERROR|WARN"), 0x06); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("WARN"), 0x07); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("W"), 0x07); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|INFO"), 0x08); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("INFO"), 0x0f); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|DEBUG"), 0x10); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("DEBUG"), 0x1f); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("D"), 0x1f); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("D|I"), 0x18); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|FINE"), 0x10); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("FINE"), 0x1f); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|FINER"), 0x20); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("FINER"), 0x3f); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|FINEST"), 0x40); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("FINEST"), 0x7f); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("|TRACE"), 0x80); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::LogConfiguration::strToLogFlags("TRACE"), 0x9f); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::LogConfiguration::strToLogFlags("blah"), std::runtime_error); } cxxtools::unit::RegisterTest register_LogconfigurationTest; cxxtools-3.0/test/limitstream-test.cpp0000664000175000017500000000573413644433072015173 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/limitstream.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include class LimitStreamTest : public cxxtools::unit::TestSuite { public: LimitStreamTest() : cxxtools::unit::TestSuite("limitstream") { registerMethod("testIStream", *this, &LimitStreamTest::testIStream); registerMethod("testOStream", *this, &LimitStreamTest::testOStream); } void testIStream() { std::istringstream is("foobar"); cxxtools::LimitIStream lis(is, 3); std::string s; lis >> s; CXXTOOLS_UNIT_ASSERT(lis.eof()); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "foo"); lis.icount(5); lis.clear(); lis >> s; CXXTOOLS_UNIT_ASSERT(lis.eof()); CXXTOOLS_UNIT_ASSERT_EQUALS(lis.icount(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "bar"); } void testOStream() { std::ostringstream os; cxxtools::LimitOStream los(os, 3); los << "foobar"; CXXTOOLS_UNIT_ASSERT_EQUALS(os.str(), "foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(los.ocount(), 0); los.ocount(5); los.clear(); los << "bar"; CXXTOOLS_UNIT_ASSERT_EQUALS(os.str(), "foobar"); CXXTOOLS_UNIT_ASSERT_EQUALS(los.ocount(), 2); los << "baz"; CXXTOOLS_UNIT_ASSERT_EQUALS(os.str(), "foobarba"); CXXTOOLS_UNIT_ASSERT_EQUALS(los.ocount(), 0); } }; cxxtools::unit::RegisterTest register_LimitStreamTest; cxxtools-3.0/test/utf8-test.cpp0000664000175000017500000002106613657752564013541 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/utf8codec.h" #include "cxxtools/utf8.h" #include "cxxtools/textstream.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" #include #include #define SIZEOF(a) (sizeof(a) / sizeof(a[0])) class Utf8Test : public cxxtools::unit::TestSuite { public: Utf8Test() : cxxtools::unit::TestSuite("utf8") { registerMethod("encode", *this, &Utf8Test::encodeTest); registerMethod("decode", *this, &Utf8Test::decodeTest); registerMethod("byteordermark", *this, &Utf8Test::byteordermarkTest); registerMethod("incompleteBom", *this, &Utf8Test::incompleteBomTest); registerMethod("partialBom", *this, &Utf8Test::partialBomTest); registerMethod("consumeInput", *this, &Utf8Test::consumeInput); registerMethod("fillOutput", *this, &Utf8Test::fillOutput); registerMethod("partialDecode", *this, &Utf8Test::partialDecode); registerMethod("istream", *this, &Utf8Test::istream); registerMethod("ostream", *this, &Utf8Test::ostream); } void encodeTest() { cxxtools::String ustr(L"Hi \xe4 there"); std::string bstr = cxxtools::Utf8Codec::encode(ustr); CXXTOOLS_UNIT_ASSERT_EQUALS(bstr, "Hi \xc3\xa4 there"); std::string bstr2 = cxxtools::Utf8(ustr); CXXTOOLS_UNIT_ASSERT_EQUALS(bstr2, "Hi \xc3\xa4 there"); } void decodeTest() { std::string bstr("Hi \xc3\xa4 there"); cxxtools::String ustr = cxxtools::Utf8Codec::decode(bstr); CXXTOOLS_UNIT_ASSERT(ustr == L"Hi \xe4 there"); } void byteordermarkTest() { std::string bstr("\xef\xbb\xbfHi \xc3\xa4 there"); cxxtools::String ustr = cxxtools::Utf8Codec::decode(bstr); CXXTOOLS_UNIT_ASSERT(ustr == L"Hi \xe4 there"); } void incompleteBomTest() { std::string bstr("\xef\xbb"); cxxtools::String ustr = cxxtools::Utf8Codec::decode(bstr); CXXTOOLS_UNIT_ASSERT(ustr.empty()); } void partialBomTest() { // check whether codec is able to partially consume byte order mark cxxtools::Utf8Codec codec; const char data[] = { '\xef', '\xbb', '\xbf', 'A' }; cxxtools::Char to[10]; const char* fromBegin = data; const char* fromNext = data; cxxtools::Char* toNext = to; cxxtools::MBState mbstate; // consume first char codec.in(mbstate, fromBegin, fromBegin + 1, fromNext, to, to + 10, toNext); CXXTOOLS_UNIT_ASSERT(fromNext > fromBegin); // codec must consume char CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - to, 0); // no output yet fromBegin = fromNext; codec.in(mbstate, fromBegin, fromBegin + 1, fromNext, to, to + 10, toNext); CXXTOOLS_UNIT_ASSERT(fromNext > fromBegin); // codec must consume another char CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - to, 0); // no output yet fromBegin = fromNext; codec.in(mbstate, fromBegin, fromBegin + 2, fromNext, to, to + 10, toNext); CXXTOOLS_UNIT_ASSERT(fromNext > fromBegin); // codec must consume the third and forth char CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - to, 1); // now output CXXTOOLS_UNIT_ASSERT_EQUALS(to[0].narrow(), 'A'); // now output } void consumeInput() { const char utf8Input[] = "Hello \xc3\xa4\xe2\x80\x93 end"; cxxtools::Char unicodeOutput[32]; cxxtools::Utf8Codec codec; cxxtools::MBState mbstate; const char* fromBegin = utf8Input; const char* fromNext = utf8Input; const char* fromEnd = utf8Input + sizeof(utf8Input) - 1; cxxtools::Char* toNext = unicodeOutput; cxxtools::Char* toEnd = unicodeOutput + SIZEOF(unicodeOutput); codec.in(mbstate, fromBegin, fromEnd, fromNext, unicodeOutput, toEnd, toNext); // is input completely consumed CXXTOOLS_UNIT_ASSERT_EQUALS(fromNext, fromBegin + sizeof(utf8Input) - 1); // is output completely converted CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - unicodeOutput, 12); // check some values CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[4].value(), 0x6f); CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[6].value(), 0xe4); CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[7].value(), 0x2013); } void fillOutput() { const char utf8Input[] = "Hello \xc3\xa4\xe2\x80\x93 end"; cxxtools::Char unicodeOutput[8]; cxxtools::Utf8Codec codec; cxxtools::MBState mbstate; const char* fromBegin = utf8Input; const char* fromNext = utf8Input; const char* fromEnd = utf8Input + sizeof(utf8Input) - 1; cxxtools::Char* toNext = unicodeOutput; cxxtools::Char* toEnd = unicodeOutput + SIZEOF(unicodeOutput); codec.in(mbstate, fromBegin, fromEnd, fromNext, unicodeOutput, toEnd, toNext); // is output filled CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - unicodeOutput, 8); // check some values CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[4].value(), 0x6f); CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[6].value(), 0xe4); // continue fromBegin = fromNext; toNext = unicodeOutput; codec.in(mbstate, fromBegin, fromEnd, fromNext, unicodeOutput, unicodeOutput + SIZEOF(unicodeOutput), toNext); // got the rest? CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - unicodeOutput, 4); // input consumed? CXXTOOLS_UNIT_ASSERT_EQUALS(fromNext, fromEnd); } void partialDecode() { const char utf8Input[] = "Hello \xc3\xa4\xe2\x80\x93 end"; cxxtools::Char unicodeOutput[32]; cxxtools::Utf8Codec codec; cxxtools::MBState mbstate; const char* fromBegin = utf8Input; const char* fromNext = utf8Input; const char* fromEnd = utf8Input + sizeof(utf8Input) - 1; cxxtools::Char* toNext = unicodeOutput; cxxtools::Char* toEnd = unicodeOutput + SIZEOF(unicodeOutput); cxxtools::Utf8Codec::result result = codec.in(mbstate, fromBegin, fromBegin + 7, fromNext, unicodeOutput, toEnd, toNext); CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::codecvt_base::partial); result = codec.in(mbstate, fromNext, fromEnd, fromNext, toNext, toEnd, toNext); CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::codecvt_base::ok); CXXTOOLS_UNIT_ASSERT_EQUALS(fromNext, fromEnd); CXXTOOLS_UNIT_ASSERT_EQUALS(toNext - unicodeOutput, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[4].value(), 0x6f); CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[6].value(), 0xe4); CXXTOOLS_UNIT_ASSERT_EQUALS(unicodeOutput[7].value(), 0x2013); } void istream() { std::istringstream in("Hello \xc3\xa4\xe2\x80\x93 end"); cxxtools::TextIStream tin(in, new cxxtools::Utf8Codec()); cxxtools::String s; std::getline(tin, s); CXXTOOLS_UNIT_ASSERT_EQUALS(s.size(), 12); CXXTOOLS_UNIT_ASSERT_EQUALS(s[4].value(), 0x6f); CXXTOOLS_UNIT_ASSERT_EQUALS(s[6].value(), 0xe4); CXXTOOLS_UNIT_ASSERT_EQUALS(s[7].value(), 0x2013); } void ostream() { std::ostringstream out; cxxtools::TextOStream tout(out, new cxxtools::Utf8Codec()); tout << L"Hello \x00e4\x2013 end" << std::flush; std::string s = out.str(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.size(), 15); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "Hello \xc3\xa4\xe2\x80\x93 end"); } }; cxxtools::unit::RegisterTest register_Utf8Test; cxxtools-3.0/test/xmlreader-test.cpp0000664000175000017500000002214413644433072014616 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "cxxtools/xml/xmlreader.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/entityresolver.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class XmlReaderTest : public cxxtools::unit::TestSuite { public: XmlReaderTest() : cxxtools::unit::TestSuite("xmlreader") { registerMethod("XmlReadXml", *this, &XmlReaderTest::XmlReadXml); registerMethod("XmlReadNsXml", *this, &XmlReaderTest::XmlReadNsXml); registerMethod("XmlReadEmptyXml", *this, &XmlReaderTest::XmlReadEmptyXml); registerMethod("XmlReadAttributes", *this, &XmlReaderTest::XmlReadAttributes); registerMethod("XmlReadAttributesFromEmptyXml", *this, &XmlReaderTest::XmlReadAttributesFromEmptyXml); registerMethod("XmlEntity", *this, &XmlReaderTest::XmlEntity); registerMethod("ReverseEntity", *this, &XmlReaderTest::ReverseEntity); registerMethod("AllEntities", *this, &XmlReaderTest::AllEntities); } void setUp() { } void tearDown() { } void XmlReadXml() { std::istringstream in( "" ""); cxxtools::xml::XmlReader xr(in); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentVersion().narrow(), "1.0"); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentEncoding().narrow(), "UTF-8"); cxxtools::xml::StartElement root = xr.nextElement(); cxxtools::xml::StartElement foo = xr.nextElement(); CXXTOOLS_UNIT_ASSERT_EQUALS(root.name().narrow(), "root"); CXXTOOLS_UNIT_ASSERT_EQUALS(foo.name().narrow(), "foo"); } void XmlReadNsXml() { std::istringstream in( "\n" "\n" "\n" "\n" ""); cxxtools::xml::XmlReader xr(in); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentVersion().narrow(), "1.0"); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentEncoding().narrow(), "UTF-8"); cxxtools::xml::StartElement root = xr.nextElement(); cxxtools::xml::StartElement foo = xr.nextElement(); CXXTOOLS_UNIT_ASSERT_EQUALS(root.name().narrow(), "ns:root"); CXXTOOLS_UNIT_ASSERT_EQUALS(foo.name().narrow(), "b:foo"); const cxxtools::xml::Node& endFoo = xr.nextTag(); CXXTOOLS_UNIT_ASSERT_EQUALS(endFoo.type(), cxxtools::xml::Node::EndElement); const cxxtools::xml::Node& endRoot = xr.nextTag(); CXXTOOLS_UNIT_ASSERT_EQUALS(endRoot.type(), cxxtools::xml::Node::EndElement); } void XmlReadEmptyXml() { std::istringstream in( "" ""); cxxtools::xml::XmlReader xr(in); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentVersion().narrow(), "1.0"); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentEncoding().narrow(), "UTF-8"); cxxtools::xml::StartElement root = xr.nextElement(); CXXTOOLS_UNIT_ASSERT_EQUALS(root.name().narrow(), "root"); } void XmlReadAttributes() { std::istringstream in( "" ""); cxxtools::xml::XmlReader xr(in); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentVersion().narrow(), "1.0"); CXXTOOLS_UNIT_ASSERT_EQUALS(xr.documentEncoding().narrow(), "UTF-8"); cxxtools::xml::StartElement root = xr.nextElement(); cxxtools::xml::StartElement foo = xr.nextElement(); CXXTOOLS_UNIT_ASSERT_EQUALS(root.attributes().size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(root.attribute(L"attr1").narrow(), "one"); CXXTOOLS_UNIT_ASSERT_EQUALS(root.attribute(L"attr2").narrow(), "two"); CXXTOOLS_UNIT_ASSERT_EQUALS(foo.attributes().size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(foo.attribute(L"fooattr").narrow(), "bar"); } void XmlReadAttributesFromEmptyXml() { std::istringstream in( ""); cxxtools::xml::XmlReader xr(in); cxxtools::xml::StartElement root = xr.nextElement(); CXXTOOLS_UNIT_ASSERT_EQUALS(root.attributes().size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(root.attribute(L"attr1").narrow(), "one"); CXXTOOLS_UNIT_ASSERT_EQUALS(root.attribute(L"attr2").narrow(), "two"); } void XmlEntity() { cxxtools::xml::EntityResolver resolver; cxxtools::String r; r = resolver.resolveEntity(cxxtools::String(L"auml")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0xE4))); r = resolver.resolveEntity(cxxtools::String(L"Ouml")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0xD6))); r = resolver.resolveEntity(cxxtools::String(L"AElig")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0xC6))); r = resolver.resolveEntity(cxxtools::String(L"zwnj")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0x200C))); r = resolver.resolveEntity(cxxtools::String(L"#x200C")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0x200C))); r = resolver.resolveEntity(cxxtools::String(L"#1234")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(1234))); CXXTOOLS_UNIT_ASSERT_THROW(resolver.resolveEntity(cxxtools::String(L"zwnjj")), std::exception); CXXTOOLS_UNIT_ASSERT_THROW(resolver.resolveEntity(cxxtools::String(L"AEli")), std::exception); } void ReverseEntity() { cxxtools::xml::EntityResolver resolver; cxxtools::String r; r = resolver.getEntity(cxxtools::Char(L'&')); CXXTOOLS_UNIT_ASSERT_MSG(r == cxxtools::String(L"&"), "failed to get entity for character '&'; expected \"&\" returned \"" << r.narrow() << '"'); r = resolver.getEntity(cxxtools::Char(0x0022)); CXXTOOLS_UNIT_ASSERT_MSG(r == cxxtools::String(L"""), "failed to get entity for character code 0x0022; expected \""\" returned \"" << r.narrow() << '"'); r = resolver.getEntity(cxxtools::Char(1234)); CXXTOOLS_UNIT_ASSERT_MSG(r == cxxtools::String(L"Ӓ"), "failed to get entity for character code 1234; expected \"Ӓ\" returned \"" << r.narrow() << '"'); } void AllEntities() { cxxtools::xml::EntityResolver resolver; for (cxxtools::Char::value_type n = 0; n <= 0xFFFF; ++n) { cxxtools::String r = resolver.getEntity(cxxtools::Char(n)); if (r.size() > 2 && r[0] == '&' && r[r.size() - 1] == ';') { cxxtools::String rr = resolver.resolveEntity(r.substr(1, r.size() - 2)); CXXTOOLS_UNIT_ASSERT_MSG( rr == cxxtools::String(1, cxxtools::Char(n)), "resolving char code " << n << " failed; entity \"" << r.narrow() << '"'); } else { CXXTOOLS_UNIT_ASSERT_MSG(r[0] == cxxtools::Char(n), "resolving char code " << n << " failed"); } } } }; cxxtools::unit::RegisterTest register_XmlReaderTest; cxxtools-3.0/test/smartptr-test.cpp0000664000175000017500000001167313644433072014514 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/smartptr.h" #include "cxxtools/refcounted.h" #include "cxxtools/unit/assertion.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class Object : public cxxtools::RefCounted { public: Object() { ++objectRefs; } ~Object() { --objectRefs; } static std::size_t objectRefs; }; std::size_t Object::objectRefs = 0; class AtomicObject : public cxxtools::AtomicRefCounted { public: AtomicObject() { ++objectRefs; } ~AtomicObject() { --objectRefs; } static std::size_t objectRefs; }; std::size_t AtomicObject::objectRefs = 0; class SmartPtrTest : public cxxtools::unit::TestSuite { public: SmartPtrTest() : cxxtools::unit::TestSuite( "SmartPtr" ) { registerMethod( "RefCounted", *this, &SmartPtrTest::RefCounted ); registerMethod( "InternalRefCounted", *this, &SmartPtrTest::InternalRefCounted ); registerMethod( "AtomicInternalRefCounted", *this, &SmartPtrTest::AtomicInternalRefCounted ); registerMethod( "RefLinked", *this, &SmartPtrTest::RefLinked ); } public: void setUp(); protected: void RefCounted(); void InternalRefCounted(); void AtomicInternalRefCounted(); void RefLinked(); }; cxxtools::unit::RegisterTest register_SmartPtrTest; void SmartPtrTest::setUp() { Object::objectRefs = 0; AtomicObject::objectRefs = 0; } void SmartPtrTest::RefCounted() { Object* obj = new Object(); typedef cxxtools::SmartPtr Ptr; { Ptr smartPtr(obj); CXXTOOLS_UNIT_ASSERT_EQUALS( smartPtr.refs(), 1 ); Ptr second(smartPtr); CXXTOOLS_UNIT_ASSERT_EQUALS( second.refs(), 2); Ptr third; third = second; CXXTOOLS_UNIT_ASSERT_EQUALS( third.refs(), 3); third = third; CXXTOOLS_UNIT_ASSERT_EQUALS( third.refs(), 3); } CXXTOOLS_UNIT_ASSERT_EQUALS(Object::objectRefs, 0); } void SmartPtrTest::InternalRefCounted() { Object* obj = new Object(); typedef cxxtools::SmartPtr Ptr; { Ptr smartPtr(obj); CXXTOOLS_UNIT_ASSERT_EQUALS( smartPtr->refs(), 1 ); Ptr second(smartPtr); CXXTOOLS_UNIT_ASSERT_EQUALS( second->refs(), 2); Ptr third; third = second; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); third = third; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); } CXXTOOLS_UNIT_ASSERT_EQUALS(Object::objectRefs, 0); } void SmartPtrTest::AtomicInternalRefCounted() { AtomicObject* obj = new AtomicObject(); typedef cxxtools::SmartPtr Ptr; { Ptr smartPtr(obj); CXXTOOLS_UNIT_ASSERT_EQUALS( smartPtr->refs(), 1 ); Ptr second(smartPtr); CXXTOOLS_UNIT_ASSERT_EQUALS( second->refs(), 2); Ptr third; third = second; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); third = third; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); } CXXTOOLS_UNIT_ASSERT_EQUALS(AtomicObject::objectRefs, 0); } void SmartPtrTest::RefLinked() { Object* obj = new Object(); typedef cxxtools::SmartPtr Ptr; { Ptr smartPtr(obj); Ptr second(smartPtr); Ptr third; Ptr fourth(third); third = second; } CXXTOOLS_UNIT_ASSERT(Object::objectRefs == 0); } cxxtools-3.0/test/date-test.cpp0000664000175000017500000001550213644433072013550 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/date.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class DateTest : public cxxtools::unit::TestSuite { public: DateTest() : cxxtools::unit::TestSuite("date") { registerMethod("fromString", *this, &DateTest::fromString); registerMethod("fromStringMonthname", *this, &DateTest::fromStringMonthname); registerMethod("fixDigit", *this, &DateTest::fixDigit); registerMethod("toString", *this, &DateTest::toString); registerMethod("names", *this, &DateTest::names); registerMethod("serialization", *this, &DateTest::serialization); registerMethod("isValid", *this, &DateTest::isValid); } void fromString() { int year; unsigned month, day; cxxtools::Date dt; dt = cxxtools::Date("2013-05-03"); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); dt = cxxtools::Date("2013 5 3", "%Y %m %d"); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2013); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 3); dt = cxxtools::Date("20140802", "%Y%m%d"); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2014); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 8); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 2); dt = cxxtools::Date("1975H11#12", "%Y?%m?%d"); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 1975); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 11); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 12); dt = cxxtools::Date("1893 foobar 10 hi there 30", "%Y*%m*%d"); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 1893); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 10); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 30); } void fromStringMonthname() { int year; unsigned month, day; cxxtools::Date dt; CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::Date("Wed Apr 11 2018", "??? %O %d %Y")); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(year, 2018); CXXTOOLS_UNIT_ASSERT_EQUALS(month, 4); CXXTOOLS_UNIT_ASSERT_EQUALS(day, 11); static const char* monthnames[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; for (unsigned m = 0; m < 12; ++m) { CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::Date(monthnames[m], "%O")); dt.get(year, month, day); CXXTOOLS_UNIT_ASSERT_EQUALS(month, m + 1); } } void fixDigit() { CXXTOOLS_UNIT_ASSERT_NOTHROW(cxxtools::Date("3 9", "%m %d")); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::Date("3 9", "%2m %2d"), cxxtools::InvalidDate); CXXTOOLS_UNIT_ASSERT_NOTHROW(cxxtools::Date("03 09", "%2m %2d")); } void toString() { cxxtools::Date dt(2013, 5, 3); std::string str = dt.toString(); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013-05-03"); str = dt.toString("%Y %m %d"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "2013 05 03"); str = dt.toString("%Y%m%d"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "20130503"); str = dt.toString("%w %W"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "5 5"); dt = cxxtools::Date(2013, 5, 5); str = dt.toString("%w %W"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "0 7"); } void names() { cxxtools::Date dt(2013, 5, 3); std::string str = dt.toString("%O %N"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "May Fri"); dt.set(2013, 6, 2); str = dt.toString("%O %N"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "Jun Sun"); } void serialization() { cxxtools::Date d1(2014, 5, 3); cxxtools::SerializationInfo si; si <<= d1; cxxtools::Date d2; si >>= d2; CXXTOOLS_UNIT_ASSERT(d1 == d2); } void isValid() { CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(1, 1, 1)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(2000, 12, 1)); CXXTOOLS_UNIT_ASSERT(!cxxtools::Date::isValid(2000, 13, 1)); CXXTOOLS_UNIT_ASSERT(!cxxtools::Date::isValid(2000, 0, 1)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(2015, 4, 30)); CXXTOOLS_UNIT_ASSERT(!cxxtools::Date::isValid(2015, 4, 31)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(2015, 5, 31)); CXXTOOLS_UNIT_ASSERT(!cxxtools::Date::isValid(2015, 5, 32)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(2015, 2, 28)); CXXTOOLS_UNIT_ASSERT(!cxxtools::Date::isValid(2015, 2, 29)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(2012, 2, 29)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(2000, 2, 29)); CXXTOOLS_UNIT_ASSERT(cxxtools::Date::isValid(1900, 2, 28)); CXXTOOLS_UNIT_ASSERT(!cxxtools::Date::isValid(1900, 2, 29)); } }; cxxtools::unit::RegisterTest register_DateTest; cxxtools-3.0/test/time-test.cpp0000664000175000017500000002033113644433072013565 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/time.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class TimeTest : public cxxtools::unit::TestSuite { public: TimeTest() : cxxtools::unit::TestSuite("time") { registerMethod("access", *this, &TimeTest::access); registerMethod("diff", *this, &TimeTest::diff); registerMethod("fromString", *this, &TimeTest::fromString); registerMethod("fixDigit", *this, &TimeTest::fixDigit); registerMethod("toString", *this, &TimeTest::toString); registerMethod("serialization", *this, &TimeTest::serialization); registerMethod("getSetTotal", *this, &TimeTest::getSetTotal); } void access() { cxxtools::Time t(17, 1, 14, 300); CXXTOOLS_UNIT_ASSERT_EQUALS(t.hour(), 17); CXXTOOLS_UNIT_ASSERT_EQUALS(t.minute(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(t.second(), 14); CXXTOOLS_UNIT_ASSERT_EQUALS(t.msec(), 300); CXXTOOLS_UNIT_ASSERT_EQUALS(t.usec(), 300000); t.set(19, 55, 49, 345); CXXTOOLS_UNIT_ASSERT_EQUALS(t.hour(), 19); CXXTOOLS_UNIT_ASSERT_EQUALS(t.minute(), 55); CXXTOOLS_UNIT_ASSERT_EQUALS(t.second(), 49); CXXTOOLS_UNIT_ASSERT_EQUALS(t.msec(), 345); CXXTOOLS_UNIT_ASSERT_EQUALS(t.usec(), 345000); } void diff() { cxxtools::Time t1(17, 1, 2, 300); cxxtools::Time t2(16, 4, 5, 600); cxxtools::Timespan diff = t1 - t2; CXXTOOLS_UNIT_ASSERT_EQUALS(diff, cxxtools::Milliseconds(3416700)); diff = t2 - t1; CXXTOOLS_UNIT_ASSERT_EQUALS(diff, cxxtools::Milliseconds(-3416700)); CXXTOOLS_UNIT_ASSERT_THROW(t1 - cxxtools::Hours(18), std::overflow_error); CXXTOOLS_UNIT_ASSERT_THROW(t1 + cxxtools::Hours(8), std::overflow_error); } void fromString() { unsigned hours, minutes, seconds, milliseconds, microseconds; cxxtools::Time dt; CXXTOOLS_UNIT_ASSERT_NOTHROW(dt = cxxtools::Time("17:01:14.3428")); dt.get(hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 342); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 342800); dt = cxxtools::Time("17 1 14.3", "%H %M %S%J"); dt.get(hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 300); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 300000); dt = cxxtools::Time("17 1 14", "%H %M %S%J"); dt.get(hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 0); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); dt = cxxtools::Time("5:01:14 pm", "%H:%M:%S %p"); dt.get(hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 1); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 14); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 0); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); dt = cxxtools::Time("9 13 b 54 xx ", "%H*%M*%S*"); dt.get(hours, minutes, seconds, milliseconds, microseconds); CXXTOOLS_UNIT_ASSERT_EQUALS(hours, 9); CXXTOOLS_UNIT_ASSERT_EQUALS(minutes, 13); CXXTOOLS_UNIT_ASSERT_EQUALS(seconds, 54); CXXTOOLS_UNIT_ASSERT_EQUALS(milliseconds, 0); CXXTOOLS_UNIT_ASSERT_EQUALS(microseconds, 0); } void fixDigit() { CXXTOOLS_UNIT_ASSERT_NOTHROW(cxxtools::Time("6 7 2", "%H %M %S")); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::Time("6 7 2", "%2H %2M %2S"), cxxtools::InvalidTime); CXXTOOLS_UNIT_ASSERT_NOTHROW(cxxtools::Time("06 07 02", "%2H %2M %2S")); } void toString() { cxxtools::Time dt(17, 1, 14, 342, 800); std::string str = dt.toString(); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17:01:14.3428"); str = dt.toString("%H %M %S%J"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14.3428"); dt = cxxtools::Time(17, 1, 14); str = dt.toString("%H %M %S%J"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14.0"); str = dt.toString("%H %M %S%K"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14.000"); str = dt.toString("%H %M %S %k"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14 000"); str = dt.toString("%H %M %S%U"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14.000000"); str = dt.toString("%H %M %S %u"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14 000000"); str = dt.toString("%H %M %S%j"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "17 01 14"); str = dt.toString("%I %M %S%j %p"); CXXTOOLS_UNIT_ASSERT_EQUALS(str, "05 01 14 pm"); } void serialization() { cxxtools::Time t1(17, 1, 14, 765); cxxtools::SerializationInfo si; si <<= t1; cxxtools::Time t2; si >>= t2; CXXTOOLS_UNIT_ASSERT(t1 == t2); } void getSetTotal() { cxxtools::Time t1(23, 5, 17, 123); uint64_t msecs = t1.totalMSecs(); cxxtools::Time t2; t2.setTotalMSecs(msecs); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.hour(), t2.hour()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.minute(), t2.minute()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.second(), t2.second()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.msec(), t2.msec()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.usec(), t2.usec()); CXXTOOLS_UNIT_ASSERT(t1 == t2); t2 = cxxtools::Time(); uint64_t usecs = t1.totalUSecs(); t2.setTotalUSecs(usecs); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.hour(), t2.hour()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.minute(), t2.minute()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.second(), t2.second()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.msec(), t2.msec()); CXXTOOLS_UNIT_ASSERT_EQUALS(t1.usec(), t2.usec()); CXXTOOLS_UNIT_ASSERT(t1 == t2); } }; cxxtools::unit::RegisterTest register_TimeTest; cxxtools-3.0/ChangeLog0000664000175000017500000240706513644433072011760 000000000000002017-02-24 Tommi Mäkitalo * include/cxxtools/serviceregistry.h: add missing includes in service registry 2017-02-22 Tommi Mäkitalo * src/json/rpcclient.cpp: make setting ssl just a little nicer. 2017-02-21 Tommi Mäkitalo * include/cxxtools/bin/rpcserver.h, include/cxxtools/json/rpcserver.h, include/cxxtools/net/uri.h: minor fixes * make constructor of json and binary rpcserver with a event loop explicit * initialize members when cxxtools::net::Uri is default constructed 2017-02-19 Tommi Mäkitalo * src/bin/rpcclient.cpp, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h, src/json/rpcclient.cpp, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: make ssl support optional with configure switch --with-ssl=true|false 2017-02-19 Tommi Mäkitalo * : commit 8a50cb16dfda96763ab047451295a8b17668737c Author: Tommi Mäkitalo Date: Sun Feb 19 11:43:05 2017 +0100 2017-02-18 Tommi Mäkitalo * test/rpcbenchclient.cpp, test/rpcbenchserver.cpp: extend rpc benchmark programs with support for ssl 2017-02-18 Tommi Mäkitalo * demo/rpcechoclient.cpp, demo/rpcserver.cpp, include/cxxtools/bin/rpcclient.h, include/cxxtools/bin/rpcserver.h, include/cxxtools/json/rpcclient.h, src/bin/rpcclient.cpp, src/bin/rpcclientimpl.cpp, src/bin/rpcclientimpl.h, src/bin/rpcserver.cpp, src/bin/rpcserverimpl.cpp, src/bin/rpcserverimpl.h, src/bin/socket.cpp, src/json/rpcclient.cpp, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h, test/binrpc-test.cpp: Binary rpc server and client can use ssl now. I changed the api a bit. The ssl flag is now passed with a separate method in json rpc and binary rpc. Also the domain in binary rpc is moved to a separate method instead of optional parameter to the constructor. 2017-02-18 Tommi Mäkitalo * demo/rpcserver.cpp, include/cxxtools/json/rpcserver.h, src/json/rpcclientimpl.cpp, src/json/rpcserver.cpp, src/json/rpcserverimpl.cpp, src/json/rpcserverimpl.h, src/json/socket.cpp: jsonrpc server and client can use ssl 2017-02-18 Tommi Mäkitalo * demo/rpcserver.cpp, include/cxxtools/http/server.h, src/http/server.cpp, src/http/serverimpl.cpp, src/http/serverimpl.h, src/http/serverimplbase.h: use std::string instead of const char* to pass certificates to http server. 2017-02-18 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/http/serverimpl.h, src/http/socket.cpp, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: Ssl certificates can be loaded and are used. The http client can talk with the server https. This is tested with the demos rpcserver and rpcechoclient. 2017-02-17 Tommi Mäkitalo * demo/rpcechoclient.cpp, demo/rpcserver.cpp: add ssl feature to rpc demos 2017-02-17 Tommi Mäkitalo * include/cxxtools/http/server.h, src/http/server.cpp, src/http/serverimpl.cpp, src/http/serverimpl.h, src/http/serverimplbase.h: Implement loading certificate to http server. The certificate is not used yet so https is not yet ready. 2017-02-15 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: implement methods for loading ssl certificates into a tcp socket 2017-02-13 Tommi Mäkitalo * src/tcpsocketimpl.cpp: fix checking connection in tcp client was broken since extending failure checking 2017-02-13 Tommi Mäkitalo * src/deserializer.cpp, src/timer.cpp: remove 2 unused variables 2017-02-10 Tommi Mäkitalo * include/cxxtools/csvdeserializer.h, include/cxxtools/xmlrpc/client.h, include/cxxtools/xmlrpc/formatter.h, include/cxxtools/xmlrpc/responder.h, include/cxxtools/xmlrpc/scanner.h, include/cxxtools/xmlrpc/service.h, src/csvdeserializer.cpp, src/xmlrpc/client.cpp, src/xmlrpc/formatter.cpp, src/xmlrpc/responder.cpp, src/xmlrpc/scanner.cpp, src/xmlrpc/service.cpp: fix file mode for some all files 2017-02-03 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: fixe syncronous mode of ssl in tcp socket 2017-02-03 Tommi Mäkitalo * include/cxxtools/json/rpcclient.h, src/json/rpcclient.cpp, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h: json rpc client can use ssl 2017-02-03 Tommi Mäkitalo * demo/httpclient.cpp, include/cxxtools/http/client.h, include/cxxtools/json/httpclient.h, include/cxxtools/xmlrpc/httpclient.h, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h, src/json/httpclient.cpp, src/json/httpclientimpl.h, src/xmlrpc/httpclient.cpp, src/xmlrpc/httpclientimpl.h: http clients can use https 2017-02-02 Tommi Mäkitalo * src/tcpsocketimpl.cpp: * set end of file flag correctly in ssl mode of tcpsocket * add some more logging to tcpsocket 2017-02-01 Tommi Mäkitalo * src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: ssl read and write implemented; ssl client mode works now tested against tntnet 2017-02-01 Tommi Mäkitalo * demo/netcat.cpp, src/tcpsocketimpl.cpp: fix ssl connection in blocking mode 2017-02-01 Tommi Mäkitalo * demo/netcat.cpp, src/http/clientimpl.h, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: some fixes in ssl error checking (unfinished) add ssl to netcat demo to test ssl 2017-02-01 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: ssl accept, connect and shutdown are implemented but not yet tested 2017-02-01 Tommi Mäkitalo * configure.ac, src/Makefile.am: add link flag to openssl libraries 2017-01-31 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: continued implementing ssl 2017-01-30 Tommi Mäkitalo * src/tcpsocketimpl.cpp: add ssl error check function 2017-01-30 Tommi Mäkitalo * : commit ea949d77952cde2e3145544419f8318331151626 Author: Tommi Mäkitalo Date: Mon Jan 30 09:37:43 2017 +0100 2017-01-29 Tommi Mäkitalo * configure.ac, include/cxxtools/net/tcpsocket.h, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: continue implementing ssl 2017-01-26 Tommi Mäkitalo * include/cxxtools/net/tcpstream.h, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: more preparation for ssl 2017-01-24 Tommi Mäkitalo * include/cxxtools/query_params.h, test/query_params-test.cpp: Bring back method cxxtools::QueryParams::getNames. The method was lost when the class was simplified. 2017-01-24 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: change ssl interface 2017-01-24 Tommi Mäkitalo * src/jsonparser.cpp: throw right exception type in json parser (JsonParserError instead of SerializationError) 2017-01-24 Tommi Mäkitalo * src/jsonparser.cpp: throw right exception type in json parser (JsonParserError instead of SerializationError) 2017-01-23 Tommi Mäkitalo * include/cxxtools/net/tcpsocket.h, src/iodeviceimpl.cpp, src/iodeviceimpl.h, src/tcpsocket.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: implement interface for ssl (without functionality) 2017-01-20 Tommi Mäkitalo * src/iodeviceimpl.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: Always use send when writing to a network socket. Send has the ability to suppress SIGPIPE when the peer closes the connection. The TcpSocket class may have used write sometimes in which case the program gets a SIGPIPE, which by default stops the process. Also dumping read data from and written data to a socket is now logged with lower severity (FINER). 2017-01-19 Tommi Mäkitalo * demo/Makefile.am, demo/README, demo/saml2.cpp: Add demo for creating xml. 2017-01-19 Tommi Mäkitalo * include/cxxtools/net/tcpstream.h, src/tcpstream.cpp: TcpStream class should use a extendable streambuffer. This is really a must if asyncronous communication is used since writing otherwise may block. 2017-01-19 Tommi Mäkitalo * include/cxxtools/iostream.h, src/iostream.cpp: remove extend flag from cxxtools::IStream since the flag affects only the output buffer. 2017-01-19 Tommi Mäkitalo * src/streambuffer.cpp: Fix extending streambuffer in async mode. Befor replacing the buffer while write operation is pending the write must be finished and restarted after replacement. 2017-01-19 Tommi Mäkitalo * src/jsonformatter.cpp: change logging category for json formatter to match other json objects 2017-01-16 Tommi Mäkitalo * demo/Makefile.am, demo/cgi.cpp: xml changes: remove demo for xmltag also 2017-01-16 Tommi Mäkitalo * src/Makefile.am, src/xmltag.cpp: xml change: forgot to remove xmltag.cpp also 2017-01-16 Tommi Mäkitalo * include/cxxtools/split.h: make cxxtools::split more efficient by avoiding string copies 2017-01-16 Tommi Mäkitalo * include/cxxtools/date.h, src/date.cpp: add some format codes to cxxtools::Date to match cxxtools::DateTime 2017-01-16 Tommi Mäkitalo * include/cxxtools/xml/attribute.h: add support xml date, time and datetime format in xml attributes 2017-01-16 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/xml/xmlwriter.h, include/cxxtools/xmltag.h, src/xml/xmlwriter.cpp: Xml writer changes: * add missing header cxxtools/xml/attribute.h * remove obsolete header cxxtools/xml/xmltag.h * indent attributes in xml when requested indentation 2017-01-16 Tommi Mäkitalo * include/cxxtools/xml/attribute.h, include/cxxtools/xml/startelement.h, include/cxxtools/xml/xmlwriter.h, src/xml/entityresolver.cpp, src/xml/xmlwriter.cpp: Improvements in Xml writer. * Create helper class cxxtools::xml::XmlWriter::Entity which creates a xml node with its constructor and destuctor. * Simplification and optimization in xml entity resolver 2017-01-11 Tommi Mäkitalo * src/tcpsocketimpl.cpp: Fix checking for connection errors in tcpsocket. Check was broken for async mode after improvement of error messages. 2016-12-08 Tommi Mäkitalo * include/cxxtools/remoteprocedure.h, utils/remoteprocedure.pl: last commit was not complete - this fixes another compile error in remoteprocedure in C++11 mode 2016-12-08 Tommi Mäkitalo * include/cxxtools/remoteprocedure.h, utils/remoteprocedure.pl: fix compile error in remoteprocedure without arguments in C++11 2016-12-07 Tommi Mäkitalo * : commit e0b7d1889500af895a7c610a83075406eed00908 Author: Tommi Mäkitalo Date: Fri Dec 2 08:46:48 2016 +0100 2016-12-02 Tommi Mäkitalo * demo/hd.cpp, include/cxxtools/hdstream.h, src/iodeviceimpl.cpp, src/tcpsocketimpl.cpp: new class cxxtools::HexDump, which makes outputting hex dumps to std::ostream a little more efficient 2016-11-23 Tommi Mäkitalo * src/json/httpclient.cpp, src/xmlrpc/client.cpp: Fix possible crash in xmlrpc client and json client. The client crashes when a default constructed client is passed to a remote procedure and then destructed. 2016-11-10 Tommi Mäkitalo * include/cxxtools/eventloop.h, src/eventloop.cpp: add idle signal to event loop 2016-11-07 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp: make serialization of SerializationInfo nicer 2016-11-06 Tommi Mäkitalo * : commit 7087fdf9ef6cf2233ab1e8bea0c6bd2f63255fb2 Author: Tommi Mäkitalo Date: Sun Nov 6 23:47:36 2016 +0100 2016-11-06 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp: Fix serialization of SerializationInfo. Serialization must not change the name of the target SerializationInfo. 2016-10-25 Tommi Mäkitalo * include/cxxtools/iniparser.h, include/cxxtools/join.h, include/cxxtools/posix/daemonize.h, include/cxxtools/posix/exec.h, include/cxxtools/thread.h: add missing include guards to some headers 2016-09-23 Michal Vyskocil * include/cxxtools/pool.h: add missing guard to pool.h 2016-09-22 Tommi Mäkitalo * demo/msgclient.cpp, demo/msgserver.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: improve error message when trying to connect a tcp socket 2016-09-21 Tommi Mäkitalo * include/cxxtools/convert.h: fix prototypes for convert functions for long longs 2016-09-20 Tommi Mäkitalo * src/tcpserverimpl.cpp: improve debug output of tcpserver when failing to create socket for a addr entry 2016-09-19 Tommi Mäkitalo * include/cxxtools/clock.h, include/cxxtools/datetime.h, include/cxxtools/timer.h, src/clock.cpp, src/clockimpl.cpp, src/clockimpl.h, src/datetime.cpp, src/timer.cpp: extend cxxtools::Timer by a signal, which passes the due date of the timer 2016-09-19 Tommi Mäkitalo * : commit 5695762441295109c3075f510535fd6ee7227e6e Author: Tommi Mäkitalo Date: Mon Sep 19 14:16:01 2016 +0200 2016-09-19 Tommi Mäkitalo * src/addrinfo.cpp: fix crash when trying to copy an empty AddrInfo object 2016-09-16 Tommi Mäkitalo * include/cxxtools/xml/xmldeserializer.h: add missing include 2016-09-02 Tommi Mäkitalo * src/timer.cpp: Remove warning about no configured selector when starting timer. Adding a warning when starting a timer was not such a good idea. It is quite normal to start a timer and setting the selector after that. It happens e.g. in the http server. 2016-09-02 Tommi Mäkitalo * src/bin/socket.h, src/json/socket.h: remove unused headers 2016-09-02 Tommi Mäkitalo * src/http/serverimpl.cpp: fix potential memory leak 2016-08-26 Tommi Mäkitalo * include/cxxtools/bin/parser.h, src/bin/formatter.cpp, src/bin/parser.cpp, src/bin/responder.cpp, src/bin/rpcclientimpl.cpp, src/bin/scanner.cpp, src/bin/scanner.h: Fix in binary rpc client and server Handling of dictionary was wrong when multiple requests were executed. The parser needs to be reinitialized between calls. 2016-08-25 Tommi Mäkitalo * include/cxxtools/convert.h: fix (workaround) a rounding problem in cxxtools::convert when converting long double to string 2016-08-10 Tommi Mäkitalo * test/.gitignore: ignore generated "logbench" in git 2016-08-11 Tommi Mäkitalo * src/base64codec.cpp: add missing include in base64codec.cpp 2016-08-10 Tommi Mäkitalo * test/binrpc-test.cpp, test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp, test/xmlrpc-test.cpp, test/xmlrpccallback-test.cpp: make listen ip configurable in unittest using env var UTEST_LISTEN listen port was already configurable with env var UTEST_PORT 2016-08-10 Tommi Mäkitalo * src/xml/xmlreader.cpp: allow char '>' in xml data 2016-04-13 Tommi Mäkitalo * demo/.gitignore, demo/Makefile.am, demo/commandoutput.cpp, demo/execLs.cpp, include/cxxtools/posix/commandinput.h, include/cxxtools/posix/commandoutput.h, include/cxxtools/posix/exec.h: simplify class cxxtools::Exec 2016-04-06 Tommi Mäkitalo * src/timer.cpp: add warning log when starting timer without selector 2016-04-04 Tommi Mäkitalo * src/timespan.cpp: interpret a string "mil..." as milliseconds instead of minutes in cxxtools::Timespan 2016-03-20 Tommi Mäkitalo * src/deserializer.cpp, src/xmlrpc/scanner.cpp: fix possible crash on invalid xml in xmlrpc server do not allow to underrun member scanner if too many calls to leaveMember in deserializer 2016-03-08 Tommi Mäkitalo * src/timespan.cpp: Fix deserializing timestamp: On unknown unit the just the number is used. Previously the timestamp was set to 0. 2016-03-03 Tommi Mäkitalo * include/cxxtools/iodevice.h, include/cxxtools/streambuffer.h, src/iodevice.cpp, src/iodeviceimpl.cpp, src/streambuffer.cpp, src/tcpsocketimpl.cpp: some improvements in cxxtools::StreamBuffer and IODevice: * in cxxtools::StreamBuffer on beginWrite do nothing if already writing instead of discard and rewrite * add documentation in cxxtools::StreamBuffer * log debug output as hex dump if something is written to a device 2016-01-28 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp: changes to cxxtools::MimeEntity: * new method readBody for reading entity body from input stream * decode data according to content transfer encoding when reading entity body 2016-01-24 Tommi Mäkitalo * .gitignore, demo/Makefile.am, demo/mimemultipart.cpp, include/cxxtools/mime.h, src/mime.cpp: simplify creatating complex mime multipart objects with sub objects. 2016-01-21 Tommi Mäkitalo * include/cxxtools/mime.h: add missing include guards in cxxtools/mime.h 2016-01-21 Tommi Mäkitalo * src/mime.cpp: fix parsing mime multipart * allow boundary in quotes 2016-01-17 Tommi Mäkitalo * src/mime.cpp: add missing header (github issue #11) 2016-01-17 Tommi Mäkitalo * src/regex.cpp: fix calculating offsets when regular expressions with offset is processed (cxxtools::Regex::matchp) 2016-01-14 Tommi Mäkitalo * include/cxxtools/mime.h: fix setting type of mime multipart object 2016-01-11 Tommi Mäkitalo * src/quotedprintablecodec.cpp: fix compiler warning due to strange loop condition. 2016-01-11 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp, test/Makefile.am, test/mime-test.cpp: make mime classes serializable and add some unit tests 2016-01-11 Tommi Mäkitalo * demo/mime2json.cpp, demo/mimeextract.cpp, include/cxxtools/mime.h, src/mime.cpp: rename cxxtools::MimeObject to cxxtools::MimeEntity and add some documentation. "Entity" is the phrase, which is used in the rfc. 2016-01-10 Tommi Mäkitalo * demo/.gitignore, demo/Makefile.am, demo/mimeextract.cpp: add demo to extract parts from a mime/multipart message 2016-01-10 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp: Add constructor to parse mime/multipart messages from a std::istream 2016-01-08 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp: remove 2 methods from cxxtools::MimeMultipart to resolve abiguouty 2016-01-08 Tommi Mäkitalo * include/cxxtools/mime.h: add some stl container style methods to cxxtools::MimeMultipart 2016-01-08 Tommi Mäkitalo * src/mime.cpp: fix cxxtools::MimeMultipart::addObject - forgot to set the body 2016-01-07 Tommi Mäkitalo * demo/Makefile.am, demo/mime2json.cpp, demo/multipart2json.cpp, src/mime.cpp: improve mime multipart demo Read not only mime multipart messages but all mime objects. Add some documentation to the demo. 2016-01-07 Tommi Mäkitalo * demo/.gitignore: update .gitignore 2016-01-07 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp: fix parsing mime/multipart messages (was broken after reworking api) 2016-01-07 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp, src/quotedprintablecodec.cpp, test/quotedprintable-test.cpp: improve api for mime objects 2016-01-07 Tommi Mäkitalo * demo/mime.cpp, include/cxxtools/mime.h, src/base64codec.cpp: limit line width of base64 encoder to 76 characters 2016-01-07 Tommi Mäkitalo * demo/Makefile.am, demo/mime.cpp, demo/multipart2json.cpp, include/cxxtools/mime.h, src/mime.cpp: rework mime multipart - first step 2016-01-06 Tommi Mäkitalo * src/Makefile.am, src/quotedprintablestream.cpp: Last checkin was imcomplete. Remove old quoted printable stream class also. It does not compile any more. 2016-01-06 Tommi Mäkitalo * include/cxxtools/quotedprintablestream.h, test/quotedprintable-test.cpp: replace old quoted printable implementation with new quoted printable codec 2016-01-06 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/quotedprintablecodec.h, src/Makefile.am, src/quotedprintablecodec.cpp, test/quotedprintable-test.cpp: Implement a codec for quoted printable 2016-01-06 Tommi Mäkitalo * src/base64codec.cpp: fix base64 codec The codec needs to consume always at least one byte or write one byte in every step. Otherwise it may stop in some cicumstances. 2016-01-05 Tommi Mäkitalo * include/cxxtools/base64codec.h: remove unused #include 2016-01-05 Tommi Mäkitalo * src/base64codec.cpp, test/base64-test.cpp: accept white space in base64 encoded data when decoding it 2016-01-02 Tommi Mäkitalo * src/mime.cpp: fix cxxtools::Mime Mime objects has a line delimiter CRLF instead of just LF 2015-12-30 Tommi Mäkitalo * include/cxxtools/mime.h, src/mime.cpp: small changes in cxxtools::Mime class Fix specification of charset. Do not output multipart mime object if only one part is found. Small usability improvements. 2015-12-18 Tommi Mäkitalo * src/serializationinfo.cpp: Fix move constructor of cxxtools::SerializationInfo We cannot just move the byte pattern of a std::string. It mostly works but it depends on the implementation of std::string. 2015-12-02 Tommi Mäkitalo * src/utf8codec.cpp, test/utf8-test.cpp: fix bug where json deserializer may hang when processing a byte order mark 2015-12-02 Tommi Mäkitalo * include/cxxtools/eventloop.h, include/cxxtools/eventsink.h, src/eventloop.cpp, src/eventsink.cpp, test/Makefile.am, test/eventloop-test.cpp: implement priority events, which overtake non priority events 2015-11-30 Tommi Mäkitalo * include/cxxtools/eventloop.h, src/eventloop.cpp: impl cxxtools::EventLoop for better binary compatibility in future releases 2015-11-25 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h, src/log.cpp, test/logconfiguration-test.cpp: allow setting log level using string notation in cxxtools::LogConfiguration 2015-11-20 Tommi Mäkitalo * src/xml/xmlreader.cpp, test/xmlreader-test.cpp: allow colon in tag names to parse xml name spaces and add some debug messages into xml parser 2015-11-18 Tommi Mäkitalo * include/cxxtools/timespan.h, src/timespan.cpp, test/timespan-test.cpp: improve serialization and istream support in cxxtools::Timespan Units are now read from istream. Reading a WeakTimespan from just number or deserialization from just number defaults to the units of the WeakTimespan, e.g. reading or deserialization of "42" to cxxtools::Seconds is now really 42 seconds but reading "42h" means 42 days even when cxxtools::Seconds are read. 2015-10-21 Tommi Mäkitalo * include/cxxtools/convert.h, include/cxxtools/timespan.h, src/timespan.cpp, test/timespan-test.cpp: improve serialization and output of cxxtools::Timespan 2015-10-09 Tommi Mäkitalo * include/cxxtools/deserializer.h: make deserialize method in deserializer const 2015-10-07 Tommi Mäkitalo * include/cxxtools/eventloop.h, include/cxxtools/eventsink.h, src/eventloop.cpp, src/eventsink.cpp: implement queueEvent in event loop, which was documented but missing 2015-10-06 Tommi Mäkitalo * include/cxxtools/jsonparser.h, src/jsonparser.cpp, test/jsondeserializer-test.cpp: accept trailing comma in json arrays and objects 2015-10-01 Tommi Mäkitalo * test/properties-test.cpp: add some more test cases to properties deserializer test 2015-10-01 Tommi Mäkitalo * src/timer.cpp: fix overflow in timer initialization 2015-10-01 Tommi Mäkitalo * src/propertiesserializer.cpp: small fix in propertiesserializer: name of array was not serialized when it was a member 2015-10-01 Tommi Mäkitalo * include/cxxtools/csvformatter.h, include/cxxtools/csvserializer.h, src/csvformatter.cpp, test/csvserializer-test.cpp: allow multichar delimiter in csvserializer 2015-10-01 Tommi Mäkitalo * include/cxxtools/propertiesparser.h, src/propertiesdeserializer.cpp, src/propertiesparser.cpp, test/properties-test.cpp: small fix in propertiesdeserializer When trim is enabled in propertiesdeserializer white space at the beginning and end of a value is trimmed away. The sequence \t in a properties file means a tab character. But this sequence should not be stripped away. This is fixed now. Also a space, which is escaped with '\' is not stripped away any more. 2015-09-29 Tommi Mäkitalo * src/envsubst.cpp, test/envsubst-test.cpp: small fix in envsubst function do not remove backslashes other than when escaping '$' 2015-09-29 Tommi Mäkitalo * src/propertiesparser.cpp: minor fix in propertiesparser handle escaped characters at the beginning of a value after a key without delimiter correctly 2015-09-29 Tommi Mäkitalo * include/cxxtools/decomposer.h, src/bin/parser.cpp, src/xmlrpc/responder.cpp: cleanup some includes 2015-09-25 Tommi Mäkitalo * src/jsonparser.cpp: accept '_' in plain keys in json 2015-09-25 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, include/cxxtools/string.h, src/serializationinfo.cpp, src/string.cpp: add noexcept specifier to move constructor for possibly better optimization 2015-09-23 Tommi Mäkitalo * include/cxxtools/timer.h, src/timer.cpp: check interval time for validity in cxxtools::Timer 2015-09-23 Tommi Mäkitalo * include/cxxtools/selector.h, src/selector.cpp, src/selectorimpl.cpp: add new method waitTimer to Selector 2015-09-22 Tommi Mäkitalo * src/serializationinfo.cpp: prevent double delete when memory is exhausted in SerializationInfo assignment 2015-09-22 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp: fix memory leak in SerializationInfo 2015-09-16 Tommi Mäkitalo * src/propertiesdeserializer.cpp, src/propertiesparser.cpp, test/properties-test.cpp: extend properties deserializer to support more combinations of serialization keys and members 2015-09-16 Tommi Mäkitalo * cxxtools-config.in: add generator for logging properties back to cxxtools-config 2015-09-09 Tommi Mäkitalo * include/cxxtools/unit/assertion.h: add new unit test macro CXXTOOLS_UNIT_ASSERT_EQUALS2 which expects a output function as an additional parameter The output function expects the value as a parmeter and must return something, which has an output operator, e.g. a std::string. 2015-09-10 Tommi Mäkitalo * src/log.cpp: forgot to output log levels FINER and FINEST in logger 2015-09-10 Tommi Mäkitalo * include/cxxtools/properties.h, include/cxxtools/propertiesserializer.h, src/propertiesserializer.cpp, test/propertiesserializer-test.cpp: add object and array size as comment to properties in propertiesserializer (can be switched of) 2015-09-10 Tommi Mäkitalo * src/propertiesserializer.cpp, test/propertiesserializer-test.cpp: add comments about array and object sizes to properties in propertiesserializer 2015-09-09 Tommi Mäkitalo * test/propertiesserializer-test.cpp: add missing file (again) 2015-09-09 Tommi Mäkitalo * src/propertiesserializer.cpp: add missing file 2015-09-09 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/properties.h, include/cxxtools/propertiesserializer.h, src/Makefile.am, test/Makefile.am: implement propertiesserializer 2015-09-09 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, include/cxxtools/settings.h, src/csvparser.cpp, src/jsonparser.cpp, src/serializationinfo.cpp, test/serializationinfo-test.cpp: cleanup some headers 2015-09-06 Tommi Mäkitalo * ChangeLog, utils/git2changelog.pl: update ChangeLog 2015-09-06 Tommi Mäkitalo * include/cxxtools/base64codec.h, include/cxxtools/connectable.h, include/cxxtools/delegate.h, include/cxxtools/event.h, include/cxxtools/function.tpp, include/cxxtools/http/server.h, include/cxxtools/posix/commandoutput.h, include/cxxtools/selector.h, include/cxxtools/settings.h, include/cxxtools/signal.h, include/cxxtools/unit/reporter.h, include/cxxtools/unit/testmethod.h, include/cxxtools/xml/node.h, src/base64codec.cpp, src/bin/rpcserverimpl.cpp, src/bin/socket.cpp, src/charmapcodec.cpp, src/csvformatter.cpp, src/eventloop.cpp, src/http/chunkedreader.cpp, src/http/clientimpl.cpp, src/http/notauthenticatedresponder.cpp, src/http/notauthenticatedservice.cpp, src/http/notfoundresponder.cpp, src/http/parser.cpp, src/http/responder.cpp, src/http/serverimpl.cpp, src/http/service.cpp, src/http/socket.cpp, src/iniparser.cpp, src/iodeviceimpl.cpp, src/json/httpclientimpl.cpp, src/json/httpresponder.cpp, src/json/rpcserverimpl.cpp, src/json/socket.cpp, src/jsonformatter.cpp, src/log.cpp, src/multifstream.cpp, src/mutex.cpp, src/muteximpl.cpp, src/muteximpl.h, src/selector.cpp, src/settingsreader.h, src/streambuffer.cpp, src/tcpserverimpl.cpp, src/unit/application.cpp, src/unit/jsonreporter.cpp, src/utf8codec.cpp, src/xml/xmlformatter.cpp, src/xml/xmlreader.cpp, src/xml/xmlwriter.cpp, src/xmlrpc/formatter.cpp, src/xmlrpc/httpclient.cpp, src/xmlrpc/httpclientimpl.cpp, src/xmlrpc/responder.cpp, test/binrpc-test.cpp, test/jsondeserializer-test.cpp, test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp, test/rpcbenchasyncclient.cpp, test/xmlrpc-test.cpp, test/xmlrpccallback-test.cpp: fix unused parameters warnings (not enabled by default) 2015-08-18 Tommi Mäkitalo * src/envsubst.cpp: better error message when string could not be parsed in envsubst 2015-08-13 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/unit/application.h, include/cxxtools/unit/assertion.h, include/cxxtools/unit/jsonreporter.h, include/cxxtools/unit/reporter.h, include/cxxtools/unit/test.h, include/cxxtools/unit/testmain.h, include/cxxtools/unit/testsuite.h, src/string.cpp, src/unit/Makefile.am, src/unit/application.cpp, src/unit/jsonreporter.cpp, src/unit/reporter.cpp, src/unit/test.cpp, src/unit/testcontext.cpp, test/arg-test.cpp: Several unit test improvements * In CXXTOOLS_UNIT_ASSERT_EQUALS the expressions are evaluated just once now. * There is a new macro CXXTOOLS_UNIT_SKIP to skip a test. * A new flag -s prints a statistic summary of the tests. * A new class cxxtools::unit::JsonReporter makes it possible to output test results with a serializer like json. * A new flag -j or --json in unit test outputs results in json format. 2015-08-04 Tommi Mäkitalo * src/streambuffer.cpp: optimization in StreamBuffer: beginWrite will try to write some if already in write operation 2015-08-04 Tommi Mäkitalo * include/cxxtools/date.h, src/date.cpp, test/date-test.cpp: fix date validation 2015-08-04 Tommi Mäkitalo * include/cxxtools/smartptr.h: remove unused parameter name from smart pointer to remove an extended compiler warning 2015-08-04 Tommi Mäkitalo * include/cxxtools/posix/commandinput.h: pass options parameter to for in command input class 2015-07-30 Tommi Mäkitalo * src/streambuffer.cpp: fix a bug where the streambuffer may block when non blocking I/O is used 2015-07-29 Tommi Mäkitalo * include/cxxtools/date.h, include/cxxtools/datetime.h, include/cxxtools/time.h, src/date.cpp, src/datetime.cpp, src/dateutils.cpp, src/dateutils.h, src/time.cpp, test/date-test.cpp, test/datetime-test.cpp, test/time-test.cpp: additional date and time formats for fixed number of digits 2015-07-25 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp, test/serializer-bench.cpp: change SerializationInfo to held a pointer to container to subnodes instead of the container itself 2015-07-24 Tommi Mäkitalo * src/conditionimpl.cpp: wait infinitely when passing negative timeout to queue 2015-07-21 Tommi Mäkitalo * src/log.cpp: initialize tostdout flag correctly in logger 2015-07-17 Tommi Mäkitalo * src/datetime.cpp, src/dateutils.cpp, src/dateutils.h, src/time.cpp: limit to 3 digits when parsing milliseconds in cxxtools::Time and cxxtools::DateTime 2015-07-17 Tommi Mäkitalo * src/date.cpp, src/datetime.cpp: fix parsing date with format code %y: should read just 2 digits 2015-07-15 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp: Change container for subnodes in SerializationInfo from std::vector to std::deque Adding members to SerializationInfo using addMember may result to invalidation of previous references to the object when using std::vector. This does not happen with std::deque. Since a deque do not have a reserve method, the reserve method in SerializationInfo is removed also. This results in a break in the api. If someone use the method, just remove it. It is not needed in a deque. 2015-07-13 Tommi Mäkitalo * test/serializationinfo-test.cpp: skip range error check in serialization info if double or float are not smaler than long double 2015-07-12 Tommi Mäkitalo * configure.ac: update release and so number 2015-07-12 Tommi Mäkitalo * include/cxxtools/datetime.h: fix format code in documentation of DateTime class 2015-07-11 Tommi Mäkitalo * include/cxxtools/datetime.h, src/log.cpp: implement time based rolling of log files 2015-07-11 Tommi Mäkitalo * include/cxxtools/time.h, src/time.cpp: fix cxxtools::Time object on 32 bit platforms Extending resolution of time object lead to overflow when long is just 32 bit. We use uint64_t now. 2015-07-10 Tommi Mäkitalo * include/cxxtools/char.h, src/utf8codec.cpp, test/jsondeserializer-test.cpp: fix reading multibyte utf8 sequences from utf8 codec 2015-07-01 Tommi Mäkitalo * include/cxxtools/xml/xml.h, include/cxxtools/xml/xmldeserializer.h, src/xml/xmldeserializer.cpp: fix xml deserializer and add attribute prefix feature The xml deserializer forgot to read some attributes on some circumstances. The attribute prefix feature helps distinquishing between xml nodes and xml attributes. 2015-07-01 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/json/rpcserver.cpp, src/serializationinfo.cpp, src/xml/xmlwriter.cpp: fix typo 2015-07-01 Tommi Mäkitalo * src/xml/xmldeserializer.cpp: fix compiler warning 2015-07-01 Tommi Mäkitalo * src/xml/xmldeserializer.cpp: fix processing xml attributes in deserializer when a start node is followed directly by another start node 2015-06-25 Tommi Mäkitalo * src/jsonformatter.cpp: fix plainkey flag in jsonformatter: keys for subarrays or substructs did not considered the flag 2015-06-20 Tommi Mäkitalo * include/cxxtools/utf8.h: utf8 helper for deserialization was still wrong - this time I tested it before commit 2015-06-20 Tommi Mäkitalo * include/cxxtools/utf8.h: fix utf8 convert helper for deserialization (const was missing) 2015-06-18 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp, test/serializationinfo-test.cpp: fix move assignment of SerializationInfo In some cicumstances move operations lead to double free corruption. 2015-06-18 Tommi Mäkitalo * demo/Makefile.am: do not install header from demo 2015-05-21 Tommi Mäkitalo * src/clockimpl.cpp: fix cxxtools::Clock::getSystemTime 2015-05-16 Tommi Mäkitalo * src/clockimpl.cpp, src/date.cpp, src/datetime.cpp, src/dateutils.cpp, src/dateutils.h, src/time.cpp: fix handling microseconds in datetime and time 2015-05-16 Tommi Mäkitalo * include/cxxtools/datetime.h, include/cxxtools/time.h, src/datetime.cpp, src/dateutils.cpp, src/dateutils.h, src/time.cpp, test/datetime-test.cpp, test/time-test.cpp: add format codes %u and %U for microseconds in Time and Datetime classes 2015-05-15 Tommi Mäkitalo * test/date-test.cpp, test/datetime-test.cpp, test/time-test.cpp: implement unit tests for serialization of date, time and datetime 2015-05-15 Tommi Mäkitalo * include/cxxtools/time.h: rename microsec to usec in cxxtools::Time and fix accessor for it 2015-05-15 Tommi Mäkitalo * include/cxxtools/time.h, src/datetime.cpp: fix datetime arithmetic 2015-05-15 Tommi Mäkitalo * src/datetime.cpp, src/time.cpp: fix for DateTime calculation (not finished yet) 2015-05-15 Tommi Mäkitalo * include/cxxtools/date.h, include/cxxtools/datetime.h, include/cxxtools/time.h, include/cxxtools/timespan.h, src/datetime.cpp, src/time.cpp, test/datetime-test.cpp, test/time-test.cpp: Simplify and extend date and time handling. cxxtools::Time has now microseconds resolution instead of just milliseconds. 2015-05-14 Tommi Mäkitalo * test/timespan-test.cpp: add unit test for multiplication and division of cxxtools::Timespan 2015-05-13 Tommi Mäkitalo * src/log.cpp, test/logconfiguration-test.cpp: fix for reading log configuration from properties file When a sub category was set but the top level category not, the top level got log level FATAL. This was wrong. It must not have a explicit own level but fall back to root level. 2015-05-13 Tommi Mäkitalo * demo/Makefile.am, demo/xmlmsgclient.cpp, demo/xmlmsgserver.cpp, include/cxxtools/xml/xmlerror.h, src/xml/xmlreader.cpp, test/rpcbenchasyncclient.cpp: Improve xml interface so that a xml message based communication is possible. We also add a demo, which shows how to send xml messages from a server to a client. 2015-05-12 Tommi Mäkitalo * include/cxxtools/timespan.h, test/timespan-test.cpp: add unary - operator to timespan class 2015-05-08 Tommi Mäkitalo * test/Makefile.am: add missing unittest include file in dist package 2015-05-07 Tommi Mäkitalo * include/cxxtools/date.h, include/cxxtools/datetime.h, include/cxxtools/time.h, src/date.cpp, src/datetime.cpp, src/dateutils.cpp, src/dateutils.h, src/time.cpp, test/date-test.cpp, test/datetime-test.cpp, test/time-test.cpp: extended format codes for date, time and datetime '?' is a placeholder for a arbitrary character '*' is a placeholder for skipping non digit data 2015-05-05 Tommi Mäkitalo * src/propertiesdeserializer.cpp, test/properties-test.cpp: fix PropertiesDeserializer: chain of members were not read correctly 2015-05-05 Tommi Mäkitalo * include/cxxtools/serializationinfo.h: new member method getAddMember in SerializationInfo which combines findMember and addMember 2015-04-30 Tommi Mäkitalo * test/jsonserializer-test.cpp: improve unit test for json serializer 2015-04-30 Tommi Mäkitalo * include/cxxtools/json.h, include/cxxtools/jsonformatter.h, include/cxxtools/jsonserializer.h, src/jsonformatter.cpp, test/jsonserializer-test.cpp: new flag "plainkey" in json serializer, where keys in structs are written without quotes where possible 2015-04-28 Tommi Mäkitalo * include/cxxtools/bin/bin.h, include/cxxtools/csv.h, include/cxxtools/json.h, include/cxxtools/xml/xml.h: better error handling in iostream operators for serialization and deserialization 2015-04-28 Tommi Mäkitalo * include/cxxtools/jsondeserializer.h, src/jsondeserializer.cpp, test/jsondeserializer-test.cpp: use codec directly in json deserializer instead of using a temporary TextIStream to prevent loosing data in its buffer 2015-04-27 Tommi Mäkitalo * src/signal.cpp: fix compile bug: sunstudio compiler complaint about syntax error 2015-04-27 Tommi Mäkitalo * include/cxxtools/envsubst.h: fix compile bug not detected by gcc 2015-04-24 Tommi Mäkitalo * src/serializationinfo.cpp: remove useless log_debug output in SerializationInfo 2015-04-24 Tommi Mäkitalo * include/cxxtools/textbuffer.h: do not block in TextBuffer::underflow when not needed 2015-04-24 Tommi Mäkitalo * src/jsondeserializer.cpp, src/jsonparser.cpp: fix error detection if json is not ended properly 2015-04-22 Tommi Mäkitalo * include/cxxtools/properties.h, include/cxxtools/propertiesdeserializer.h, src/propertiesdeserializer.cpp: fix support for environment variables and trim in properties deserializer: need a way to set the flags before reading the properties file 2015-04-21 Tommi Mäkitalo * include/cxxtools/properties.h, include/cxxtools/propertiesdeserializer.h, src/propertiesdeserializer.cpp: add support for environment variables and trim in properties deserializer 2015-04-20 Tommi Mäkitalo * include/cxxtools/net/tcpstream.h: use timespan as timeout in TcpStream class 2015-04-17 Tommi Mäkitalo * src/csvparser.cpp, src/jsonparser.cpp, src/propertiesparser.cpp: improve exception messages in json, csv and properties parsers 2015-04-15 Tommi Mäkitalo * src/envsubst.cpp: bugfix cxxtools::envSubst: multiple environmen variables in one string did not work always 2015-04-13 Tommi Mäkitalo * src/log.cpp: optimization in logger: string buffer is kept between calls, which speeds up log output for about 7% 2015-04-09 Tommi Mäkitalo * src/json/httpclientimpl.cpp, src/xmlrpc/clientimpl.cpp: fix handling connect error in jsonhttp and xmlrpc client 2015-04-09 Tommi Mäkitalo * src/bin/rpcclientimpl.cpp, src/json/rpcclientimpl.cpp: fix handling connect error in json and binary rpc client 2015-04-08 Tommi Mäkitalo * test/properties-test.cpp: remove unused include statment 2015-04-08 Tommi Mäkitalo * test/logconfiguration-test.cpp: fix unit test of logger; was broken after last change 2015-04-08 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h: fix compiler warning in logger 2015-04-08 Tommi Mäkitalo * include/cxxtools/csv.h: minor optimization: pass string by reference to cxxtools::CsvOObject 2015-04-04 Tommi Mäkitalo * doc/logging-howto.markdown: update logging howto 2015-04-04 Tommi Mäkitalo * src/log.cpp: change log level TRACE not to include FINER and FINEST 2015-04-03 Tommi Mäkitalo * src/log.cpp: allow environment variables when specifying log file in logger 2015-04-03 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/envsubst.h, src/Makefile.am, src/envsubst.cpp, test/Makefile.am, test/envsubst-test.cpp: new class cxxtools::EnvSubst to substitute environment variables in character sequences 2015-03-31 Tommi Mäkitalo * test/logconfiguration-test.cpp: add more unit tests for logging configuration 2015-03-31 Tommi Mäkitalo * src/directoryimpl.cpp: improve error message in cxxtools::Directory 2015-03-31 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/charmapcodec.h, src/iso8859_15codec.cpp => include/cxxtools/iso8859_10codec.h, include/cxxtools/iso8859_11codec.h, include/cxxtools/iso8859_13codec.h, include/cxxtools/iso8859_14codec.h, include/cxxtools/iso8859_15codec.h, include/cxxtools/iso8859_16codec.h, include/cxxtools/iso8859_1codec.h, include/cxxtools/iso8859_2codec.h, include/cxxtools/iso8859_3codec.h, include/cxxtools/iso8859_4codec.h, include/cxxtools/iso8859_5codec.h, include/cxxtools/iso8859_6codec.h, include/cxxtools/iso8859_7codec.h, include/cxxtools/iso8859_8codec.h, include/cxxtools/iso8859_9codec.h, src/Makefile.am, src/{iso8859_1codec.cpp => charmapcodec.cpp}, src/iso8859_codec.cpp: add codecs for all iso-8859-x character sets 2015-03-27 Tommi Mäkitalo * src/Makefile.am: do not include private header 2015-03-26 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h, include/cxxtools/unit/assertion.h, src/log.cpp, test/Makefile.am, test/logconfiguration-test.cpp: improved logging: allow log levels to be switched on and off individually 2015-03-26 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h: fix display of log levels in logger 2015-03-23 Tommi Mäkitalo * include/cxxtools/http/responder.h, include/cxxtools/json/responder.h, include/cxxtools/xmlrpc/responder.h, src/http/responder.cpp, src/http/socket.cpp, src/json/httpresponder.cpp, src/json/httpresponder.h, src/xmlrpc/responder.cpp: make socket available in http responder 2015-03-21 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, include/cxxtools/string.h, src/string.cpp, test/serializationinfo-test.cpp, test/string-test.cpp: add move constructor and move assignment to cxxtools::String and cxxtools::SerializationInfo if C++11 is used 2015-03-20 Tommi Mäkitalo * demo/timer.cpp, include/cxxtools/log/cxxtools.h, src/log.cpp, test/logbench.cpp: revert to old log level definitions LOG_LEVEL_something 2015-03-19 Tommi Mäkitalo * demo/timer.cpp, include/cxxtools/log/cxxtools.h, src/log.cpp, test/logbench.cpp: add prefix debug level definitions to prevent name clash with commonly used macros like DEBUG 2015-03-19 Tommi Mäkitalo * include/cxxtools/xmlrpc/client.h, include/cxxtools/xmlrpc/httpclient.h: add some documentation 2015-03-10 Tommi Mäkitalo * include/cxxtools/arg.h, include/cxxtools/clock.h, include/cxxtools/convert.h, include/cxxtools/delegate.h, include/cxxtools/remoteresult.h, include/cxxtools/signal.tpp, include/cxxtools/textbuffer.h, include/cxxtools/threadpool.h, include/cxxtools/xmlrpc/client.h, src/bin/formatter.cpp, src/bin/rpcclient.cpp, src/bin/scanner.h, src/clock.cpp, src/connection.cpp, src/directoryimpl.cpp, src/json/httpclient.cpp, src/json/rpcclient.cpp, src/json/scanner.h, src/log.cpp, src/selectorimpl.cpp, src/xml/xmlreader.cpp, src/xmlrpc/httpclient.cpp: minor updates after running cppcheck 2015-03-04 Tommi Mäkitalo * doc/binserialization.txt, src/bin/formatter.cpp, src/bin/parser.cpp: fix binary deserializer: failed to deserialize arrays with names 2015-02-26 Tommi Mäkitalo * src/json/rpcclientimpl.cpp: fix not initialized counter variable in json rpc client 2015-02-08 Tommi Mäkitalo * src/bin/rpcserverimpl.cpp, src/http/serverimpl.cpp, src/json/rpcserverimpl.cpp: fix possible memory leak when rpc server is terminated while a thread is starting 2015-02-08 Tommi Mäkitalo * include/cxxtools/connection.h, src/connectable.cpp, src/connection.cpp: fix use heap after free bug in Connectable 2015-02-08 Tommi Mäkitalo * include/cxxtools/limitstream.h: fix delete in limit stream (delete[] instead of delete) 2015-02-06 Tommi Mäkitalo * demo/.gitignore: future demo added to gitignore 2015-02-06 Tommi Mäkitalo * test/base64-test.cpp: fix base64 test - string was accessed outside 2015-02-03 Tommi Mäkitalo * demo/Makefile.am, demo/future.cpp, include/cxxtools/queue.h, include/cxxtools/threadpool.h, src/threadpool.cpp, src/threadpoolimpl.cpp, src/threadpoolimpl.h: add future object to thread pool to make it easy to wait for a finished job 2015-01-23 Tommi Mäkitalo * demo/.gitignore, demo/Makefile.am, demo/README, demo/msg.h, demo/msgclient.cpp, demo/msgserver.cpp, test/.gitignore: add new demo: send messages over a socket using serialization 2015-01-23 Tommi Mäkitalo * include/cxxtools/bin/bin.h, include/cxxtools/csv.h, include/cxxtools/json.h, include/cxxtools/xml/xml.h: fix handling of exceptions when serialization helprs are used (iostream operators should not throw exepctions but just set the failbit 2015-01-22 Tommi Mäkitalo * include/cxxtools/net/tcpserver.h, src/bin/rpcserverimpl.cpp, src/bin/socket.cpp, src/http/serverimpl.cpp, src/json/rpcserverimpl.cpp, src/json/socket.cpp, src/tcpserverimpl.cpp: support for socket option SO_REUSEADDR listen in tcpsocket fails when one of the addresses got via getaddrinfo fail 2015-01-06 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/string.cpp, test/string-test.cpp: fix some cxxtools::String compare cases 2015-01-05 Tommi Mäkitalo * include/cxxtools/convert.h, src/convert.cpp: cxxtools::convert functions for long long types imlemented 2015-01-04 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, test/serialization-test.cpp: add serialization operators for std::forward_list 2015-01-03 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, test/Makefile.am, test/serialization-test.cpp, test/serializationinfo-test.cpp: implement serialization operators for C++11 containers std::unordered_... 2014-12-26 Tommi Mäkitalo * : xmlrpc howto was converted to markdown - remove original odt file 2014-12-23 Tommi Mäkitalo * src/fileimpl.cpp: fix endless loop in File::copy when sendfile is not used (solaris, bsd) 2014-12-21 Tommi Mäkitalo * demo/deserialization.cpp, demo/httpclient.cpp, demo/serialization.cpp, demo/timer.cpp, include/cxxtools/iconvwrap.h, include/cxxtools/limitstream.h, include/cxxtools/scopedincrement.h, src/dateutils.h, src/iconvwrap.cpp: fix some copyright headers 2014-12-21 Tommi Mäkitalo * include/cxxtools/inifile.h, src/inifile.cpp, test/Makefile.am, test/inifile-test.cpp: some small improvements in cxxtools::IniFile 2014-12-21 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/queue.h, include/cxxtools/scopedincrement.h, test/Makefile.am, test/scopedincrement-test.cpp: fix compile errors in timed wait of queue and add a new class ScopedIncrement for use in queue 2014-12-20 Tommi Mäkitalo * test/inifile.cpp: delete old test program, which does not work any more 2014-12-15 Tommi Mäkitalo * include/cxxtools/queue.h: add getter method with timeout to thread queue class (cxxtools::Queue) 2014-12-05 Tommi Mäkitalo * src/tcpsocketimpl.cpp: fix tcpsocket: may fail when first connection attempt did not succeed 2014-12-04 Tommi Mäkitalo * include/cxxtools/propertiesparser.h, include/cxxtools/serializationinfo.h, src/posix/daemonize.cpp, src/selectorimpl.cpp, src/string.cpp, src/unit/testsuite.cpp: some cleanup to help compiling with oraclestudio compiler (do not fully work yet) 2014-12-03 Tommi Mäkitalo * m4/ax_cxx_compile_stdcxx_11.m4: update autoconf macro to check for C++-11 (makes C++-11 flag optional) 2014-11-18 Tommi Mäkitalo * configure.ac: AC_PROG_LIBTOOL is obsolete and replaced by LT_INIT 2014-11-16 Tommi Mäkitalo * src/Makefile.am, src/{ => posix}/daemonize.cpp: move daemonize.cpp to right directory 2014-11-15 Tommi Mäkitalo * src/log.cpp: read logging settings optionally from xml attributes 2014-11-14 Tommi Mäkitalo * demo/Makefile.am, demo/xmlreader.cpp: add a demo for reading a object from xml 2014-11-14 Tommi Mäkitalo * include/cxxtools/xml/xml.h, test/xmldeserializer-test.cpp: minor fix in xml deserialization helper object 2014-11-14 Tommi Mäkitalo * include/cxxtools/xml/startelement.h, include/cxxtools/xml/xml.h, include/cxxtools/xml/xmldeserializer.h, src/xml/startelement.cpp, src/xml/xmldeserializer.cpp, src/xml/xmlreader.cpp, test/Makefile.am, test/xmldeserializer-test.cpp, test/xmlreader-test.cpp: optionally read xml attributes into SerializationInfo members in xml deserializer 2014-10-30 Tommi Mäkitalo * ChangeLog: update ChangeLog 2014-10-30 Tommi Mäkitalo * .gitignore, demo/Makefile.am, demo/jsonbeautify.cpp: add demo programm which formats a json structure using cxxtools 2014-10-28 Tommi Mäkitalo * .gitignore, m4/ax_cxx_compile_stdcxx_11.m4: add macro for checking C++11 compiler flag to list of local macros 2014-10-28 Tommi Mäkitalo * : commit fe57376b36cf07959b3347d56b1e818dedd4f67f Author: Tommi Mäkitalo Date: Wed Oct 22 09:32:26 2014 +0200 2014-10-20 Tommi Mäkitalo * src/http/clientimpl.cpp: discard previous http reply on execute if not fully read in http client 2014-10-20 Tommi Mäkitalo * src/http/clientimpl.cpp: initialize reading body in http client as soon as possible 2014-10-20 Tommi Mäkitalo * include/cxxtools/limitstream.h: fix data type in limitstream 2014-10-19 Tommi Mäkitalo * test/string-test.cpp: enable more unit tests for string class 2014-10-19 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/api.h, include/cxxtools/application.h, include/cxxtools/base64codec.h, include/cxxtools/bin/deserializer.h, include/cxxtools/char.h, include/cxxtools/clock.h, include/cxxtools/condition.h, include/cxxtools/conversionerror.h, include/cxxtools/convert.h, include/cxxtools/csvdeserializer.h, include/cxxtools/csvparser.h, include/cxxtools/date.h, include/cxxtools/datetime.h, include/cxxtools/decomposer.h, include/cxxtools/deserializer.h, include/cxxtools/eventloop.h, include/cxxtools/eventsink.h, include/cxxtools/eventsource.h, include/cxxtools/facets.h, include/cxxtools/filedevice.h, include/cxxtools/formatter.h, include/cxxtools/http/api.h, include/cxxtools/http/client.h, include/cxxtools/http/messageheader.h, include/cxxtools/http/reply.h, include/cxxtools/http/replyheader.h, include/cxxtools/http/request.h, include/cxxtools/http/requestheader.h, include/cxxtools/http/responder.h, include/cxxtools/http/server.h, include/cxxtools/http/service.h, include/cxxtools/iodevice.h, include/cxxtools/ioerror.h, include/cxxtools/iostream.h, include/cxxtools/iso8859_15codec.h, include/cxxtools/iso8859_1codec.h, include/cxxtools/jsondeserializer.h, include/cxxtools/jsonparser.h, include/cxxtools/mutex.h, include/cxxtools/net/addrinfo.h, include/cxxtools/net/tcpserver.h, include/cxxtools/net/tcpsocket.h, include/cxxtools/net/uri.h, include/cxxtools/pipe.h, include/cxxtools/posix/pipe.h, include/cxxtools/propertiesdeserializer.h, include/cxxtools/selectable.h, include/cxxtools/selector.h, include/cxxtools/semaphore.h, include/cxxtools/serializationerror.h, include/cxxtools/serializationinfo.h, include/cxxtools/serviceregistry.h, include/cxxtools/streambuffer.h, include/cxxtools/string.h, include/cxxtools/stringstream.h, include/cxxtools/textbuffer.h, include/cxxtools/textcodec.h, include/cxxtools/textstream.h, include/cxxtools/time.h, include/cxxtools/timer.h, include/cxxtools/typetraits.h, include/cxxtools/unit/registertest.h, include/cxxtools/utf8codec.h, include/cxxtools/xml/api.h, include/cxxtools/xml/characters.h, include/cxxtools/xml/comment.h, include/cxxtools/xml/doctypedeclaration.h, include/cxxtools/xml/enddocument.h, include/cxxtools/xml/endelement.h, include/cxxtools/xml/entityresolver.h, include/cxxtools/xml/namespace.h, include/cxxtools/xml/namespacecontext.h, include/cxxtools/xml/node.h, include/cxxtools/xml/processinginstruction.h, include/cxxtools/xml/startelement.h, include/cxxtools/xml/xmlerror.h, include/cxxtools/xml/xmlreader.h, include/cxxtools/xml/xmlwriter.h, include/cxxtools/xmlrpc/api.h, include/cxxtools/xmlrpc/client.h, include/cxxtools/xmlrpc/formatter.h, include/cxxtools/xmlrpc/httpclient.h, include/cxxtools/xmlrpc/responder.h, include/cxxtools/xmlrpc/scanner.h, include/cxxtools/xmlrpc/service.h, src/applicationimpl.h, src/conditionimpl.h, src/filedeviceimpl.h, src/http/clientimpl.h, src/http/notfoundresponder.h, src/http/parser.h, src/pipeimpl.h, src/selectorimpl.h, src/semaphoreimpl.h, src/xmlrpc/clientimpl.h, test/string-test.cpp: remove those CXXTOOLS.*_API macros - they were never used anyway 2014-10-19 Tommi Mäkitalo * include/cxxtools/http/client.h, include/cxxtools/net/uri.h, src/uri.cpp: fix construction of net::Uri class 2014-10-19 Tommi Mäkitalo * include/cxxtools/http/client.h: update documentation of http client class 2014-10-19 Tommi Mäkitalo * src/json/httpclientimpl.cpp: fix logging category in json http client 2014-10-19 Tommi Mäkitalo * test/Makefile.am, test/rpcbenchasyncclient.cpp: add rpc benchmark client which uses asyncronous requests 2014-10-19 Tommi Mäkitalo * include/cxxtools/limitstream.h, src/http/clientimpl.cpp, src/http/clientimpl.h: use limit stream in http client when reading body with chunked encoding 2014-10-19 Tommi Mäkitalo * src/hdstream.cpp: minor fix: make hex digits const in hdstream 2014-10-19 Tommi Mäkitalo * .gitignore: add httpclient to .gitignore 2014-10-18 Tommi Mäkitalo * src/connectable.cpp: make disconnection signal slot connections more robust 2014-10-16 Tommi Mäkitalo * include/cxxtools/limitstream.h: some small fixes in limitstreams (make count optional in constructor; pass streambuf as pointer instead of a reference) 2014-10-16 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/limitstream.h, test/Makefile.am, test/limitstream-test.cpp: new (std::)streams which limit the number of characters to read or write 2014-10-11 Tommi Mäkitalo * utils/{xmlrpcservice.pl => rpcservice.pl}: update service generator helper script 2014-10-09 Tommi Mäkitalo * demo/httpclient.cpp, demo/httprequest.cpp, include/cxxtools/http/client.h, include/cxxtools/http/reply.h, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h, src/http/socket.cpp, src/xmlrpc/clientimpl.cpp, src/xmlrpc/clientimpl.h, src/xmlrpc/httpclientimpl.cpp, src/xmlrpc/httpclientimpl.h, src/xmlrpc/responder.cpp: improve http client: return http reply object in get and post methods to make accessing headers and others easier 2014-10-09 Tommi Mäkitalo * src/pipeimpl.cpp, src/tcpserver.cpp, src/tcpsocket.cpp: remove some unused includes 2014-10-08 Tommi Mäkitalo * include/cxxtools/xml/xmldeserializer.h, include/cxxtools/xml/xmlformatter.h, src/connection.cpp, src/library.cpp, src/libraryimpl.h, src/tcpserver.cpp, src/tcpsocket.cpp, src/xml/xmldeserializer.cpp, src/xml/xmlformatter.cpp: remove use of std::auto_ptr 2014-10-08 Tommi Mäkitalo * demo/Makefile.am, demo/httpclient.cpp, include/cxxtools/net/addrinfo.h, src/http/client.cpp, src/http/clientimpl.h: improve http client: use username and password from uri; make AddrInfo comparable; add httpclient demo 2014-10-08 Tommi Mäkitalo * test/serializer-bench.cpp: improve serialization benchmark: add flags to select different formats 2014-10-08 Tommi Mäkitalo * include/cxxtools/query_params.h, src/query_params.cpp, test/query_params-test.cpp: improve cxxtools::QueryParams: add methods set and remove 2014-10-08 Tommi Mäkitalo * .gitignore: update gitignore 2014-10-08 Tommi Mäkitalo * configure.ac: use c++ 11 mode of compiler if supported for better optimization 2014-10-08 Tommi Mäkitalo * include/cxxtools/http/client.h, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h: extend get method and new post method in http client class 2014-10-08 Tommi Mäkitalo * src/http/clientimpl.cpp: optimize reading http body in http client in sync mode 2014-09-28 Tommi Mäkitalo * src/connectable.cpp: another minor cleanup in connectable stuff 2014-09-28 Tommi Mäkitalo * : commit 1dd867a38ead22330732931be4741bc99cfcd21c Author: Tommi Mäkitalo Date: Sun Sep 28 19:20:25 2014 +0200 2014-09-18 Tommi Mäkitalo * src/json/httpclientimpl.cpp, src/json/httpservice.cpp: fix 2 more include regarding strncasecmp 2014-09-17 Tommi Mäkitalo * src/xmlrpc/httpclientimpl.cpp: fix include - strncasecmp is defined in strings.h, not in string.h 2014-08-28 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, src/serializationinfo.cpp: inline copy and assignment of SerializationInfo 2014-08-27 Tommi Mäkitalo * doc/binserialization.txt, src/bin/formatter.cpp, src/bin/parser.cpp, test/binrpc-test.cpp, test/color.h, test/rpcbenchclient.cpp, test/rpcbenchserver.cpp: incompatible change in binary serialization format: save one byte for each member of a object 2014-08-27 Tommi Mäkitalo * src/iodeviceimpl.cpp: fix inifinite wait - was broken after replacing timeouts with cxxtools::Timespan 2014-08-26 Tommi Mäkitalo * src/bin/formatter.cpp: another place, where streambuf should be used in binary serializer 2014-08-26 Tommi Mäkitalo * src/bin/deserializer.cpp, src/bin/formatter.cpp: optimize binary serializer and deserializer: it is faster to read and write from streambuf instead of istream 2014-08-26 Tommi Mäkitalo * src/tcpsocketimpl.cpp: fix debug output 2014-08-26 Tommi Mäkitalo * src/log.cpp: reset format flags in logger when reusing ostringstream 2014-08-26 Tommi Mäkitalo * test/serializer-bench.cpp: minor code cleanup in serializer benchmark process 2014-08-24 Tommi Mäkitalo * doc/binserialization.txt, include/cxxtools/bin/formatter.h, include/cxxtools/bin/parser.h, src/bin/formatter.cpp, src/bin/parser.cpp: optimization in binary format: add dictionary feature to shorten multiple occurencies of names or type names 2014-08-21 Tommi Mäkitalo * test/serializer-bench.cpp: fix serialization benchmark program; was broken after api change in deserializers 2014-08-18 Tommi Mäkitalo * include/cxxtools/csvdeserializer.h: fix cxxtools::CsvDeserializer::toObject; was broken after api change in deseriailzers 2014-08-16 Tommi Mäkitalo * include/cxxtools/bin/deserializer.h, include/cxxtools/bin/parser.h, src/bin/deserializer.cpp, src/bin/parser.cpp, src/bin/responder.cpp: cleanup api of binary deserializer 2014-08-16 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/bin/deserializer.h, include/cxxtools/bin/{valueparser.h => parser.h}, src/bin/Makefile.am, src/bin/deserializer.cpp, src/bin/{valueparser.cpp => parser.cpp}, src/bin/responder.cpp, src/bin/scanner.h: rename cxxtools::bin::ValueParser to cxxtools::bin::Parser.h 2014-08-16 Tommi Mäkitalo * : commit d450a570b4865d6d059e45674456c1acee4857f1 Author: Jonas Platte Date: Fri Aug 15 23:31:23 2014 +0200 2014-03-15 Jonas Platte * include/cxxtools/pool.h: Code style update for pool.h 2014-03-11 Jonas Platte * src/filedeviceimpl.cpp, src/filedeviceimpl.h, src/fileimpl.cpp, src/http/messageheader.cpp, src/iconvstream.cpp, src/uri.cpp: Fixed some simple issues found by cppcheck 2014-03-10 Jonas Platte * src/Makefile.am: Explicitly enabled subdir-objects option (to remove warnings) 2014-08-14 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/bin/deserializer.h, include/cxxtools/bin/valueparser.h, include/cxxtools/csv.h, include/cxxtools/csvdeserializer.h, include/cxxtools/csvparser.h, include/cxxtools/deserializer.h, include/cxxtools/deserializerbase.h, include/cxxtools/json/responder.h, include/cxxtools/jsondeserializer.h, include/cxxtools/jsonparser.h, include/cxxtools/propertiesdeserializer.h, include/cxxtools/propertiesparser.h, include/cxxtools/textbuffer.h, include/cxxtools/xml/xmldeserializer.h, include/cxxtools/xmlrpc/responder.h, include/cxxtools/xmlrpc/scanner.h, src/bin/deserializer.cpp, src/bin/responder.cpp, src/bin/responder.h, src/bin/rpcclientimpl.h, src/bin/scanner.cpp, src/bin/scanner.h, src/bin/valueparser.cpp, src/csvdeserializer.cpp, src/csvparser.cpp, src/deserializer.cpp, src/json/httpclientimpl.cpp, src/json/httpclientimpl.h, src/json/responder.cpp, src/json/responder.h, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h, src/json/scanner.cpp, src/json/scanner.h, src/jsondeserializer.cpp, src/jsonparser.cpp, src/propertiesdeserializer.cpp, src/propertiesparser.cpp, src/xml/xmldeserializer.cpp, src/xmlrpc/clientimpl.h, src/xmlrpc/scanner.cpp, test/binserializer-test.cpp, test/csvdeserializer-test.cpp, test/json-test.cpp, test/properties-test.cpp, test/xmlserializer-test.cpp: refactor deserializers to ease writing e.g. non blocking network servers or clients 2014-08-05 Tommi Mäkitalo * test/serializer-bench.cpp: fix output of serializer-bench (unit is output from cxxtools::Timespan already) 2014-08-05 Tommi Mäkitalo * demo/Makefile.am, test/Makefile.am, {demo => test}/logbench.cpp: move logbench from demo to test directory and configure logging in logbench using api instead of a configurationfile for better control 2014-08-04 Tommi Mäkitalo * src/log.cpp: fix race condition in logger 2014-08-01 Tommi Mäkitalo * configure.ac, src/threadimpl.cpp: Thread::sleep improvement: use nanosleep when available for higher resolution and be aware that usleep is not able to sleep longer than one second 2014-07-31 Tommi Mäkitalo * demo/timer.cpp, include/cxxtools/eventloop.h, include/cxxtools/selector.h: add some documentation in timer and selector classes 2014-07-31 Tommi Mäkitalo * test/serializer-bench.cpp: optimize serializer benchmark process by preallocating member names in serialization operators 2014-07-30 Tommi Mäkitalo * include/cxxtools/eventloop.h, include/cxxtools/selector.h, src/eventloop.cpp, src/selector.cpp, src/selectorimpl.cpp, src/selectorimpl.h: add waitUntil method to selector to get higher precision timer 2014-07-28 Tommi Mäkitalo * include/cxxtools/serializationinfo.h, test/serializationinfo-test.cpp: accept slightly larger values than fits into float or double in serialization to workaround range errors due to rounding errors 2014-07-27 Tommi Mäkitalo * configure.ac: reorder configure.ac to remove autoconf warning 2014-07-27 Tommi Mäkitalo * configure.ac, demo/timer.cpp, src/selectorimpl.cpp: use ppoll when available for waiting to get a more accurate timer 2014-07-27 Tommi Mäkitalo * include/cxxtools/bin/rpcserver.h, include/cxxtools/eventloop.h, include/cxxtools/filedevice.h, include/cxxtools/http/client.h, include/cxxtools/http/server.h, include/cxxtools/json/rpcserver.h, include/cxxtools/net/tcpserver.h, include/cxxtools/net/tcpsocket.h, include/cxxtools/selectable.h, include/cxxtools/selector.h, include/cxxtools/timespan.h, src/bin/rpcclientimpl.cpp, src/bin/rpcclientimpl.h, src/eventloop.cpp, src/filedevice.cpp, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h, src/http/server.cpp, src/http/serverimplbase.h, src/iodeviceimpl.cpp, src/iodeviceimpl.h, src/json/httpclientimpl.cpp, src/json/httpclientimpl.h, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h, src/pipeimpl.cpp, src/pipeimpl.h, src/selectableimpl.h, src/selector.cpp, src/selectorimpl.cpp, src/selectorimpl.h, src/tcpserver.cpp, src/tcpserverimpl.cpp, src/tcpserverimpl.h, src/tcpsocket.cpp, src/timespan.cpp, src/xmlrpc/clientimpl.h, test/timespan-test.cpp: change datatype for timeouts from size_t to cxxtools::Timespan 2014-07-22 Tommi Mäkitalo * include/cxxtools/event.h, src/eventloop.cpp: change cxxtools::Event::clone method to return a pointer instead of a reference 2014-07-22 Tommi Mäkitalo * include/cxxtools/selector.h: don't use cxxtools::NonCopyable in cxxtools::SelectorBase (I don't like cxxtools::NonCopyable any more) 2014-07-22 Tommi Mäkitalo * include/cxxtools/datetime.h, src/clockimpl.cpp: optimize cxxtools::Clock::getSystemTime() 2014-07-22 Tommi Mäkitalo * include/cxxtools/event.h, include/cxxtools/eventloop.h, include/cxxtools/singleton.h, src/eventloop.cpp: remove allocator stuff from cxxtools::Event; cxxtools::Allocator was removed already 2014-07-21 Tommi Mäkitalo * demo/.gitignore: add timer binary to .gitignore 2014-07-21 Tommi Mäkitalo * include/cxxtools/selector.h, src/selector.cpp: fix timer (was broken on 64 bit systems) 2014-07-15 Tommi Mäkitalo * include/cxxtools/clock.h, src/clock.cpp, src/clockimpl.h: fix double free corruption when cxxtools::Clock is copied or assigned 2014-07-15 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/allocator.h: remove unused class cxxtools::Allocator 2014-07-14 Tommi Mäkitalo * include/cxxtools/deserializerbase.h, include/cxxtools/serializationinfo.h, src/deserializer.cpp, src/serializationinfo.cpp, src/settingsreader.cpp, src/settingsreader.h: remove parent attribute from serializationinfo 2014-07-11 Tommi Mäkitalo * demo/timer.cpp: forgot to revert log level contants in demo/timer.cpp 2014-07-10 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h, src/log.cpp: make log level constants uppercase again since changing it changed the output format 2014-06-28 Tommi Mäkitalo * src/serializationinfo.cpp: optimize serialization of hierarchical structures by using swap when resizing subnodes vector 2014-05-30 Tommi Mäkitalo * demo/timer.cpp, include/cxxtools/log/cxxtools.h, src/log.cpp: make log level constants (fatal, error, warn,...) lowercase since all uppercase is reserved for macros 2014-05-29 Tommi Mäkitalo * src/bin/rpcclientimpl.cpp, src/json/rpcclientimpl.cpp: optimization of json and binary rpc clients 2014-05-29 Tommi Mäkitalo * include/cxxtools/remoteprocedure.h, include/cxxtools/remoteresult.h, test/binrpc-test.cpp, test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp, test/xmlrpc-test.cpp, test/xmlrpccallback-test.cpp: make result of rpc client call modifiable, so that it can be moved or swapped away 2014-05-29 Tommi Mäkitalo * src/bin/rpcclientimpl.cpp, src/json/responder.cpp, src/json/responder.h, src/json/rpcclientimpl.cpp, test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp: fix json rpc error reply 2014-05-28 Tommi Mäkitalo * src/log.cpp: not all platforms have a O_CLOEXEC flag for open(2) 2014-05-07 Tommi Mäkitalo * src/base64codec.cpp, test/base64-test.cpp: fix base64 encoder 2014-04-13 Tommi Mäkitalo * src/bin/rpcserver.cpp, test/rpcbenchserver.cpp: fix registering service with empty domain in binary rpc server 2014-04-13 Tommi Mäkitalo * src/jsonformatter.cpp: optimization in copying preformatted json data in json serializer 2014-04-12 Tommi Mäkitalo * src/jsonformatter.cpp, test/jsonserializer-test.cpp: add feature to put preformatted json data into a object formatted by json serializer 2014-04-09 Tommi Mäkitalo * include/cxxtools/utf8.h: make conversion from utf-8 to unicode string cxxtools::String implicit in utf-8 helper 2014-04-09 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/utf8.h, test/utf8-test.cpp: add easier interface to utf-8 conversions 2014-04-08 Tommi Mäkitalo * include/cxxtools/serializationinfo.h: add serialization and deserialization operators for cxxtools::Char (unicode char) 2014-03-21 Tommi Mäkitalo * src/json/responder.cpp, src/json/responder.h, src/json/socket.cpp: fix error reporting in json rpc 2014-03-16 Tommi Mäkitalo * src/tcpsocketimpl.cpp: improve readability 2014-03-11 Tommi Mäkitalo * src/tcpsocketimpl.cpp: add missing include for os without inet_ntop like haiku 2014-02-27 Tommi Mäkitalo * : commit e54ad6981f5b057abce25deba3b03bb79c46cdfd Author: Tommi Mäkitalo Date: Sun Feb 23 10:28:10 2014 +0100 2014-02-19 Tommi Mäkitalo * doc/json-howto.markdown, include/cxxtools/string.h: make type conversion explicit to reduce compiler warnings 2014-02-18 mikg0 * doc/serialization-howto.markdown: Update serialization-howto.markdown Just some grammar fixes. 2014-02-17 Tommi Mäkitalo * doc/csv-howto.markdown: change title of csv howto 2014-02-17 Tommi Mäkitalo * doc/csv-howto.markdown: write csv howto 2014-02-16 Tommi Mäkitalo * doc/csv-howto.markdown: start writing csv howto 2014-02-16 Tommi Mäkitalo * : commit 1fa0d97c2b12bf18edcc26e930e61a93b72f2caa Author: Tommi Mäkitalo Date: Sun Feb 16 22:05:51 2014 +0100 2014-02-07 Tommi Mäkitalo * demo/netcat.cpp: fix netcat demo program: omitting ip switch -i must not lead to a crash 2014-02-01 Tommi Mäkitalo * include/cxxtools/datetime.h, include/cxxtools/time.h, src/datetime.cpp, src/time.cpp, test/datetime-test.cpp, test/time-test.cpp: add format sepcifier 'k' for fixed 3 digit milliseconds to cxxtools::Time and cxxtools::Datetime 2014-01-30 Tommi Mäkitalo * include/cxxtools/datetime.h, include/cxxtools/time.h, src/datetime.cpp, src/time.cpp: add %K format specifier to datetime and time parser as in formatter 2014-01-30 Tommi Mäkitalo * include/cxxtools/datetime.h, include/cxxtools/time.h, src/datetime.cpp, src/time.cpp, test/datetime-test.cpp, test/time-test.cpp: change format %J back to its original format and add %K for 3 digits milliseconds in time and datetime format 2014-01-30 Tommi Mäkitalo * src/datetime.cpp, src/time.cpp, test/datetime-test.cpp, test/time-test.cpp: change format %J in time and datetime to use always 3 digits 2014-01-21 Tommi Mäkitalo * include/cxxtools/json.h, include/cxxtools/serializationinfo.h, include/cxxtools/xml/xml.h: update documentation 2014-01-04 Tommi Mäkitalo * include/cxxtools/timespan.h: improve documentation of cxxtools::Timespan 2014-01-04 Tommi Mäkitalo * : commit e66b45df07ae1b8adaf0875c5651d7b1634e11d8 Author: Tommi Mäkitalo Date: Thu Jan 2 23:09:22 2014 +0100 2014-01-02 Tommi Mäkitalo * include/cxxtools/timespan.h: fix typo in comment 2014-01-02 Tommi Mäkitalo * test/timespan-test.cpp: fix rounding problem in timespan unit test 2013-12-31 Tommi Mäkitalo * include/cxxtools/timespan.h: add documentation to cxxtools::Timespan 2013-12-31 Tommi Mäkitalo * demo/rpcasyncaddclient.cpp, include/cxxtools/remoteprocedure.h: use timespan in cxxtools::Remoteprocedure::end to specify timeout also 2013-12-31 Tommi Mäkitalo * test/timespan-test.cpp: fix timespan unittest 2013-12-31 Tommi Mäkitalo * demo/rpcechoclient.cpp, include/cxxtools/bin/rpcclient.h, include/cxxtools/eventloop.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/remoteclient.h, include/cxxtools/selectable.h, include/cxxtools/selector.h, include/cxxtools/timespan.h, include/cxxtools/xmlrpc/client.h, include/cxxtools/xmlrpc/httpclient.h, src/bin/rpcclient.cpp, src/json/httpclient.cpp, src/json/rpcclient.cpp, src/selectable.cpp, src/selector.cpp, src/timespan.cpp, src/xmlrpc/client.cpp, src/xmlrpc/httpclient.cpp: use cxxtools::Timespan to specify timeout in remote client and selector 2013-12-23 Tommi Mäkitalo * include/cxxtools/condition.h, include/cxxtools/thread.h, include/cxxtools/time.h, include/cxxtools/timer.h, include/cxxtools/timespan.h, src/condition.cpp, src/selector.cpp, src/thread.cpp, src/timer.cpp, src/timespan.cpp, test/datetime-test.cpp, test/serializer-bench.cpp, test/time-test.cpp, test/timespan-test.cpp: rework cxxtools::Timespan object and create WeakTimespan objects with implicit conversions 2013-12-23 Tommi Mäkitalo * src/conditionimpl.cpp: fix timeout handling of cxxtools::Condition::wait 2013-12-22 Tommi Mäkitalo * include/cxxtools/timespan.h, test/timespan-test.cpp: add converter functions from cxxtools::Timespan to microseconds, milliseconds, seconds, minutes hours and days 2013-12-20 Tommi Mäkitalo * include/cxxtools/condition.h: add missing return in Condition::wait 2013-12-20 Tommi Mäkitalo * include/cxxtools/condition.h, include/cxxtools/timer.h, src/condition.cpp, src/conditionimpl.cpp, src/conditionimpl.h: use cxxtools::Timespan for specifiying timespans in timer and timed wait in condition 2013-12-14 Tommi Mäkitalo * : commit 142bb2589dc184709857c08c1e10570947c444e3 Author: Tommi Mäkitalo Date: Sat Dec 14 15:12:24 2013 +0100 2013-12-09 Tommi Mäkitalo * include/cxxtools/thread.h, src/thread.cpp, src/threadimpl.cpp, src/threadimpl.h: use cxxtools::Timespan to specify the time to sleep in cxxtools::Thread::sleep 2013-12-09 Tommi Mäkitalo * include/cxxtools/timespan.h, test/Makefile.am, test/timespan-test.cpp: add helper functions to make creating cxxtools::Timespan more easily and more readable 2013-11-29 Tommi Mäkitalo * README.git: update installation hints 2013-11-21 Tommi Mäkitalo * : commit 549d9f6a6943d908b47f5a318a8f4de5e498154a Author: Tommi Mäkitalo Date: Thu Nov 21 15:38:56 2013 +0100 2013-11-13 Tommi Mäkitalo * include/cxxtools/jsonparser.h, src/jsonparser.cpp: fix memory leak in json deserializer 2013-11-05 Tommi Mäkitalo * doc/binaryrpc-howto.markdown, doc/jsonrpc-howto.markdown, doc/xmlrpc-howto.markdown: fix some typos in rpc howto documents 2013-11-03 Tommi Mäkitalo * : commit 645dedf575da32198ac815655e5c6e5cd5cc4461 Author: Tommi Mäkitalo Date: Sun Nov 3 20:59:41 2013 +0100 2013-10-31 Tommi Mäkitalo * src/http/messageheader.cpp: use memmove instead of memcpy when removing message header since the areas may overlap 2013-10-29 Tommi Mäkitalo * doc/binaryrpc-howto.markdown, doc/jsonrpc-howto.markdown, doc/xmlrpc-howto.markdown: add documentation about exceptions and a simpler way to execute remote procedures asyncronously to binrpc howto and xmlrpc howto also 2013-10-28 Tommi Mäkitalo * doc/jsonrpc-howto.markdown: add documentation about exceptions and a simpler way to execute remote procedures asyncronously into jsonrpc howto 2013-10-28 Tommi Mäkitalo * demo/timer: remove generated file 2013-10-26 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h: rename log_define_impl to log_define_instance 2013-10-26 Tommi Mäkitalo * demo/timer: remove generated file 2013-10-26 Tommi Mäkitalo * : Merge https://github.com/AndreasWelchlin/cxxtools 2013-10-24 Tommi Mäkitalo * include/cxxtools/timespan.h, src/timespan.cpp: add serialization operators to cxxtools::Timespan 2013-10-24 Andreas Welchlin * demo/timer, include/cxxtools/clock.h, src/clock.cpp, src/clockimpl.cpp, src/clockimpl.h: Minor changes in Clock 2013-10-23 Tommi Mäkitalo * demo/Makefile.am, demo/timer.cpp, include/cxxtools/timer.h, src/timer.cpp: add optional selector parameter to constructor of cxxtools::Timer and add demo for timer 2013-10-23 Tommi Mäkitalo * include/cxxtools/time.h, include/cxxtools/timer.h, include/cxxtools/timespan.h, src/datetime.cpp, src/timer.cpp, test/datetime-test.cpp, test/time-test.cpp: extend cxxtools::Timer with fixed start time and one shot timers 2013-10-19 Tommi Mäkitalo * test/binrpc-test.cpp, test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp, test/xmlrpc-test.cpp, test/xmlrpccallback-test.cpp: remove wrong log_trace statements 2013-10-19 Tommi Mäkitalo * test/binrpc-test.cpp, test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp, test/xmlrpc-test.cpp: implement unittest for multiple parallel rpc calls 2013-10-19 Tommi Mäkitalo * src/xmlrpc/httpclient.cpp: fix copy and assignment of xmlrpc client 2013-10-19 Tommi Mäkitalo * test/jsonrpc-test.cpp, test/jsonrpchttp-test.cpp, test/xmlrpc-test.cpp: add tests for prepareConnect and connect methods to xmlrpc, jsonrpc and jsonhttprpc unit tests also 2013-10-19 Tommi Mäkitalo * src/json/httpclient.cpp: add missing connect method to json rpc http client 2013-10-19 Tommi Mäkitalo * test/binrpc-test.cpp: add tests for prepareConnect and connect functions to binary rpc unit test 2013-10-19 Tommi Mäkitalo * include/cxxtools/bin/rpcclient.h, include/cxxtools/http/client.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/xmlrpc/httpclient.h: add constructors just with a selector to http client and rpc clients 2013-10-19 Tommi Mäkitalo * include/cxxtools/bin/rpcclient.h, include/cxxtools/http/client.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/xmlrpc/httpclient.h, src/bin/rpcclient.cpp, src/bin/rpcclientimpl.cpp, src/bin/rpcclientimpl.h, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h, src/json/httpclient.cpp, src/json/httpclientimpl.h, src/json/rpcclient.cpp, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h, src/xmlrpc/client.cpp, src/xmlrpc/httpclient.cpp, src/xmlrpc/httpclientimpl.cpp, src/xmlrpc/httpclientimpl.h: split connect method of rpc clients into prepareConnect and connect and delay instantation of impl classes 2013-10-12 Tommi Mäkitalo * : commit 3b6c92995064fdbd747f16364a7766bea570cb95 Author: Tommi Mäkitalo Date: Wed Oct 9 22:19:42 2013 +0200 2013-10-09 Tommi Mäkitalo * include/cxxtools/bin/rpcclient.h, src/bin/rpcclient.cpp: passing domain to rpc client was broken with the new realConnect parameter - fixed 2013-10-09 Tommi Mäkitalo * include/cxxtools/date.h, include/cxxtools/datetime.h, include/cxxtools/time.h, src/Makefile.am, src/date.cpp, src/datetime.cpp, src/dateutils.cpp, src/dateutils.h, src/time.cpp, test/Makefile.am, test/date-test.cpp, test/datetime-test.cpp, test/time-test.cpp: add conversion and formatting methods to Date, Time and DateTime classes 2013-10-04 Tommi Mäkitalo * include/cxxtools/csvdeserializer.h, include/cxxtools/jsondeserializer.h, src/csvdeserializer.cpp, src/jsondeserializer.cpp: generalize input stream of csv and json deserializer 2013-10-04 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/iso8859_15codec.h, include/cxxtools/iso8859_1codec.h, src/Makefile.am, src/iso8859_15codec.cpp, src/iso8859_1codec.cpp, test/Makefile.am, test/iso8859_1-test.cpp, test/iso8859_15-test.cpp: implement codecs for ISO-8859-1 and ISO-8859-15 2013-10-03 Tommi Mäkitalo * include/cxxtools/net/uri.h: add documentation for cxxtools::Uri 2013-10-03 Tommi Mäkitalo * doc/asyncronousIO.md, doc/connection.md, include/cxxtools/http/client.h, src/http/client.cpp: add documentation for http client 2013-10-03 Tommi Mäkitalo * README, autogen.sh: autoscan.sh is obsolete - use "autoreconf -i" instead 2013-10-02 Tommi Mäkitalo * demo/.gitignore, demo/Makefile.am, demo/rpcparallelecho.cpp: add new demo program for parallel rpc call using cxxtools::Selector 2013-10-02 Tommi Mäkitalo * include/cxxtools/quotedprintablestream.h, src/quotedprintablestream.cpp, test/Makefile.am, test/quotedprintable-test.cpp: fix quoted printable encoder, add unit test and comments 2013-10-02 Tommi Mäkitalo * src/bin/rpcclientimpl.cpp, src/bin/rpcclientimpl.h: timeout must be initialized in binary rpc client 2013-09-30 Tommi Mäkitalo * include/cxxtools/remoteresult.h: make cxxtools::RemoteResult copyable which maks RemoteProcedure copyable 2013-09-30 Tommi Mäkitalo * include/cxxtools/bin/rpcclient.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/xmlrpc/httpclient.h, src/bin/rpcclient.cpp, src/json/httpclient.cpp, src/json/rpcclient.cpp, src/xmlrpc/httpclient.cpp: reference must be const in copy constructor of rpc client classes 2013-09-30 Tommi Mäkitalo * demo/rpcechoclient.cpp: fix typo in comment 2013-09-30 Tommi Mäkitalo * include/cxxtools/bin/rpcclient.h, include/cxxtools/http/client.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/xmlrpc/httpclient.h, src/bin/rpcclient.cpp, src/bin/rpcclientimpl.cpp, src/bin/rpcclientimpl.h, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h, src/json/httpclient.cpp, src/json/httpclientimpl.h, src/json/rpcclient.cpp, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h, src/xmlrpc/httpclient.cpp, src/xmlrpc/httpclientimpl.h: add realConnect parameter to connect methods in http and rpc client classes 2013-09-29 Tommi Mäkitalo * demo/rpcechoclient.cpp, include/cxxtools/bin/rpcclient.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/remoteclient.h, include/cxxtools/xmlrpc/client.h, src/bin/rpcclient.cpp, src/bin/rpcclientimpl.cpp, src/bin/rpcclientimpl.h, src/json/httpclient.cpp, src/json/httpclientimpl.cpp, src/json/httpclientimpl.h, src/json/rpcclient.cpp, src/json/rpcclientimpl.cpp, src/json/rpcclientimpl.h, src/xmlrpc/client.cpp, src/xmlrpc/clientimpl.cpp, src/xmlrpc/clientimpl.h, src/xmlrpc/httpclientimpl.cpp: add timeout and connect timeout to remote client class 2013-09-29 Tommi Mäkitalo * include/cxxtools/http/client.h, src/http/client.cpp, src/http/clientimpl.cpp, src/http/clientimpl.h: implement separate connectTimeout in http client 2013-09-29 Tommi Mäkitalo * demo/rpcaddclient.cpp: formatting fix 2013-09-18 Tommi Mäkitalo * : commit 470ab6511c745ecd9cf5a22f901f18754cfac686 Author: Tommi Mäkitalo Date: Sun Sep 15 22:59:54 2013 +0200 2013-09-15 Tommi Mäkitalo * doc/binaryrpc-howto.markdown, doc/jsonrpc-howto.markdown, doc/xmlrpc-howto.markdown: new howtos: binaryrpc, jsonrpc, xmlrpc 2013-09-13 Tommi Mäkitalo * doc/jsonquick-howto.markdown, doc/propertiesquick-howto.markdown: add properties quick howto 2013-09-13 Tommi Mäkitalo * doc/jsonquick-howto.markdown: new jsonquick-howto 2013-09-11 Tommi Mäkitalo * : commit 02827b6ea0a631a1617c72782141092f8406d522 Merge: b9981af 18c8021 Author: Tommi Mäkitalo Date: Tue Sep 10 15:21:18 2013 +0200 2013-09-10 Tommi Mäkitalo * src/utf8codec.cpp, test/Makefile.am, test/utf8-test.cpp: process byte order mark in utf-8 codec 2013-09-08 Tommi Mäkitalo * : commit 72fe0b1fc2b355525c90bee6c2f3c686fd77325f Author: Tommi Mäkitalo Date: Sun Sep 8 14:29:35 2013 +0200 2013-09-08 Tommi Mäkitalo * include/cxxtools/bin/serializer.h, include/cxxtools/csv.h, include/cxxtools/json.h, include/cxxtools/jsonserializer.h, include/cxxtools/properties.h, include/cxxtools/xml/xml.h, include/cxxtools/xml/xmlserializer.h: minor changes in serializer classes 2013-09-08 Tommi Mäkitalo * include/cxxtools/refcounted.h, include/cxxtools/signal.h: make cxxtools::RefCounted and cxxtools::AtomicRefCounted copyable 2013-09-08 Tommi Mäkitalo * src/log.cpp: set typename in serialization operator of log configuration 2013-09-08 Tommi Mäkitalo * include/cxxtools/json.h, include/cxxtools/xml/xml.h: add beautify flag to cxxtools::Json and cxxtools::xml::Xml serialization helper 2013-09-07 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h, src/log.cpp: add serialization operator for log configuration 2013-09-07 Tommi Mäkitalo * include/cxxtools/serializationinfo.h: set empty string as default for member name of SeriailzationInfo 2013-09-07 Tommi Mäkitalo * include/cxxtools/json.h: fix json serialization example in comment 2013-09-06 Tommi Mäkitalo * include/cxxtools/bin/rpcclient.h, include/cxxtools/composer.h, include/cxxtools/decomposer.h, include/cxxtools/http/client.h, include/cxxtools/json/httpclient.h, include/cxxtools/json/rpcclient.h, include/cxxtools/xmlrpc/client.h, include/cxxtools/xmlrpc/httpclient.h, src/bin/rpcclient.cpp, src/bin/rpcclientimpl.h, src/http/client.cpp, src/http/clientimpl.h, src/json/httpclient.cpp, src/json/httpclientimpl.h, src/json/rpcclient.cpp, src/json/rpcclientimpl.h, src/xmlrpc/httpclient.cpp, src/xmlrpc/httpclientimpl.h: make cxxtools::RemoteClient and derived and cxxtools::RemoteProcedure copyable 2013-09-01 Tommi Mäkitalo * include/cxxtools/log/cxxtools.h, src/log.cpp: man log configuration easily settable to create a api for setting log configuration and allow resetting log configuration multiple times 2013-09-01 Tommi Mäkitalo * src/http/parser.cpp: do not allow zero char in url of http request 2013-08-29 Tommi Mäkitalo * : commit a614c6e13a839625a7d9b4145aeee53a2cef96e7 Author: Tommi Mäkitalo Date: Thu Aug 29 22:08:34 2013 +0200 2013-08-17 Tommi Mäkitalo * demo/rpcserver.cpp, include/Makefile.am, include/cxxtools/posix/daemonize.h, src/Makefile.am, src/daemonize.cpp: new function cxxtools::posix::daemonize to send the current process to the background 2013-08-10 Tommi Mäkitalo * include/cxxtools/regex.h, src/regex.cpp, test/regex-test.cpp: add subst method to cxxtools::Regex for substituting regular expressions with something 2013-07-28 Tommi Mäkitalo * include/cxxtools/split.h: fix typo in comment 2013-07-17 Tommi Mäkitalo * include/cxxtools/arg.h, include/cxxtools/split.h: 2 minor fixes in api documentation 2013-07-11 Tommi Mäkitalo * doc/json-howto.markdown: fix wrong include in example in json howto document 2013-07-10 Tommi Mäkitalo * configure.ac: disable static build by default and other small cleanups in the build system 2013-07-09 Tommi Mäkitalo * README, configure.in => configure.ac: update build; autoconf wants configure.ac instead of configure.in 2013-07-08 Tommi Mäkitalo * include/cxxtools/jsonparser.h, src/jsonparser.cpp: report line number in exception when parsing json 2013-07-07 Tommi Mäkitalo * include/cxxtools/arg.h, include/cxxtools/byteorder.h, include/cxxtools/char.h, include/cxxtools/dlloader.h, include/cxxtools/selector.h: revise doxygen comments 2013-07-06 Tommi Mäkitalo * include/Makefile.am: put allocator also back into Makefile.am 2013-07-06 Tommi Mäkitalo * include/cxxtools/allocator.h: should not have deleted the allocator - it is used 2013-07-06 Tommi Mäkitalo * include/cxxtools/char.h, include/cxxtools/jsondeserializer.h, include/cxxtools/remoteprocedure.h, include/cxxtools/serviceprocedure.h, include/cxxtools/unit/testmethod.h: cleanup doxygen documentation 2013-07-06 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/allocator.h: remove allocator class 2013-07-05 Tommi Mäkitalo * src/propertiesparser.cpp, test/properties-test.cpp: allow just keys in property files, which defines a empty value 2013-07-05 Tommi Mäkitalo * include/cxxtools/propertiesparser.h, src/propertiesparser.cpp, test/properties-test.cpp: extend properties parser: * allow all non white space characters in the key * accept ':' as separator between key and value * accept just white space as separator between key and value * a backspace as the last character in a line will continue the value and ignore leading white space 2013-07-04 Tommi Mäkitalo * src/propertiesparser.cpp: allow minus sign in keys of property files 2013-06-27 Tommi Mäkitalo * : Merge /run/media/tommi/FC30-3DA9/cxxtools 2013-06-26 Tommi Mäkitalo * demo/Makefile.am, demo/README, demo/deserialization.cpp, demo/serialization.cpp: add serialization and deserialization demo program 2013-06-24 Tommi Mäkitalo * include/Makefile.am, include/cxxtools/properties.h, include/cxxtools/propertiesfile.h, include/cxxtools/propertiesparser.h, src/Makefile.am, src/propertiesdeserializer.cpp, src/propertiesfile.cpp, src/propertiesparser.cpp, test/properties-test.cpp: add helper function cxxtools::Properties for easy reading of properties files from istream rename old cxxtools::Properties to cxxtools::PropertiesFile 2013-06-24 Tommi Mäkitalo * include/cxxtools/csv.h, include/cxxtools/json.h, include/cxxtools/xml/xml.h, test/csvdeserializer-test.cpp, test/csvserializer-test.cpp: add istream operator for csv, json and xml deserialization helpers 2013-06-22 Tommi Mäkitalo * demo/json.cpp, include/Makefile.am, include/cxxtools/csv.h, include/cxxtools/json.h, include/cxxtools/xml/xml.h: add helper classes which makes it easier to write json, csv or xml data to a output stream 2013-06-21 Tommi Mäkitalo * doc/rpc-howto.markdown: remove utf-8 byte order mark from rpc to fix ordering 2013-06-20 Tommi Mäkitalo * configure.in, src/fileimpl.cpp: improve test for sendfile so that mac osx fails as it should since it has a different interface 2013-06-15 Tommi Mäkitalo * src/iconvstream.cpp: add missing return statement 2013-06-14 Tommi Mäkitalo * configure.in, include/cxxtools/file.h, include/cxxtools/fileinfo.h, src/file.cpp, src/fileimpl.cpp, src/fileimpl.h, src/fileinfo.cpp, src/fileinfoimpl.h, test/Makefile.am, test/file-test.cpp: implement cxxtools::File::copy, fixes to cxxtools::File and implement unittests 2013-06-14 Tommi Mäkitalo * .gitignore: add vim swp files to gitignore 2013-06-02 Tommi Mäkitalo * src/tcpserverimpl.cpp, src/tcpsocketimpl.cpp, src/tcpsocketimpl.h: fix formatting IPv6 addresses when converting to string 2013-06-02 Tommi Mäkitalo * doc/json-howto.markdown: new json howto document 2013-06-02 Tommi Mäkitalo * : Merge https://github.com/OlafRadicke/cxxtools 2013-06-02 Tommi Mäkitalo * include/cxxtools/cache.h: allow changing value in cache in put method 2013-06-01 Olaf Radicke * include/cxxtools/jsondeserializer.h, include/cxxtools/jsonserializer.h: I add the very helpful example from Tommi as Doxygen commt. 2013-05-14 Olaf Radicke * : Merge https://github.com/maekitalo/cxxtools 2013-05-11 Tommi Mäkitalo * src/log.cpp: use raw file I/O instead of fstream in logger to improve performance and set O_CLOEXEC (prevent inheritage of log file to child process) 2013-05-10 Tommi Mäkitalo * doc/argument-parsing-howto.markdown, doc/logging-howto.markdown, doc/rpc-howto.markdown: fix spelling 2013-05-10 Tommi Mäkitalo * : commit 7f195300e07dfd82dc81a8835ea02e27435769bc Author: Tommi Mäkitalo Date: Fri May 10 00:12:48 2013 +0200 2013-05-09 Tommi Maekitalo * src/log.cpp: fix formatting of source 2013-05-09 Tommi Mäkitalo * : remove old document 2013-05-10 Tommi Mäkitalo * doc/argument-parsing-howto.markdown, doc/logging-howto.markdown: add 2 new howtos 2013-05-09 Tommi Mäkitalo * src/log.cpp: fix formatting of source 2013-05-09 Tommi Maekitalo * : commit 406d795659ccf2a405e8862455bd0450c865be05 Author: Tommi Mäkitalo Date: Wed May 8 23:43:32 2013 +0200 2013-05-08 Olaf Radicke * : Merge pull request #1 from maekitalo/master Aktualisierung 2013-05-07 Tommi Maekitalo * cxxtools/AUTHORS => AUTHORS, cxxtools/COPYING => COPYING, cxxtools/ChangeLog => ChangeLog, cxxtools/Makefile.am => Makefile.am, cxxtools/NEWS => NEWS, cxxtools/README => README, cxxtools/autogen.sh => autogen.sh, cxxtools/configure.in => configure.in, cxxtools/cxxtools-config.in => cxxtools-config.in, cxxtools/cxxtools.spec => cxxtools.spec, {cxxtools/demo => demo}/Makefile.am, {cxxtools/demo => demo}/README, {cxxtools/demo => demo}/arg-set.cpp, {cxxtools/demo => demo}/arg.cpp, {cxxtools/demo => demo}/cgi.cpp, {cxxtools/demo => demo}/cxxlog.cpp, {cxxtools/demo => demo}/dir.cpp, {cxxtools/demo => demo}/dlloader.cpp, {cxxtools/demo => demo}/execLs.cpp, {cxxtools/demo => demo}/getini.cpp, {cxxtools/demo => demo}/hd.cpp, {cxxtools/demo => demo}/httprequest.cpp, {cxxtools/demo => demo}/httpserver.cpp, {cxxtools/demo => demo}/iconv.cpp, {cxxtools/demo => demo}/json.cpp, {cxxtools/demo => demo}/log.cpp, {cxxtools/demo => demo}/log4cplus.properties, {cxxtools/demo => demo}/log4j.properties, {cxxtools/demo => demo}/logbench.cpp, {cxxtools/demo => demo}/logsh.cpp, {cxxtools/demo => demo}/md5sum.cpp, {cxxtools/demo => demo}/mime.cpp, {cxxtools/demo => demo}/multifstream.cpp, {cxxtools/demo => demo}/netcat.cpp, {cxxtools/demo => demo}/netio.cpp, {cxxtools/demo => demo}/netmsg.cpp, {cxxtools/demo => demo}/pipestream.cpp, {cxxtools/demo => demo}/pool.cpp, {cxxtools/demo => demo}/regex.cpp, {cxxtools/demo => demo}/rpcaddclient.cpp, {cxxtools/demo => demo}/rpcasyncaddclient.cpp, {cxxtools/demo => demo}/rpcechoclient.cpp, {cxxtools/demo => demo}/rpcserver.cpp, {cxxtools/demo => demo}/run_log, {cxxtools/demo => demo}/signals.cpp, {cxxtools/demo => demo}/splitter.cpp, {cxxtools/demo => demo}/thread.cpp, {cxxtools/demo => demo}/threadpool.cpp, {cxxtools/demo => demo}/uuencode.cpp, {cxxtools/doc => doc}/Doxyfile, {cxxtools/doc => doc}/binserialization.txt, {cxxtools/doc => doc}/rpc-howto.markdown, {cxxtools/include => include}/Makefile.am, {cxxtools/include => include}/cxxtools/allocator.h, {cxxtools/include => include}/cxxtools/api.h, {cxxtools/include => include}/cxxtools/application.h, {cxxtools/include => include}/cxxtools/arg.h, {cxxtools/include => include}/cxxtools/argin.h, {cxxtools/include => include}/cxxtools/argout.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.arm.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.avr32.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.mips.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.ppc.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.sparc32.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.sparc64.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.x86.h, {cxxtools/include => include}/cxxtools/atomicity.gcc.x86_64.h, {cxxtools/include => include}/cxxtools/atomicity.generic.h, {cxxtools/include => include}/cxxtools/atomicity.h, {cxxtools/include => include}/cxxtools/atomicity.pthread.h, {cxxtools/include => include}/cxxtools/atomicity.sun.h, {cxxtools/include => include}/cxxtools/atomicity.windows.h, {cxxtools/include => include}/cxxtools/base64codec.h, {cxxtools/include => include}/cxxtools/base64stream.h, {cxxtools/include => include}/cxxtools/bin/deserializer.h, {cxxtools/include => include}/cxxtools/bin/formatter.h, {cxxtools/include => include}/cxxtools/bin/rpcclient.h, {cxxtools/include => include}/cxxtools/bin/rpcserver.h, {cxxtools/include => include}/cxxtools/bin/serializer.h, {cxxtools/include => include}/cxxtools/bin/valueparser.h, {cxxtools/include => include}/cxxtools/byteorder.h, {cxxtools/include => include}/cxxtools/cache.h, {cxxtools/include => include}/cxxtools/callable.h, {cxxtools/include => include}/cxxtools/callable.tpp, {cxxtools/include => include}/cxxtools/cgi.h, {cxxtools/include => include}/cxxtools/char.h, {cxxtools/include => include}/cxxtools/clock.h, {cxxtools/include => include}/cxxtools/composer.h, {cxxtools/include => include}/cxxtools/condition.h, {cxxtools/include => include}/cxxtools/config.h.in, {cxxtools/include => include}/cxxtools/connectable.h, {cxxtools/include => include}/cxxtools/connection.h, {cxxtools/include => include}/cxxtools/constmethod.h, {cxxtools/include => include}/cxxtools/constmethod.tpp, {cxxtools/include => include}/cxxtools/conversionerror.h, {cxxtools/include => include}/cxxtools/convert.h, {cxxtools/include => include}/cxxtools/csvdeserializer.h, {cxxtools/include => include}/cxxtools/csvformatter.h, {cxxtools/include => include}/cxxtools/csvparser.h, {cxxtools/include => include}/cxxtools/csvserializer.h, {cxxtools/include => include}/cxxtools/date.h, {cxxtools/include => include}/cxxtools/datetime.h, {cxxtools/include => include}/cxxtools/decomposer.h, {cxxtools/include => include}/cxxtools/delegate.h, {cxxtools/include => include}/cxxtools/delegate.tpp, {cxxtools/include => include}/cxxtools/deserializer.h, {cxxtools/include => include}/cxxtools/deserializerbase.h, {cxxtools/include => include}/cxxtools/dir.h, {cxxtools/include => include}/cxxtools/directory.h, {cxxtools/include => include}/cxxtools/dlloader.h, {cxxtools/include => include}/cxxtools/doxygen.cfg, {cxxtools/include => include}/cxxtools/event.h, {cxxtools/include => include}/cxxtools/eventloop.h, {cxxtools/include => include}/cxxtools/eventsink.h, {cxxtools/include => include}/cxxtools/eventsource.h, {cxxtools/include => include}/cxxtools/facets.h, {cxxtools/include => include}/cxxtools/fdstream.h, {cxxtools/include => include}/cxxtools/file.h, {cxxtools/include => include}/cxxtools/filedevice.h, {cxxtools/include => include}/cxxtools/fileinfo.h, {cxxtools/include => include}/cxxtools/formatter.h, {cxxtools/include => include}/cxxtools/function.h, {cxxtools/include => include}/cxxtools/function.tpp, {cxxtools/include => include}/cxxtools/hdstream.h, {cxxtools/include => include}/cxxtools/hmac.h, {cxxtools/include => include}/cxxtools/http/api.h, {cxxtools/include => include}/cxxtools/http/client.h, {cxxtools/include => include}/cxxtools/http/messageheader.h, {cxxtools/include => include}/cxxtools/http/reply.h, {cxxtools/include => include}/cxxtools/http/replyheader.h, {cxxtools/include => include}/cxxtools/http/request.h, {cxxtools/include => include}/cxxtools/http/requestheader.h, {cxxtools/include => include}/cxxtools/http/responder.h, {cxxtools/include => include}/cxxtools/http/server.h, {cxxtools/include => include}/cxxtools/http/service.h, {cxxtools/include => include}/cxxtools/iconverter.h, {cxxtools/include => include}/cxxtools/iconvstream.h, {cxxtools/include => include}/cxxtools/iconvwrap.h, {cxxtools/include => include}/cxxtools/inifile.h, {cxxtools/include => include}/cxxtools/iniparser.h, {cxxtools/include => include}/cxxtools/invokable.h, {cxxtools/include => include}/cxxtools/invokable.tpp, {cxxtools/include => include}/cxxtools/iodevice.h, {cxxtools/include => include}/cxxtools/ioerror.h, {cxxtools/include => include}/cxxtools/iostream.h, {cxxtools/include => include}/cxxtools/join.h, {cxxtools/include => include}/cxxtools/json/httpclient.h, {cxxtools/include => include}/cxxtools/json/httpservice.h, {cxxtools/include => include}/cxxtools/json/request.h, {cxxtools/include => include}/cxxtools/json/responder.h, {cxxtools/include => include}/cxxtools/json/rpcclient.h, {cxxtools/include => include}/cxxtools/json/rpcserver.h, {cxxtools/include => include}/cxxtools/jsondeserializer.h, {cxxtools/include => include}/cxxtools/jsonformatter.h, {cxxtools/include => include}/cxxtools/jsonparser.h, {cxxtools/include => include}/cxxtools/jsonserializer.h, {cxxtools/include => include}/cxxtools/library.h, {cxxtools/include => include}/cxxtools/log.h, {cxxtools/include => include}/cxxtools/log/cxxtools.h, {cxxtools/include => include}/cxxtools/loginit.h, {cxxtools/include => include}/cxxtools/lrucache.h, {cxxtools/include => include}/cxxtools/main.h, {cxxtools/include => include}/cxxtools/md5.h, {cxxtools/include => include}/cxxtools/md5stream.h, {cxxtools/include => include}/cxxtools/membar.gcc.arm.h, {cxxtools/include => include}/cxxtools/membar.gcc.h, {cxxtools/include => include}/cxxtools/membar.gcc.mips.h, {cxxtools/include => include}/cxxtools/membar.gcc.nosmp.h, {cxxtools/include => include}/cxxtools/membar.gcc.ppc.h, {cxxtools/include => include}/cxxtools/membar.gcc.sparc32.h, {cxxtools/include => include}/cxxtools/membar.gcc.sparc64.h, {cxxtools/include => include}/cxxtools/membar.gcc.x86.h, {cxxtools/include => include}/cxxtools/membar.h, {cxxtools/include => include}/cxxtools/membar.sun.h, {cxxtools/include => include}/cxxtools/membar.windows.h, {cxxtools/include => include}/cxxtools/method.h, {cxxtools/include => include}/cxxtools/method.tpp, {cxxtools/include => include}/cxxtools/mime.h, {cxxtools/include => include}/cxxtools/multifstream.h, {cxxtools/include => include}/cxxtools/mutex.h, {cxxtools/include => include}/cxxtools/net/addrinfo.h, {cxxtools/include => include}/cxxtools/net/net.h, {cxxtools/include => include}/cxxtools/net/tcpserver.h, {cxxtools/include => include}/cxxtools/net/tcpsocket.h, {cxxtools/include => include}/cxxtools/net/tcpstream.h, {cxxtools/include => include}/cxxtools/net/udp.h, {cxxtools/include => include}/cxxtools/net/udpstream.h, {cxxtools/include => include}/cxxtools/net/uri.h, {cxxtools/include => include}/cxxtools/noncopyable.h, {cxxtools/include => include}/cxxtools/pipe.h, {cxxtools/include => include}/cxxtools/pool.h, {cxxtools/include => include}/cxxtools/posix/commandinput.h, {cxxtools/include => include}/cxxtools/posix/commandoutput.h, {cxxtools/include => include}/cxxtools/posix/exec.h, {cxxtools/include => include}/cxxtools/posix/fork.h, {cxxtools/include => include}/cxxtools/posix/pipe.h, {cxxtools/include => include}/cxxtools/posix/pipestream.h, {cxxtools/include => include}/cxxtools/properties.h, {cxxtools/include => include}/cxxtools/propertiesdeserializer.h, {cxxtools/include => include}/cxxtools/query_params.h, {cxxtools/include => include}/cxxtools/queue.h, {cxxtools/include => include}/cxxtools/quotedprintablestream.h, {cxxtools/include => include}/cxxtools/refcounted.h, {cxxtools/include => include}/cxxtools/regex.h, {cxxtools/include => include}/cxxtools/remoteclient.h, {cxxtools/include => include}/cxxtools/remoteexception.h, {cxxtools/include => include}/cxxtools/remoteprocedure.h, {cxxtools/include => include}/cxxtools/remoteresult.h, {cxxtools/include => include}/cxxtools/selectable.h, {cxxtools/include => include}/cxxtools/selector.h, {cxxtools/include => include}/cxxtools/semaphore.h, {cxxtools/include => include}/cxxtools/serializationerror.h, {cxxtools/include => include}/cxxtools/serializationinfo.h, {cxxtools/include => include}/cxxtools/serviceprocedure.h, {cxxtools/include => include}/cxxtools/serviceregistry.h, {cxxtools/include => include}/cxxtools/settings.h, {cxxtools/include => include}/cxxtools/signal.h, {cxxtools/include => include}/cxxtools/signal.tpp, {cxxtools/include => include}/cxxtools/singleton.h, {cxxtools/include => include}/cxxtools/slot.h, {cxxtools/include => include}/cxxtools/slot.tpp, {cxxtools/include => include}/cxxtools/smartptr.h, {cxxtools/include => include}/cxxtools/sourceinfo.h, {cxxtools/include => include}/cxxtools/split.h, {cxxtools/include => include}/cxxtools/streambuffer.h, {cxxtools/include => include}/cxxtools/streamcounter.h, {cxxtools/include => include}/cxxtools/string.h, {cxxtools/include => include}/cxxtools/string.tpp, {cxxtools/include => include}/cxxtools/stringstream.h, {cxxtools/include => include}/cxxtools/systemerror.h, {cxxtools/include => include}/cxxtools/tee.h, {cxxtools/include => include}/cxxtools/textbuffer.h, {cxxtools/include => include}/cxxtools/textcodec.h, {cxxtools/include => include}/cxxtools/textstream.h, {cxxtools/include => include}/cxxtools/thread.h, {cxxtools/include => include}/cxxtools/threadpool.h, {cxxtools/include => include}/cxxtools/time.h, {cxxtools/include => include}/cxxtools/timer.h, {cxxtools/include => include}/cxxtools/timespan.h, {cxxtools/include => include}/cxxtools/trim.h, {cxxtools/include => include}/cxxtools/typetraits.h, {cxxtools/include => include}/cxxtools/unit/application.h, {cxxtools/include => include}/cxxtools/unit/assertion.h, {cxxtools/include => include}/cxxtools/unit/registertest.h, {cxxtools/include => include}/cxxtools/unit/reporter.h, {cxxtools/include => include}/cxxtools/unit/test.h, {cxxtools/include => include}/cxxtools/unit/testcase.h, {cxxtools/include => include}/cxxtools/unit/testcontext.h, {cxxtools/include => include}/cxxtools/unit/testfixture.h, {cxxtools/include => include}/cxxtools/unit/testmain.h, {cxxtools/include => include}/cxxtools/unit/testmethod.h, {cxxtools/include => include}/cxxtools/unit/testprotocol.h, {cxxtools/include => include}/cxxtools/unit/testsuite.h, {cxxtools/include => include}/cxxtools/utf8codec.h, {cxxtools/include => include}/cxxtools/uuencode.h, {cxxtools/include => include}/cxxtools/void.h, {cxxtools/include => include}/cxxtools/xml/api.h, {cxxtools/include => include}/cxxtools/xml/characters.h, {cxxtools/include => include}/cxxtools/xml/comment.h, {cxxtools/include => include}/cxxtools/xml/doctypedeclaration.h, {cxxtools/include => include}/cxxtools/xml/enddocument.h, {cxxtools/include => include}/cxxtools/xml/endelement.h, {cxxtools/include => include}/cxxtools/xml/entityresolver.h, {cxxtools/include => include}/cxxtools/xml/namespace.h, {cxxtools/include => include}/cxxtools/xml/namespacecontext.h, {cxxtools/include => include}/cxxtools/xml/node.h, {cxxtools/include => include}/cxxtools/xml/processinginstruction.h, {cxxtools/include => include}/cxxtools/xml/startelement.h, {cxxtools/include => include}/cxxtools/xml/xmldeserializer.h, {cxxtools/include => include}/cxxtools/xml/xmlerror.h, {cxxtools/include => include}/cxxtools/xml/xmlformatter.h, {cxxtools/include => include}/cxxtools/xml/xmlreader.h, {cxxtools/include => include}/cxxtools/xml/xmlserializer.h, {cxxtools/include => include}/cxxtools/xml/xmlwriter.h, {cxxtools/include => include}/cxxtools/xmlrpc/api.h, {cxxtools/include => include}/cxxtools/xmlrpc/client.h, {cxxtools/include => include}/cxxtools/xmlrpc/errorcodes.h, {cxxtools/include => include}/cxxtools/xmlrpc/formatter.h, {cxxtools/include => include}/cxxtools/xmlrpc/httpclient.h, {cxxtools/include => include}/cxxtools/xmlrpc/responder.h, {cxxtools/include => include}/cxxtools/xmlrpc/scanner.h, {cxxtools/include => include}/cxxtools/xmlrpc/service.h, {cxxtools/include => include}/cxxtools/xmltag.h, cxxtools/lgpl++.txt => lgpl++.txt, {cxxtools/m4 => m4}/acx_pthread.m4, {cxxtools/m4 => m4}/asmtype.m4, {cxxtools/m4 => m4}/ax_check_compile_flag.m4, {cxxtools/m4 => m4}/ax_compiler_vendor.m4, {cxxtools/m4 => m4}/iconv.m4, {cxxtools/pkgconfig => pkgconfig}/cxxtools-bin.pc.in, {cxxtools/pkgconfig => pkgconfig}/cxxtools-http.pc.in, {cxxtools/pkgconfig => pkgconfig}/cxxtools-json.pc.in, {cxxtools/pkgconfig => pkgconfig}/cxxtools-unit.pc.in, {cxxtools/pkgconfig => pkgconfig}/cxxtools-xmlrpc.pc.in, {cxxtools/pkgconfig => pkgconfig}/cxxtools.pc.in, {cxxtools/src => src}/Makefile.am, {cxxtools/src => src}/Makefile.mingw, {cxxtools/src => src}/Makefile.win32, {cxxtools/src => src}/addrinfo.cpp, {cxxtools/src => src}/addrinfoimpl.cpp, {cxxtools/src => src}/addrinfoimpl.h, {cxxtools/src => src}/application.cpp, {cxxtools/src => src}/applicationimpl.cpp, {cxxtools/src => src}/applicationimpl.h, {cxxtools/src => src}/atomicity.cpp, {cxxtools/src => src}/atomicity.gcc.arm.cpp, {cxxtools/src => src}/atomicity.gcc.avr32.cpp, {cxxtools/src => src}/atomicity.gcc.mips.cpp, {cxxtools/src => src}/atomicity.gcc.ppc.cpp, {cxxtools/src => src}/atomicity.gcc.sparc32.cpp, {cxxtools/src => src}/atomicity.gcc.sparc64.cpp, {cxxtools/src => src}/atomicity.gcc.x86.cpp, {cxxtools/src => src}/atomicity.gcc.x86_64.cpp, {cxxtools/src => src}/atomicity.generic.cpp, {cxxtools/src => src}/atomicity.pthread.cpp, {cxxtools/src => src}/atomicity.sun.cpp, {cxxtools/src => src}/atomicity.windows.cpp, {cxxtools/src => src}/base64codec.cpp, {cxxtools/src => src}/bin/Makefile.am, {cxxtools/src => src}/bin/deserializer.cpp, {cxxtools/src => src}/bin/formatter.cpp, {cxxtools/src => src}/bin/responder.cpp, {cxxtools/src => src}/bin/responder.h, {cxxtools/src => src}/bin/rpcclient.cpp, {cxxtools/src => src}/bin/rpcclientimpl.cpp, {cxxtools/src => src}/bin/rpcclientimpl.h, {cxxtools/src => src}/bin/rpcserver.cpp, {cxxtools/src => src}/bin/rpcserverimpl.cpp, {cxxtools/src => src}/bin/rpcserverimpl.h, {cxxtools/src => src}/bin/scanner.cpp, {cxxtools/src => src}/bin/scanner.h, {cxxtools/src => src}/bin/socket.cpp, {cxxtools/src => src}/bin/socket.h, {cxxtools/src => src}/bin/valueparser.cpp, {cxxtools/src => src}/bin/worker.cpp, {cxxtools/src => src}/bin/worker.h, {cxxtools/src => src}/cgi.cpp, {cxxtools/src => src}/char.cpp, {cxxtools/src => src}/clock.cpp, {cxxtools/src => src}/clockimpl.cpp, {cxxtools/src => src}/clockimpl.h, {cxxtools/src => src}/condition.cpp, {cxxtools/src => src}/conditionimpl.cpp, {cxxtools/src => src}/conditionimpl.h, {cxxtools/src => src}/connectable.cpp, {cxxtools/src => src}/connection.cpp, {cxxtools/src => src}/conversionerror.cpp, {cxxtools/src => src}/convert.cpp, {cxxtools/src => src}/csvdeserializer.cpp, {cxxtools/src => src}/csvformatter.cpp, {cxxtools/src => src}/csvparser.cpp, {cxxtools/src => src}/date.cpp, {cxxtools/src => src}/datetime.cpp, {cxxtools/src => src}/decomposer.cpp, {cxxtools/src => src}/deserializer.cpp, {cxxtools/src => src}/directory.cpp, {cxxtools/src => src}/directoryimpl.cpp, {cxxtools/src => src}/directoryimpl.h, {cxxtools/src => src}/error.cpp, {cxxtools/src => src}/error.h, {cxxtools/src => src}/eventloop.cpp, {cxxtools/src => src}/eventsink.cpp, {cxxtools/src => src}/eventsource.cpp, {cxxtools/src => src}/facets.cpp, {cxxtools/src => src}/fdstream.cpp, {cxxtools/src => src}/file.cpp, {cxxtools/src => src}/filedevice.cpp, {cxxtools/src => src}/filedeviceimpl.cpp, {cxxtools/src => src}/filedeviceimpl.h, {cxxtools/src => src}/fileimpl.cpp, {cxxtools/src => src}/fileimpl.h, {cxxtools/src => src}/fileinfo.cpp, {cxxtools/src => src}/fileinfoimpl.h, {cxxtools/src => src}/formatter.cpp, {cxxtools/src => src}/hdstream.cpp, {cxxtools/src => src}/http/Makefile.am, {cxxtools/src => src}/http/chunkedreader.cpp, {cxxtools/src => src}/http/chunkedreader.h, {cxxtools/src => src}/http/client.cpp, {cxxtools/src => src}/http/clientimpl.cpp, {cxxtools/src => src}/http/clientimpl.h, {cxxtools/src => src}/http/mapper.cpp, {cxxtools/src => src}/http/mapper.h, {cxxtools/src => src}/http/messageheader.cpp, {cxxtools/src => src}/http/notauthenticatedresponder.cpp, {cxxtools/src => src}/http/notauthenticatedresponder.h, {cxxtools/src => src}/http/notauthenticatedservice.cpp, {cxxtools/src => src}/http/notauthenticatedservice.h, {cxxtools/src => src}/http/notfoundresponder.cpp, {cxxtools/src => src}/http/notfoundresponder.h, {cxxtools/src => src}/http/notfoundservice.cpp, {cxxtools/src => src}/http/notfoundservice.h, {cxxtools/src => src}/http/parser.cpp, {cxxtools/src => src}/http/parser.h, {cxxtools/src => src}/http/request.cpp, {cxxtools/src => src}/http/responder.cpp, {cxxtools/src => src}/http/server.cpp, {cxxtools/src => src}/http/serverimpl.cpp, {cxxtools/src => src}/http/serverimpl.h, {cxxtools/src => src}/http/serverimplbase.h, {cxxtools/src => src}/http/service.cpp, {cxxtools/src => src}/http/socket.cpp, {cxxtools/src => src}/http/socket.h, {cxxtools/src => src}/http/worker.cpp, {cxxtools/src => src}/http/worker.h, {cxxtools/src => src}/iconvstream.cpp, {cxxtools/src => src}/iconvwrap.cpp, {cxxtools/src => src}/inifile.cpp, {cxxtools/src => src}/iniparser.cpp, {cxxtools/src => src}/iodevice.cpp, {cxxtools/src => src}/iodeviceimpl.cpp, {cxxtools/src => src}/iodeviceimpl.h, {cxxtools/src => src}/ioerror.cpp, {cxxtools/src => src}/iostream.cpp, {cxxtools/src => src}/json/Makefile.am, {cxxtools/src => src}/json/httpclient.cpp, {cxxtools/src => src}/json/httpclientimpl.cpp, {cxxtools/src => src}/json/httpclientimpl.h, {cxxtools/src => src}/json/httpresponder.cpp, {cxxtools/src => src}/json/httpresponder.h, {cxxtools/src => src}/json/httpservice.cpp, {cxxtools/src => src}/json/responder.cpp, {cxxtools/src => src}/json/responder.h, {cxxtools/src => src}/json/rpcclient.cpp, {cxxtools/src => src}/json/rpcclientimpl.cpp, {cxxtools/src => src}/json/rpcclientimpl.h, {cxxtools/src => src}/json/rpcserver.cpp, {cxxtools/src => src}/json/rpcserverimpl.cpp, {cxxtools/src => src}/json/rpcserverimpl.h, {cxxtools/src => src}/json/scanner.cpp, {cxxtools/src => src}/json/scanner.h, {cxxtools/src => src}/json/socket.cpp, {cxxtools/src => src}/json/socket.h, {cxxtools/src => src}/json/worker.cpp, {cxxtools/src => src}/json/worker.h, {cxxtools/src => src}/jsondeserializer.cpp, {cxxtools/src => src}/jsonformatter.cpp, {cxxtools/src => src}/jsonparser.cpp, {cxxtools/src => src}/jsonserializer.cpp, {cxxtools/src => src}/library.cpp, {cxxtools/src => src}/libraryimpl.cpp, {cxxtools/src => src}/libraryimpl.h, {cxxtools/src => src}/log.cpp, {cxxtools/src => src}/md5.c, {cxxtools/src => src}/md5.h, {cxxtools/src => src}/md5stream.cpp, {cxxtools/src => src}/mime.cpp, {cxxtools/src => src}/multifstream.cpp, {cxxtools/src => src}/mutex.cpp, {cxxtools/src => src}/muteximpl.cpp, {cxxtools/src => src}/muteximpl.h, {cxxtools/src => src}/net.cpp, {cxxtools/src => src}/pipe.cpp, {cxxtools/src => src}/pipeimpl.cpp, {cxxtools/src => src}/pipeimpl.h, {cxxtools/src => src}/posix/commandinput.cpp, {cxxtools/src => src}/posix/commandoutput.cpp, {cxxtools/src => src}/posix/pipestream.cpp, {cxxtools/src => src}/posix/posixpipe.cpp, {cxxtools/src => src}/properties.cpp, {cxxtools/src => src}/propertiesdeserializer.cpp, {cxxtools/src => src}/query_params.cpp, {cxxtools/src => src}/quotedprintablestream.cpp, {cxxtools/src => src}/regex.cpp, {cxxtools/src => src}/remoteclient.cpp, {cxxtools/src => src}/selectable.cpp, {cxxtools/src => src}/selectableimpl.h, {cxxtools/src => src}/selector.cpp, {cxxtools/src => src}/selectorimpl.cpp, {cxxtools/src => src}/selectorimpl.h, {cxxtools/src => src}/semaphore.cpp, {cxxtools/src => src}/semaphoreimpl.cpp, {cxxtools/src => src}/semaphoreimpl.h, {cxxtools/src => src}/serializationerror.cpp, {cxxtools/src => src}/serializationinfo.cpp, {cxxtools/src => src}/serviceregistry.cpp, {cxxtools/src => src}/settings.cpp, {cxxtools/src => src}/settingsreader.cpp, {cxxtools/src => src}/settingsreader.h, {cxxtools/src => src}/settingswriter.cpp, {cxxtools/src => src}/settingswriter.h, {cxxtools/src => src}/signal.cpp, {cxxtools/src => src}/streambuffer.cpp, {cxxtools/src => src}/string.cpp, {cxxtools/src => src}/stringstream.cpp, {cxxtools/src => src}/systemerror.cpp, {cxxtools/src => src}/tcpserver.cpp, {cxxtools/src => src}/tcpserverimpl.cpp, {cxxtools/src => src}/tcpserverimpl.h, {cxxtools/src => src}/tcpsocket.cpp, {cxxtools/src => src}/tcpsocketimpl.cpp, {cxxtools/src => src}/tcpsocketimpl.h, {cxxtools/src => src}/tcpstream.cpp, {cxxtools/src => src}/tee.cpp, {cxxtools/src => src}/textbuffer.cpp, {cxxtools/src => src}/textcodec.cpp, {cxxtools/src => src}/textstream.cpp, {cxxtools/src => src}/thread.cpp, {cxxtools/src => src}/threadimpl.cpp, {cxxtools/src => src}/threadimpl.h, {cxxtools/src => src}/threadpool.cpp, {cxxtools/src => src}/threadpoolimpl.cpp, {cxxtools/src => src}/threadpoolimpl.h, {cxxtools/src => src}/time.cpp, {cxxtools/src => src}/timer.cpp, {cxxtools/src => src}/timespan.cpp, {cxxtools/src => src}/udp.cpp, {cxxtools/src => src}/udpstream.cpp, {cxxtools/src => src}/unicode.h, {cxxtools/src => src}/unit/Makefile.am, {cxxtools/src => src}/unit/application.cpp, {cxxtools/src => src}/unit/assertion.cpp, {cxxtools/src => src}/unit/reporter.cpp, {cxxtools/src => src}/unit/test.cpp, {cxxtools/src => src}/unit/testcase.cpp, {cxxtools/src => src}/unit/testcontext.cpp, {cxxtools/src => src}/unit/testprotocol.cpp, {cxxtools/src => src}/unit/testsuite.cpp, {cxxtools/src => src}/uri.cpp, {cxxtools/src => src}/utf8codec.cpp, {cxxtools/src => src}/uuencode.cpp, {cxxtools/src => src}/xml/characters.cpp, {cxxtools/src => src}/xml/endelement.cpp, {cxxtools/src => src}/xml/entityresolver.cpp, {cxxtools/src => src}/xml/namespacecontext.cpp, {cxxtools/src => src}/xml/startelement.cpp, {cxxtools/src => src}/xml/xmldeserializer.cpp, {cxxtools/src => src}/xml/xmlerror.cpp, {cxxtools/src => src}/xml/xmlformatter.cpp, {cxxtools/src => src}/xml/xmlreader.cpp, {cxxtools/src => src}/xml/xmlserializer.cpp, {cxxtools/src => src}/xml/xmlwriter.cpp, {cxxtools/src => src}/xmlrpc/Makefile.am, {cxxtools/src => src}/xmlrpc/client.cpp, {cxxtools/src => src}/xmlrpc/clientimpl.cpp, {cxxtools/src => src}/xmlrpc/clientimpl.h, {cxxtools/src => src}/xmlrpc/formatter.cpp, {cxxtools/src => src}/xmlrpc/httpclient.cpp, {cxxtools/src => src}/xmlrpc/httpclientimpl.cpp, {cxxtools/src => src}/xmlrpc/httpclientimpl.h, {cxxtools/src => src}/xmlrpc/responder.cpp, {cxxtools/src => src}/xmlrpc/scanner.cpp, {cxxtools/src => src}/xmlrpc/service.cpp, {cxxtools/src => src}/xmltag.cpp, {cxxtools/test => test}/Makefile.am, {cxxtools/test => test}/MyApp.pm, {cxxtools/test => test}/arg-test.cpp, {cxxtools/test => test}/base64-test.cpp, {cxxtools/test => test}/binrpc-test.cpp, {cxxtools/test => test}/binserializer-test.cpp, {cxxtools/test => test}/cache-test.cpp, {cxxtools/test => test}/cgitest.cpp, {cxxtools/test => test}/clock-test.cpp, {cxxtools/test => test}/convert-test.cpp, {cxxtools/test => test}/csvdeserializer-test.cpp, {cxxtools/test => test}/csvserializer-test.cpp, {cxxtools/test => test}/iconvstream-test.cpp, {cxxtools/test => test}/inifile.cpp, {cxxtools/test => test}/join-test.cpp, {cxxtools/test => test}/json-test.cpp, {cxxtools/test => test}/jsondeserializer-test.cpp, {cxxtools/test => test}/jsonechoclient.pl, {cxxtools/test => test}/jsonechoserver.pl, {cxxtools/test => test}/jsonrpc-test.cpp, {cxxtools/test => test}/jsonrpchttp-test.cpp, {cxxtools/test => test}/jsonserializer-test.cpp, {cxxtools/test => test}/lrucache-test.cpp, {cxxtools/test => test}/md5-test.cpp, {cxxtools/test => test}/net-test.cpp, {cxxtools/test => test}/pool-test.cpp, {cxxtools/test => test}/properties-test.cpp, {cxxtools/test => test}/query_params-test.cpp, {cxxtools/test => test}/query_params_test.cpp, {cxxtools/test => test}/regex-test.cpp, {cxxtools/test => test}/rpcbenchclient.cpp, {cxxtools/test => test}/rpcbenchserver.cpp, {cxxtools/test => test}/serializationinfo-test.cpp, {cxxtools/test => test}/serializer-bench.cpp, {cxxtools/test => test}/smartptr-test.cpp, {cxxtools/test => test}/split-test.cpp, {cxxtools/test => test}/string-test.cpp, {cxxtools/test => test}/tcpsockettest.cpp, {cxxtools/test => test}/test-main.cpp, {cxxtools/test => test}/trim-test.cpp, {cxxtools/test => test}/uri-test.cpp, {cxxtools/test => test}/xmlreader-test.cpp, {cxxtools/test => test}/xmlrpc-test.cpp, {cxxtools/test => test}/xmlrpccallback-test.cpp, {cxxtools/test => test}/xmlserializer-test.cpp, {cxxtools/utils => utils}/remoteprocedure.pl, {cxxtools/utils => utils}/setLicense.pl, {cxxtools/utils => utils}/xmlrpcservice.pl, vim/.gvimrc, vim/.vim/filetype.vim, vim/.vim/htmlsubst, vim/.vim/skeletons/skel.cpp, vim/.vim/skeletons/skel.h, vim/.vim/skeletons/skel.html, vim/.vim/skeletons/skel.mason, vim/.vim/skeletons/skel.pl, vim/.vim/syntax/ecpp.vim, vim/.vim/vimrc.c, vim/.vim/vimrc.cpp, vim/.vim/vimrc.ecpp, vim/.vim/vimrc.h, vim/.vim/vimrc.html, vim/.vim/vimrc.mason, vim/.vim/vimrc.perl, vim/.vimrc: remove one directory level 2013-05-04 Tommi Mäkitalo * cxxtools/include/cxxtools/jsonparser.h, cxxtools/src/jsonparser.cpp, cxxtools/src/log.cpp, cxxtools/test/jsondeserializer-test.cpp: allow plain keys in json deserializer initialization of logging optionally with json 2013-04-20 maekitalo * cxxtools/configure.in: update version number to 2.2rc4 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1627 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-20 maekitalo * cxxtools/demo/rpcasyncaddclient.cpp: fix typo in comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1626 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-20 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/xmlrpccallback-test.cpp: restore old xmlrpc unit test as xmlrpccallback to test the callback functionality git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1625 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-17 maekitalo * cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/xmlrpc/clientimpl.cpp: fix exception handling in xmlrpc and json over http - exceptions were lost when executed just via the event loop git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1624 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-07 maekitalo * cxxtools/doc/rpc-howto.markdown: rpc howto is finished git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1622 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-07 maekitalo * cxxtools/demo/rpcasyncaddclient.cpp: a cxxtools::Selector is sufficient in async rpc calls on the client side git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1621 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-07 maekitalo * cxxtools/ChangeLog: remove duplicate entries from ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1620 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-06 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1619 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-06 maekitalo * cxxtools/configure.in, cxxtools/test/convert-test.cpp, cxxtools/test/trim-test.cpp: fix build on FreeBSD and 2 minor style changes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1618 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-05 maekitalo * cxxtools/include/cxxtools/systemerror.h, cxxtools/src/error.cpp, cxxtools/src/error.h, cxxtools/src/fileimpl.cpp, cxxtools/src/selectorimpl.cpp, cxxtools/src/systemerror.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocketimpl.cpp: replace use of strerror with thread safe strerror_r git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1617 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-03 maekitalo * cxxtools/doc/rpc-howto.markdown: start howto for rpc in cxxtools git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1616 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-03 maekitalo * cxxtools/include/cxxtools/trim.h, cxxtools/test/trim-test.cpp: make string type a template parameter in ltrim, rtrim and trim so that it works with cxxtools::String (unicode string) also git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1615 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-04-02 maekitalo * cxxtools/src/xml/Makefile.am: remove unused Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1614 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-31 maekitalo * cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/json/rpcserver.h, cxxtools/src/bin/rpcserver.cpp, cxxtools/src/http/server.cpp, cxxtools/src/json/rpcserver.cpp, cxxtools/test/binrpc-test.cpp, cxxtools/test/jsonrpc-test.cpp, cxxtools/test/jsonrpchttp-test.cpp, cxxtools/test/xmlrpc-test.cpp: make passing listen ip address optional for http and rpc servers, which means to listen on all interfaces git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1613 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-31 maekitalo * cxxtools/src/md5stream.cpp, cxxtools/src/properties.cpp: fix compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1612 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-31 maekitalo * cxxtools/include/Makefile.am: add lrucache.h to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1611 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-31 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix compile error - variable "fn" is not defined git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1610 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-30 maekitalo * cxxtools/demo/rpcaddclient.cpp, cxxtools/demo/rpcasyncaddclient.cpp, cxxtools/demo/rpcserver.cpp, cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/json/httpclient.h, cxxtools/include/cxxtools/json/rpcclient.h, cxxtools/include/cxxtools/remoteclient.h, cxxtools/include/cxxtools/remoteprocedure.h, cxxtools/include/cxxtools/remoteresult.h, cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/Makefile.am, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/http/client.cpp, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/json/httpclient.cpp, cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/httpclientimpl.h, cxxtools/src/json/rpcclient.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/json/rpcclientimpl.h, cxxtools/src/json/rpcserverimpl.cpp, cxxtools/src/remoteclient.cpp, cxxtools/src/selector.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/httpclient.cpp, cxxtools/src/xmlrpc/httpclientimpl.cpp, cxxtools/src/xmlrpc/httpclientimpl.h, cxxtools/test/binrpc-test.cpp, cxxtools/test/jsonrpc-test.cpp, cxxtools/test/jsonrpchttp-test.cpp, cxxtools/test/xmlrpc-test.cpp: implement a new much simpler api for asynchronous rpc calls (see demo/rpcasyncaddclient.cpp for a example) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1609 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-29 maekitalo * cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/src/Makefile.am, cxxtools/test/Makefile.am: set pthread flags and select threaded compiler globally in configure script git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1608 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-28 maekitalo * cxxtools/demo/rpcasyncaddclient.cpp: forgot to pass event loop to json rpc client demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1607 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-26 maekitalo * cxxtools/demo/rpcaddclient.cpp: make selecting remote client a little more readable in demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1606 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-22 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in: release candidate 2.2rc3 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1605 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-20 maekitalo * cxxtools/include/cxxtools/cache.h, cxxtools/include/cxxtools/lrucache.h, cxxtools/test/Makefile.am, cxxtools/test/lrucache-test.cpp: implement lru cache git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1604 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-20 maekitalo * cxxtools/include/cxxtools/cache.h, cxxtools/test/cache-test.cpp: fix collecting cache stats return reference to new value in put method of cache git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1603 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-17 maekitalo * cxxtools/include/cxxtools/http/service.h, cxxtools/include/cxxtools/iniparser.h, cxxtools/include/cxxtools/properties.h, cxxtools/src/jsonformatter.cpp: fix again some compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1602 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-17 maekitalo * cxxtools/configure.in: set preprocesor flags in CPPFLAGS instead of CXXFLAGS git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1601 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-17 maekitalo * cxxtools/include/cxxtools/posix/exec.h, cxxtools/src/bin/valueparser.cpp, cxxtools/src/http/chunkedreader.cpp, cxxtools/src/posix/pipestream.cpp, cxxtools/src/tcpserverimpl.cpp: fix some compiler warnings use INHERIT flag on non-linux systems in cxxtools::net::TcpServer::accept also git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1600 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-17 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in: update version number to 2.2rc2; update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1599 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-13 maekitalo * cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/fileinfo.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/file.cpp, cxxtools/src/fileinfo.cpp, cxxtools/src/settingswriter.h: remove some unused members git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1598 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-09 maekitalo * cxxtools/include/cxxtools/smartptr.h: remove implicit conversion from cxxtools::SmartPtr to raw pointer and make different SmartPtr types compatible as long as the pointees are compatible git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1597 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-09 maekitalo * cxxtools/src/regex.cpp: fix handling of escape character in format method of cxxtools::RegexSMatch git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1596 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-05 maekitalo * cxxtools/configure.in, cxxtools/src/json/rpcclientimpl.cpp: fix jsonrpc client connect method: last optimization was silly wrong git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1594 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-04 maekitalo * cxxtools/include/cxxtools/regex.h, cxxtools/src/regex.cpp, cxxtools/test/Makefile.am, cxxtools/test/regex-test.cpp: handle empty regular expression explicitly since at least OSX complains about it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1593 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-04 maekitalo * cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/json/rpcclient.cpp, cxxtools/src/json/rpcclientimpl.cpp: fix crash in binary rpc client when reusing client close existing connection in json rpc client when connection parameters are changed in connect close existing connection in binary rpc client only if connection parameters are changed in connect git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1590 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-03-01 maekitalo * cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp: binary rpc client crashed when connect method was called on a default constructed instance git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1587 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-02-27 maekitalo * cxxtools/include/cxxtools/query_params.h, cxxtools/src/query_params.cpp, cxxtools/test/Makefile.am, cxxtools/test/query_params-test.cpp, cxxtools/test/query_params_it.cpp: simplify cxxtools::QueryParams and remove the unused parent feature git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1586 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-02-27 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1585 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-02-25 maekitalo * cxxtools/test/jsonserializer-test.cpp: logging is not used in jsonserializer unit test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1584 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-02-25 maekitalo * cxxtools/include/cxxtools/filedevice.h, cxxtools/src/filedevice.cpp, cxxtools/src/filedeviceimpl.cpp, cxxtools/src/filedeviceimpl.h, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h: fix FileDevice git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1583 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-02-14 maekitalo * cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/test/binrpc-test.cpp: add domain parameter to connect method and constructor of binary rpc client to make it more similar to xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1582 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-02-14 maekitalo * cxxtools/src/jsonformatter.cpp: do not convert string values to double and back in json formatter when doubles are serialized as strings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1581 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-30 maekitalo * cxxtools/include/cxxtools/string.tpp: make conversion explicit in cxxtools::String (clang was pinky about it and he was right) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1580 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-18 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h: improve compatibility to previous cxxtools release in log_init git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1579 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-18 maekitalo * cxxtools/test/properties-test.cpp: fix properties unit test: a wide char string cannot be printed to a std::ostream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1578 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-16 maekitalo * cxxtools/src/properties.cpp, cxxtools/test/properties-test.cpp: allow full 32 bit unicode escapes in properties files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1577 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-14 maekitalo * cxxtools/test/properties-test.cpp: use deserializer API to extract data from properties in unit test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1576 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-13 maekitalo * cxxtools/include/cxxtools/properties.h, cxxtools/include/cxxtools/propertiesdeserializer.h, cxxtools/src/properties.cpp, cxxtools/src/propertiesdeserializer.cpp, cxxtools/test/Makefile.am, cxxtools/test/{propertiesdeserializer-test.cpp => properties-test.cpp}: improve error handling in properties parser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1575 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-12 maekitalo * cxxtools/include/cxxtools/properties.h, cxxtools/src/properties.cpp, cxxtools/test/propertiesdeserializer-test.cpp: allow unicode escape sequences in properties and comments starting with ! git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1574 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-12 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/properties.h, cxxtools/include/cxxtools/propertiesdeserializer.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/Makefile.am, cxxtools/src/log.cpp, cxxtools/src/properties.cpp, cxxtools/src/propertiesdeserializer.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/test/Makefile.am, cxxtools/test/propertiesdeserializer-test.cpp: implement PropertiesDeserializer read logging settings optionally from log.properties like before bugfix: SerializationInfo::getMember(unsigned) was just wrong use unicode strings in Properties class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1573 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-09 maekitalo * cxxtools/src/json/Makefile.am: add missing library dependency git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1572 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-03 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix stopping tcp server if only one listen socket is active git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1571 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-02 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/string.h, cxxtools/src/char.cpp, cxxtools/src/csvparser.cpp, cxxtools/src/http/chunkedreader.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/log.cpp, cxxtools/src/utf8codec.cpp, cxxtools/src/xml/entityresolver.cpp, cxxtools/test/xmlreader-test.cpp: make value of cxxtools::Char signed like other char types fixes for IBM/xlC-compiler git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1570 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-02 maekitalo * cxxtools/src/tcpsocketimpl.cpp: do not block SIGPIPE if MSG_NOSIGNAL is used git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1569 15ae5fad-cc11-0410-8fac-bce609e504b0 2013-01-02 maekitalo * cxxtools/include/cxxtools/split.h, cxxtools/test/split-test.cpp: extend cxxtools::split by passing split as set of chars git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1568 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-12-30 maekitalo * cxxtools/configure.in: fix preprocessor warning about redefinition of HAVE_REVERSE_ITERATOR git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1567 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-12-30 maekitalo * cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/json/rpcserverimpl.cpp, cxxtools/src/tcpsocketimpl.cpp: fix handling SIGPIPE in tcp server for BSD do not set signal handler for SIGPIPE any more in servers since it is now handled by the socket code git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1566 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-12-30 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix setting SO_NOSIGPIPE git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1565 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-12-29 maekitalo * cxxtools/configure.in, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/test/rpcbenchclient.cpp: use SO_NOSIGPIPE or MSG_NOSIGNAL to suppress SIGPIPE git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1564 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-12-28 maekitalo * cxxtools/src/log.cpp: fix compile problem on FreeBSD git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1563 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-12-01 maekitalo * cxxtools/src/directoryimpl.cpp: allocate dynamically the buffer for cxxtools::Directory::cwd to be safe for all times git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1562 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-25 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/rpcserver.cpp, cxxtools/test/binrpc-test.cpp: replace function praefix in binary rpc with domain and implement explicit protocol support for it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1561 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-25 maekitalo * cxxtools/include/cxxtools/arg.h: allow assigning value to cxxtools::Arg git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1560 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-18 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/filedevice.h, cxxtools/src/Makefile.am, cxxtools/src/filedevice.cpp, cxxtools/src/filedeviceimpl.cpp, cxxtools/src/filedeviceimpl.h: new file device for asynchronous file i/o (ported from Pt) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1559 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-17 maekitalo * cxxtools/include/cxxtools/queue.h: add force flag to cxxtools::Queue::put to override capacity limitation of queue git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1558 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-17 maekitalo * cxxtools/include/cxxtools/base64codec.h, cxxtools/include/cxxtools/utf8codec.h: make Base64Codec::encode/decode public as they are inteded to be and make codec methods in Utf8Codec protected instead of public git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1557 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-17 maekitalo * cxxtools/include/cxxtools/iconvwrap.h: add missing file - iconvwrap should have been checked in long ago git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1556 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-11-17 maekitalo * cxxtools/configure.in: compile with -Wall and -pedantic by default if compiler supports it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1555 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-10-26 maekitalo * cxxtools/include/cxxtools/unit/assertion.h: do not loose assertion message when unit tests are nested git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1554 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-10-08 maekitalo * cxxtools/src/xmlrpc/formatter.cpp: format null value correctly in xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1553 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-10-08 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: make type conversion explicit in SerializationInfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1552 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-10-08 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/join-test.cpp, cxxtools/test/split-test.cpp: add unit tests for cxxtools::split and cxxtools::join git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1551 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-09-21 maekitalo * cxxtools/include/cxxtools/base64codec.h, cxxtools/include/cxxtools/utf8codec.h, cxxtools/src/utf8codec.cpp, cxxtools/test/base64-test.cpp: add static helper functions to codecs for encoding and decoding utf-8 and base84 data git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1550 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-09-21 maekitalo * cxxtools/include/cxxtools/textcodec.h, cxxtools/test/base64-test.cpp: fix new cxxtools::encode and decode functions and add unit tests for them git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1549 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-09-20 maekitalo * cxxtools/include/cxxtools/textcodec.h: implement encode and decode helper template functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1548 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-09-12 maekitalo * cxxtools/src/addrinfoimpl.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: add host and port into error message in tcp client when connect fails git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1547 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-09-02 maekitalo * cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/httpresponder.cpp, cxxtools/src/json/httpservice.cpp, cxxtools/src/json/responder.cpp: make json rpc conformant to JSON-RPC specification 2.0 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1546 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-09-02 maekitalo * cxxtools/configure.in, cxxtools/src/clockimpl.cpp, cxxtools/src/clockimpl.h, cxxtools/test/Makefile.am, cxxtools/test/clock-test.cpp: use monotonic clock function clock_gettime if available to measure times cxxtools::Clock git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1545 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-08-24 maekitalo * cxxtools/src/threadimpl.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1544 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-08-20 maekitalo * cxxtools/include/cxxtools/timespan.h, cxxtools/src/threadimpl.cpp, cxxtools/src/threadimpl.h: make cxxtools::Thread::sleep(ms) signal safe git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1543 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-08-04 maekitalo * cxxtools/src/http/parser.cpp, cxxtools/src/http/parser.h: allow absolute uris in http requesst header as the standard demands git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1542 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-07-31 maekitalo * cxxtools/include/cxxtools/query_params.h, cxxtools/src/query_params.cpp, cxxtools/src/xml/xmlreader.cpp: fix problems detected by clang 3.1 (yofuh) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1541 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-07-29 maekitalo * cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/textbuffer.h, cxxtools/src/char.cpp, cxxtools/src/convert.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/properties.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/src/settingsreader.cpp, cxxtools/src/settingsreader.h, cxxtools/src/string.cpp, cxxtools/src/utf8codec.cpp, cxxtools/src/xml/xmlreader.cpp: make cxxtools::Char more restrictive (like removing automatic conversion to int or removing shift operators) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1540 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-07-29 maekitalo * cxxtools/src/log.cpp: make of logging deinitialization more robust git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1539 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-07-16 maekitalo * cxxtools/include/cxxtools/char.h: comparing Char against wchar_t git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1538 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-25 maekitalo * cxxtools/include/cxxtools/unit/assertion.h: better formatting of failed message in unittest macro CXXTOOLS_UNIT_ASSERT_EQUALS git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1536 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-11 maekitalo * cxxtools/src/thread.cpp: fix another race condition when creating deteached threads (now I can't crash tntnet any more) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1535 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-11 maekitalo * cxxtools/src/threadimpl.cpp: fix race condition when creating deteached threads git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1534 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-10 maekitalo * cxxtools/src/addrinfo.cpp, cxxtools/src/log.cpp: fix 2 memory leaks git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1533 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-10 maekitalo * cxxtools/test/smartptr-test.cpp: add test for smart pointer with atomic counter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1532 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-07 maekitalo * cxxtools/include/cxxtools/smartptr.h: make smart pointer implicit convertable to const ObjectType* again git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1531 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-07 maekitalo * cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/smartptr.h: move responsibility in destroying object from refcounted to smartptr class, so that smartptr can use its destroy poliy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1530 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-02 maekitalo * cxxtools/src/log.cpp: simplify writing log to stderr or stdout since this complicated optimization do not help at all git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1529 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-02 maekitalo * cxxtools/src/log.cpp: fix optimized writing to console in logger (log messages were not completed with a line feed when delayed) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1528 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-02 maekitalo * cxxtools/demo/Makefile.am: do not create log.properties but new log.xml when building demos git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1527 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-06-02 maekitalo * cxxtools/include/Makefile.am: add new cxxtools/iconvwrap.h to dist package git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1526 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-30 maekitalo * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/pkgconfig/cxxtools-bin.pc.in, cxxtools/pkgconfig/cxxtools-http.pc.in, cxxtools/pkgconfig/cxxtools-json.pc.in, cxxtools/pkgconfig/cxxtools-unit.pc.in, cxxtools/pkgconfig/cxxtools-xmlrpc.pc.in, cxxtools/pkgconfig/cxxtools.pc.in: add pkg-config support (Leandro Santiago) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1525 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-30 maekitalo * cxxtools/include/cxxtools/iconvstream.h, cxxtools/src/Makefile.am, cxxtools/src/iconvstream.cpp, cxxtools/src/iconvwrap.cpp, cxxtools/test/Makefile.am, cxxtools/test/iconvstream-test.cpp: improve iconv support (Jiří Pinkava) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1524 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-29 maekitalo * cxxtools/cxxtools-config.in: update cxxtools-config to generate new configuration file log.xml file instead of log.properties for logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1523 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-29 maekitalo * cxxtools/src/log.cpp: limit size of buffered log messages to stderr or stdout to about 8k git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1522 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-29 maekitalo * cxxtools/src/log.cpp: do not use std::cerr to write log message since it is a global resource may be used by another thread add setting "stdout" to print log output to stdout instead of stderr git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1521 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-28 maekitalo * cxxtools/src/string.cpp: optimize printing cxxtools::String to std::ostream by using codec directly instead of instantiation of TextStream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1520 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-28 maekitalo * cxxtools/src/utf8codec.cpp: fix buffer overflow in Utf8Codec::decode git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1519 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-28 maekitalo * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/cxxlog.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/getini.cpp, cxxtools/demo/iconv.cpp, cxxtools/demo/log.cpp, cxxtools/demo/logbench.cpp, cxxtools/demo/logsh.cpp, cxxtools/demo/mime.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/demo/pool.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/net/udp.h, cxxtools/include/cxxtools/unit/testmain.h, cxxtools/src/Makefile.am, cxxtools/src/log.cpp, cxxtools/src/systemerror.cpp, cxxtools/src/udp.cpp, cxxtools/src/xmlrpc/Makefile.am, cxxtools/test/Makefile.am: - rewrite logging - configure logging using xml (or serializationinfo) instead of properties - remove cxxtools/loginit.h - it was obsolete for long time already - move xml support from libcxxtools-xml into core library libcxxtools and remove libcxxtools-xml git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1518 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-27 maekitalo * cxxtools/src/xml/entityresolver.cpp, cxxtools/test/xmlreader-test.cpp: do not use all html entities in xml but only the few, which are defined in xml git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1517 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-26 maekitalo * cxxtools/src/http/request.cpp: fix reading authentication data from http request git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1516 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-19 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1515 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-19 maekitalo * cxxtools/cxxtools-config.in, cxxtools/include/cxxtools/log/disable.h, cxxtools/include/cxxtools/log/disable_init.h, cxxtools/include/cxxtools/log/log4cplus.h, cxxtools/include/cxxtools/log/log4cplus_init.h, cxxtools/include/cxxtools/log/log4cxx.h, cxxtools/include/cxxtools/log/log4cxx_init.h: remove remaining parts of support of log4cxx and log4cplus git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1512 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-13 maekitalo * cxxtools/src/log.cpp: limit number of pooled message impl in logger to 8 and release pooled messages on end git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1511 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-12 maekitalo * cxxtools/src/log.cpp: optimize logging: pool of message impls git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1510 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-06 maekitalo * cxxtools/include/cxxtools/deserializerbase.h, cxxtools/test/binserializer-test.cpp, cxxtools/test/json-test.cpp, cxxtools/test/xmlserializer-test.cpp: add clear method to deserializer and fix unit tests - they were broken with the new feature, that deserializers can deserialize multiple objects without rerun git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1509 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-06 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: optimize logging by delaying flush when other threads are already waiting to write next log message git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1508 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-05 maekitalo * cxxtools/include/cxxtools/properties.h, cxxtools/src/properties.cpp: small fix in properties parser use unicode string in properties parser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1507 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-05 maekitalo * cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/deserializerbase.h: allow multiple calls to deserializer without reparsing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1505 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-04 maekitalo * cxxtools/src/bin/valueparser.cpp: fix reading custom types in binary parser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1503 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-04 maekitalo * cxxtools/demo/dir.cpp, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/fileinfo.h, cxxtools/src/directory.cpp, cxxtools/src/directoryimpl.cpp, cxxtools/src/directoryimpl.h, cxxtools/src/fileinfo.cpp, cxxtools/src/fileinfoimpl.h: make some extensions to Directory and FileInfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1502 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-05-03 maekitalo * cxxtools/ChangeLog: update change log git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1499 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-29 maekitalo * cxxtools/src/iniparser.cpp: semicolon is a comment in ini files - fix in iniparser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1498 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-27 maekitalo * cxxtools/src/base64codec.cpp, cxxtools/test/base64-test.cpp: base64 was still wrong git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1497 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-26 maekitalo * cxxtools/src/base64codec.cpp, cxxtools/test/base64-test.cpp: fix base64 encoder git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1496 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-25 maekitalo * cxxtools/include/cxxtools/jsonparser.h, cxxtools/src/jsonparser.cpp, cxxtools/test/jsondeserializer-test.cpp: allow comments (single line with // and multiline with /* */) in json git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1495 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-25 maekitalo * cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/serializationinfo.cpp: add method getMember(unsigned) to read nth member from SerializationInfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1494 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-23 maekitalo * cxxtools/include/cxxtools/net/tcpserver.h, cxxtools/src/bin/Makefile.am, cxxtools/src/bin/listener.h, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/bin/rpcserverimpl.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/listener.h, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/json/Makefile.am, cxxtools/src/json/listener.h, cxxtools/src/json/rpcserverimpl.cpp, cxxtools/src/json/rpcserverimpl.h, cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpserverimpl.h, cxxtools/src/tcpsocketimpl.h: new method terminateAccept in TcpServer to terminate a blocking accept from another thread git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1493 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-10 maekitalo * cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/test/binserializer-test.cpp: fix formatting and parsing floating point value 0 in binary format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1492 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-10 maekitalo * cxxtools/demo/rpcaddclient.cpp, cxxtools/demo/rpcasyncaddclient.cpp: fix xmlrpc url and add json over http to the rpc add client (Leandro Santiago) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1491 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-07 maekitalo * cxxtools/include/cxxtools/cache.h: fix compile problem in cxxtools::Cache git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1490 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-07 maekitalo * cxxtools/include/cxxtools/cache.h, cxxtools/test/cache-test.cpp: fix resizing cxxtools::Cache git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1489 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-04-02 maekitalo * cxxtools/configure.in: update version number to 2.1 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1487 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-31 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in: update ChangeLog and version number git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1486 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-30 maekitalo * cxxtools/include/cxxtools/cache.h: optimize cache template - no linear search necessary any more when searching for elements git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1485 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-27 maekitalo * cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/src/log.cpp: arg/argv can be passed to log_init, so that the logging properties file is derived from the current binary name or optionally a option char or string is passed to log_init git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1484 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-18 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/loginit.h, cxxtools/m4/cxxtools_logging.m4: remove support for log4cpp and log4cxx git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1482 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-15 maekitalo * cxxtools/src/csvdeserializer.cpp, cxxtools/src/csvparser.cpp, cxxtools/test/csvdeserializer-test.cpp: fix reading csv data without title git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1481 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-05 maekitalo * cxxtools/src/jsonformatter.cpp: use unicode escape sequence for control characters (<0x20) in json as done already for characters > 0x80 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1479 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-04 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/test/jsonserializer-test.cpp: add feature to json serializer to serialize empty objects git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1477 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-03-04 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h: add log macros log_xxx_if(cond, expr) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1476 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-29 maekitalo * cxxtools/include/cxxtools/base64codec.h, cxxtools/src/Makefile.am, cxxtools/src/base64codec.cpp, cxxtools/test/base64-test.cpp: fix encoding in base64codec git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1470 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-25 maekitalo * cxxtools/configure.in, cxxtools/m4/ax_check_compile_flag.m4, cxxtools/m4/ax_compiler_vendor.m4: set compile flags for ibm xlc correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1469 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-25 maekitalo * cxxtools/configure.in, cxxtools/m4/ax_cflags_aix_option.m4, cxxtools/m4/ax_cflags_gcc_option.m4: use AX_CHECK_COMPILE_FLAG instead of AX_CXXFLAGS_*_OPTION to check compile flags - this is a standard macro of autoconf and works better than the old ones git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1468 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-24 maekitalo * cxxtools/configure.in, cxxtools/m4/ax_cflags_aix_option.m4, cxxtools/m4/ax_cflags_gcc_option.m4: add compiler flags -Wno-long-long for gcc and -qrtti for aix/xlc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1467 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-24 maekitalo * cxxtools/src/string.cpp: fix member function in string to match exactly the declaration in the header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1466 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-24 maekitalo * cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/serializationerror.h, cxxtools/include/cxxtools/textstream.h, cxxtools/src/bin/deserializer.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/csvdeserializer.cpp, cxxtools/src/csvparser.cpp, cxxtools/src/deserializer.cpp, cxxtools/src/jsondeserializer.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/serializationerror.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/scanner.cpp, cxxtools/test/csvdeserializer-test.cpp: improve error reporting in serializer inherit exception flag from base stream in text streams git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1465 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-24 maekitalo * cxxtools/src/date.cpp, cxxtools/src/time.cpp: fix formatting git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1464 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-23 maekitalo * cxxtools/src/csvdeserializer.cpp, cxxtools/test/csvdeserializer-test.cpp: inherit exception mask from source stream in csv deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1463 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-23 maekitalo * cxxtools/src/serializationinfo.cpp: report right type in serializationinfo when convert fails git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1462 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-20 maekitalo * cxxtools/configure.in, cxxtools/test/Makefile.am: remove obsolete definition of TESTDIR from build git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1461 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-19 maekitalo * cxxtools/configure.in: add configure check if int64_t can be serialized using standard types git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1460 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-19 maekitalo * cxxtools/test/binserializer-test.cpp, cxxtools/test/convert-test.cpp, cxxtools/test/json-test.cpp, cxxtools/test/xmlserializer-test.cpp: do not check doubles for equality but for almost equal in unit test to work around rounding problems git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1459 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-18 maekitalo * cxxtools/src/bin/valueparser.cpp, cxxtools/src/csvparser.cpp, cxxtools/src/log.cpp, cxxtools/src/serializationinfo.cpp: fix some compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1458 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-17 maekitalo * cxxtools/include/cxxtools/textcodec.h: add missing explicit marker git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1457 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-17 maekitalo * cxxtools/src/log.cpp: process last line of log.properties even if there is no line feed at end git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1456 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-17 maekitalo * cxxtools/include/cxxtools/iodevice.h: fix documentation of cxxtools::IODevice::eof() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1455 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-14 maekitalo * cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/csvformatter.h, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/jsonformatter.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/xml/xmlformatter.h, cxxtools/include/cxxtools/xmlrpc/formatter.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/csvformatter.cpp, cxxtools/src/decomposer.cpp, cxxtools/src/formatter.cpp, cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/responder.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/jsonformatter.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/src/xml/xmlformatter.cpp, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/test/csvserializer-test.cpp: serializer bool as "true" and "false" as before instead of 1 and 0 give addValue methods of formatter unique names for easier resolution and to remove some compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1454 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-13 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/base64codec.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/clock.h, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/csvparser.h, cxxtools/include/cxxtools/datetime.h, cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/selectable.h, cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/time.h, cxxtools/include/cxxtools/timespan.h, cxxtools/include/cxxtools/types.h, cxxtools/include/cxxtools/typetraits.h, cxxtools/include/cxxtools/utf8codec.h, cxxtools/src/bin/valueparser.cpp, cxxtools/src/csvdeserializer.cpp, cxxtools/src/datetime.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/selector.cpp, cxxtools/src/timer.cpp, cxxtools/src/xml/entityresolver.cpp: remove cxxtools/types.h header and replace with stdint.h and clean up code again to reduce compiler warnings use the result of the long long type check where needed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1453 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-13 maekitalo * cxxtools/include/cxxtools/textstream.h: fix typo in textstream, which caused a crash git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1452 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-09 maekitalo * cxxtools/src/application.cpp, cxxtools/src/jsonparser.cpp: fix initalization of application class fix compiler warning in json parser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1451 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-09 maekitalo * cxxtools/demo/netio.cpp, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/include/cxxtools/query_params.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/scanner.h, cxxtools/src/bin/valueparser.cpp, cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/httpservice.cpp, cxxtools/src/regex.cpp: add some missing headers and other minor code cleanup (yofuh) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1450 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-09 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/application.h, cxxtools/include/cxxtools/datetime.h, cxxtools/include/cxxtools/hmac.h, cxxtools/include/cxxtools/iostream.h, cxxtools/include/cxxtools/library.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/membar.gcc.arm.h, cxxtools/include/cxxtools/membar.gcc.h, cxxtools/include/cxxtools/membar.gcc.mips.h, cxxtools/include/cxxtools/membar.gcc.nosmp.h, cxxtools/include/cxxtools/membar.gcc.ppc.h, cxxtools/include/cxxtools/membar.gcc.sparc32.h, cxxtools/include/cxxtools/membar.gcc.sparc64.h, cxxtools/include/cxxtools/membar.gcc.x86.h, cxxtools/include/cxxtools/membar.h, cxxtools/include/cxxtools/membar.sun.h, cxxtools/include/cxxtools/membar.windows.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/smartptr.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/textbuffer.h, cxxtools/include/cxxtools/textstream.h, cxxtools/include/cxxtools/time.h, cxxtools/src/application.cpp, cxxtools/src/applicationimpl.cpp, cxxtools/src/atomicity.gcc.sparc64.cpp, cxxtools/src/directory.cpp, cxxtools/src/directoryimpl.cpp, cxxtools/src/fileinfo.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/selector.cpp, cxxtools/src/settingsreader.h, cxxtools/src/signal.cpp, cxxtools/src/thread.cpp, cxxtools/src/time.cpp: add some missing includes change tabs to spaces increase abi number from 7 to 8 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1449 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-08 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1448 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-08 maekitalo * cxxtools/src/bin/formatter.cpp: avoid long long constants since they are difficult to make fully portable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1447 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-08 maekitalo * cxxtools/include/cxxtools/json/request.h: update license header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1446 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-08 maekitalo * cxxtools/include/cxxtools/api.h: add check for cygwin platform to disable min/max macros from win32 headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1445 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-03 maekitalo * cxxtools/include/cxxtools/csvserializer.h: csvserializer is not copyable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1444 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-02-02 maekitalo * cxxtools/include/cxxtools/csvparser.h, cxxtools/src/csvparser.cpp, cxxtools/test/csvdeserializer-test.cpp: allow quoted titles in csv parser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1441 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-30 maekitalo * cxxtools/src/csvformatter.cpp, cxxtools/test/csvserializer-test.cpp: print header line in csv serializer when titles are set explicitly even if no data lines are written git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1439 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-28 maekitalo * cxxtools/test/serializer-bench.cpp: change serializer-bench to use fraction numbers also in double test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1437 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-28 maekitalo * cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/valueparser.cpp: remove unnecessary end of value marker in binary format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1436 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-28 maekitalo * cxxtools/include/cxxtools/bin/serializer.h, cxxtools/test/binserializer-test.cpp: make name parameter optional when serializing objects into binary format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1435 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-28 maekitalo * cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/json/rpcclientimpl.cpp: handle eof in json and binary rpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1434 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-27 maekitalo * cxxtools/src/csvparser.cpp: autodetect tab in csv files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1433 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-26 maekitalo * cxxtools/include/cxxtools/csvserializer.h, cxxtools/src/csvparser.cpp, cxxtools/test/csvdeserializer-test.cpp: fix setting of delimiter in csv parser and impl csv formatter in csv serializer to help binary compatibility in the future git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1431 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-25 maekitalo * cxxtools/include/cxxtools/unit/testmain.h: change in unittest main: take argument list as list of tests to execute instead of option -t and add option -l as an alias to -h (i.e. list available tests) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1430 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-25 maekitalo * cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/socket.cpp, cxxtools/src/json/socket.cpp, cxxtools/test/binrpc-test.cpp, cxxtools/test/jsonrpc-test.cpp, cxxtools/test/xmlrpc-test.cpp: fix bug in binary rpc and json rpc server: large requests (>8192 bytes) let server to wait forever git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1429 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-25 maekitalo * cxxtools/include/cxxtools/posix/commandinput.h, cxxtools/include/cxxtools/posix/commandoutput.h: implement cxxtools::poxix::CommandInput::wait and cxxtools::posix::CommandOutput::wait git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1428 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-24 maekitalo * cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/json/rpcclient.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/json/rpcclient.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/json/rpcclientimpl.h, cxxtools/test/binrpc-test.cpp, cxxtools/test/jsonrpc-test.cpp: fix typo in method name git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1427 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-21 maekitalo * cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/valueparser.cpp: cleanup code in binary parser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1426 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-19 maekitalo * cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/test/binserializer-test.cpp: optimize floating point values binary format again - we have now a medium sized float git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1425 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-18 maekitalo * cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/test/binserializer-test.cpp: serialize floating point values using mantissa and exponent in binary format instead of bcd git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1424 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-18 maekitalo * cxxtools/include/cxxtools/csvformatter.h, cxxtools/include/cxxtools/csvserializer.h, cxxtools/src/csvformatter.cpp, cxxtools/test/csvserializer-test.cpp: make titles changable in csv serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1423 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-16 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/json-test.cpp: add combined json serializer and deserializer test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1422 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-16 maekitalo * cxxtools/test/Makefile.am: remove json-test.cpp from Makefile.am of unit test since it does not exist git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1421 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-15 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/jsonformatter.cpp, cxxtools/test/Makefile.am, cxxtools/test/binserializer-test.cpp, cxxtools/test/serializer-bench.cpp: optimize binary format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1420 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-14 maekitalo * cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/registertest.h, cxxtools/include/cxxtools/unit/testmain.h, cxxtools/src/unit/application.cpp: sort unit tests alphabetically git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1419 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-13 maekitalo * cxxtools/include/cxxtools/convert.h: use one digit more in conversion from string to floating point to reduce rounding error git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1418 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-13 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/test/convert-test.cpp, cxxtools/test/csvserializer-test.cpp: reduce compiler warnings and fix unit test for csv serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1417 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-12 maekitalo * cxxtools/include/cxxtools/convert.h: add missing return value git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1416 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-12 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/test/convert-test.cpp: fix rounding error in convert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1415 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-10 maekitalo * cxxtools/test/convert-test.cpp: add unit test for parsing floating point values with a capital 'E' as exponent git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1412 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-10 maekitalo * cxxtools/src/csvdeserializer.cpp: remove unused local variable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1411 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-09 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/test/convert-test.cpp: fix parsing floating point values in scientific notation with decimal point in cxxtools::convert (Adi) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1410 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-08 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/csvformatter.h, cxxtools/include/cxxtools/decomposer.h, cxxtools/include/cxxtools/deserializerbase.h, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/jsondeserializer.h, cxxtools/include/cxxtools/jsonformatter.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/xml/xmlformatter.h, cxxtools/include/cxxtools/xmlrpc/formatter.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/csvformatter.cpp, cxxtools/src/decomposer.cpp, cxxtools/src/deserializer.cpp, cxxtools/src/formatter.cpp, cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/responder.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/jsondeserializer.cpp, cxxtools/src/jsonformatter.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlformatter.cpp, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/test/serializer-bench.cpp: remove id from SerialzationInfo add json to serializer benchmark git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1409 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-05 maekitalo * cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/decomposer.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/textstream.h, cxxtools/src/json/responder.cpp, cxxtools/src/jsonformatter.cpp: define output operators for wchar_t and const wchar_t* to text streams send right id to client in jsonrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1408 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-05 maekitalo * cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/rpcclientimpl.cpp: add version string to json message to comply with json rpc 2.0 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1407 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-04 maekitalo * cxxtools/test/MyApp.pm: add perl test module for perl json rpc test program git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1406 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-04 maekitalo * cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/deserializerbase.h, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/jsonformatter.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/decomposer.cpp, cxxtools/src/deserializer.cpp, cxxtools/src/formatter.cpp, cxxtools/src/json/responder.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/json/scanner.cpp, cxxtools/src/jsonformatter.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/test/binserializer-test.cpp, cxxtools/test/jsondeserializer-test.cpp, cxxtools/test/jsonechoclient.pl, cxxtools/test/jsonechoserver.pl, cxxtools/test/jsonserializer-test.cpp, cxxtools/test/rpcbenchclient.cpp: add support for null values in serialization and use it in json and binary serialization improve json rpc conformance (works now the perl json rpc client and server) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1405 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-03 maekitalo * cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/httpclientimpl.h, cxxtools/src/json/rpcclient.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/json/rpcclientimpl.h: cleanup code of json-rpc clients git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1404 15ae5fad-cc11-0410-8fac-bce609e504b0 2012-01-02 maekitalo * cxxtools/demo/rpcechoclient.cpp, cxxtools/demo/rpcserver.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/json/httpclient.h, cxxtools/include/cxxtools/json/httpservice.h, cxxtools/include/cxxtools/json/responder.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/json/Makefile.am, cxxtools/src/json/httpclient.cpp, cxxtools/src/json/httpclientimpl.cpp, cxxtools/src/json/httpclientimpl.h, cxxtools/src/json/httpresponder.cpp, cxxtools/src/json/httpresponder.h, cxxtools/src/json/httpservice.cpp, cxxtools/src/json/responder.cpp, cxxtools/src/json/responder.h, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/json/rpcclientimpl.h, cxxtools/src/json/scanner.cpp, cxxtools/src/json/scanner.h, cxxtools/src/json/socket.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/xmlrpc/responder.cpp, cxxtools/src/xmlrpc/service.cpp, cxxtools/test/Makefile.am, cxxtools/test/binrpc-test.cpp, cxxtools/test/jsonrpc-test.cpp, cxxtools/test/jsonrpchttp-test.cpp, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp, cxxtools/test/xmlrpc-test.cpp: implement jsonrpc over http client and server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1403 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-29 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/rpcasyncaddclient.cpp: fix build on ubuntu 11.10 due to new DSO linking behaviour git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1402 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-28 maekitalo * cxxtools/src/jsonformatter.cpp: improve beautification mode of json git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1401 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-28 maekitalo * cxxtools/include/cxxtools/xml/xmlformatter.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/src/xml/xmlformatter.cpp: make xml attributes in xml serialization optional git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1400 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-27 maekitalo * cxxtools/test/jsonrpc-test.cpp: enable CallbackException test for jsonrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1399 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/rpcaddclient.cpp, cxxtools/demo/rpcechoclient.cpp, cxxtools/demo/rpcserver.cpp: add jsonrpc to demo applications git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1398 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-27 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/json/httpclient.h: remove not yet used header file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1397 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/test/jsonrpc-test.cpp: add missing file for jsonrpc test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1396 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/test/xmlrpc-test.cpp: xmlrpc actually do not throw an RemoteException but returns http 404 if method is not found git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1395 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/json/httpclient.h, cxxtools/include/cxxtools/json/request.h, cxxtools/include/cxxtools/json/rpcclient.h, cxxtools/include/cxxtools/json/rpcserver.h, cxxtools/src/json/Makefile.am, cxxtools/src/json/listener.h, cxxtools/src/json/responder.cpp, cxxtools/src/json/responder.h, cxxtools/src/json/rpcclient.cpp, cxxtools/src/json/rpcclientimpl.cpp, cxxtools/src/json/rpcclientimpl.h, cxxtools/src/json/rpcserver.cpp, cxxtools/src/json/rpcserverimpl.cpp, cxxtools/src/json/rpcserverimpl.h, cxxtools/src/json/scanner.cpp, cxxtools/src/json/scanner.h, cxxtools/src/json/socket.cpp, cxxtools/src/json/socket.h, cxxtools/src/json/worker.cpp, cxxtools/src/json/worker.h, cxxtools/test/Makefile.am, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp, cxxtools/test/xmlrpc-test.cpp: implement json rpc over raw socket git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1394 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/include/cxxtools/jsonformatter.h, cxxtools/src/jsonformatter.cpp: override all formatter methods in json formatter for simplification git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1393 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/unit/testsuite.cpp: execute tests in a testsuite of unit test in the same order as registered git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1392 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/test/Makefile.am: test for jsonrpc do not exist yet since jsnorpc do not exist git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1391 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/include/cxxtools/jsonformatter.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/remoteexception.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/jsonformatter.cpp, cxxtools/src/jsonparser.cpp, cxxtools/test/Makefile.am, cxxtools/test/binrpc-test.cpp, cxxtools/test/jsondeserializer-test.cpp, cxxtools/test/jsonserializer-test.cpp: bugfix: jsondeserializer can deserialize now empty arrays add operator== to SerializationInfo and other minor justifications in serialization framework git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1390 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-26 maekitalo * cxxtools/src/jsonformatter.cpp, cxxtools/test/jsonserializer-test.cpp: serialize boolean value in json as "true" or "false" git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1389 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-23 maekitalo * cxxtools/include/cxxtools/delegate.h, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlformatter.cpp, cxxtools/src/xml/xmlreader.cpp: remove unnecessary include of sourceinfo.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1388 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-23 maekitalo * cxxtools/include/cxxtools/posix/exec.h: add missing return value git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1387 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-23 maekitalo * cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/include/cxxtools/serviceregistry.h, cxxtools/src/bin/rpcserver.cpp, cxxtools/src/serviceregistry.cpp: implement method addService in binary rpc server to register all procedures of a service git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1386 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-23 maekitalo * cxxtools/include/cxxtools/posix/exec.h: reduce default size of arguments from 64k to 32k in cxxtools::posix::Exec to save stack git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1385 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-23 maekitalo * cxxtools/src/utf8codec.cpp: fix compiler warning on IBM xlC git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1384 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-21 maekitalo * cxxtools/src/string.cpp: fix unnecessary memory use in string class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1383 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-18 maekitalo * cxxtools/include/cxxtools/config.h: remove generated file config.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1382 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-18 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/bin/deserializer.h, cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/composer.h, cxxtools/include/cxxtools/config.h, cxxtools/include/cxxtools/csvdeserializer.h, cxxtools/include/cxxtools/csvparser.h, cxxtools/include/cxxtools/decomposer.h, cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/deserializerbase.h, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/jsondeserializer.h, cxxtools/include/cxxtools/jsonformatter.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/xml/xmldeserializer.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/scanner.h, cxxtools/src/Makefile.am, cxxtools/src/bin/deserializer.cpp, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/scanner.h, cxxtools/src/bin/valueparser.cpp, cxxtools/src/csvdeserializer.cpp, cxxtools/src/csvparser.cpp, cxxtools/src/decomposer.cpp, cxxtools/src/{composer.cpp => deserializer.cpp}, cxxtools/src/formatter.cpp, cxxtools/src/jsondeserializer.cpp, cxxtools/src/jsonformatter.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/jsonserializer.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/responder.cpp, cxxtools/src/xmlrpc/scanner.cpp, cxxtools/test/Makefile.am: move parse event methods from Composer to Deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1381 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-16 maekitalo * cxxtools/src/csvparser.cpp, cxxtools/test/csvdeserializer-test.cpp: fix parsing csv files with a single column git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1380 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-16 maekitalo * cxxtools/include/cxxtools/conversionerror.h, cxxtools/include/cxxtools/convert.h, cxxtools/src/conversionerror.cpp, cxxtools/src/convert.cpp, cxxtools/test/convert-test.cpp: improve error message in cxxtools::convert and implement conversions from const char* to all number types git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1379 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-15 maekitalo * cxxtools/configure.in, cxxtools/src/Makefile.am, cxxtools/src/bin/Makefile.am, cxxtools/src/http/Makefile.am, cxxtools/src/unit/Makefile.am, cxxtools/src/xml/Makefile.am, cxxtools/src/xmlrpc/Makefile.am: flag -qmkshrobj is still needed on AIX git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1378 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-14 maekitalo * cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/string.cpp: use longer variable names to prevent naming conflict (happened with _N in cxxtools::String on solaris/gcc) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1377 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-14 maekitalo * cxxtools/configure.in, cxxtools/src/Makefile.am, cxxtools/src/bin/Makefile.am, cxxtools/src/http/Makefile.am, cxxtools/src/unit/Makefile.am, cxxtools/src/xml/Makefile.am, cxxtools/src/xmlrpc/Makefile.am: shared lib flag -qmkshrobj for AIX is not needed any more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1376 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-12 maekitalo * cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/valueparser.cpp, cxxtools/test/binserializer-test.cpp: fix binary deserializer for AIX (PowerPC, big endian) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1375 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-12 maekitalo * cxxtools/test/serializationinfo-test.cpp: fix unit test for IBM/xlc compiler git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1374 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-11 maekitalo * cxxtools/src/csvparser.cpp: initializer csv parser correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1373 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-11 maekitalo * cxxtools/src/bin/socket.cpp: fix crash in binary rpc server after last check in git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1372 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-11 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/include/cxxtools/serviceprocedure.h, cxxtools/include/cxxtools/serviceregistry.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/Makefile.am, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/rpcserver.cpp, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/bin/rpcserverimpl.h, cxxtools/src/bin/socket.cpp, cxxtools/src/bin/socket.h, cxxtools/src/serviceregistry.cpp, cxxtools/src/xmlrpc/service.cpp: new class ServiceRegistry for registering rpc functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1371 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-11 maekitalo * cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/test/serializationinfo-test.cpp: add range checks into serializationinfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1370 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-10 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/csvdeserializer.h, cxxtools/include/cxxtools/csvparser.h, cxxtools/src/Makefile.am, cxxtools/src/csvdeserializer.cpp, cxxtools/src/csvparser.cpp: move csv parser code from CsvDeserializer into a separaten class CsvParser git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1369 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-10 maekitalo * cxxtools/include/cxxtools/composer.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/src/jsonparser.cpp: finish method of json parser does not return anything git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1368 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-09 maekitalo * cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/serializationinfo.cpp, cxxtools/test/serializationinfo-test.cpp: add char type to SerializationInfo and make some fixes in type conversion in SerializationInfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1367 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-09 maekitalo * cxxtools/src/serializationinfo.cpp, cxxtools/test/serializationinfo-test.cpp: fix deserialization of bool from std::string git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1366 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-09 maekitalo * cxxtools/include/cxxtools/sourceinfo.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlformatter.cpp, cxxtools/src/xml/xmlreader.cpp: remove some remaining source info outputs from exceptions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1365 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-08 maekitalo * cxxtools/include/cxxtools/composer.h, cxxtools/include/cxxtools/decomposer.h, cxxtools/include/cxxtools/deserializer.h, cxxtools/test/serializationinfo-test.cpp: make composer and decomposer non copyable and fix 2 compile problems with IBM xlc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1364 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-08 maekitalo * cxxtools/include/Makefile.am: add missing file to Makefile.am (this time the right one) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1363 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-08 maekitalo * cxxtools/include/Makefile.am: add missing file to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1362 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-08 maekitalo * cxxtools/src/serializationinfo.cpp: fix serializationinfo for IBM xlc compiler git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1361 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-06 maekitalo * cxxtools/src/tcpserverimpl.cpp: check right config variable to enable IPv6 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1360 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-06 maekitalo * cxxtools/include/cxxtools/serializationerror.h, cxxtools/src/serializationerror.cpp, cxxtools/src/serializationinfo.cpp: new exception type SerializationMemberNotFound which is thrown, when a deserialization operator do not find a member with the specified name git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1359 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-06 maekitalo * cxxtools/src/xmlrpc/responder.cpp: add procedure name into error message of xmlrpc server when procedure is not found git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1358 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-05 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/src/jsonserializer.cpp, cxxtools/test/jsonserializer-test.cpp: allow multiple objects to be serialized into a single json object in json serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1357 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-05 maekitalo * cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/test/binrpc-test.cpp: add optional praefix for method calls in binary rpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1356 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-05 maekitalo * cxxtools/include/cxxtools/date.h, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/ioerror.h, cxxtools/include/cxxtools/serializationerror.h, cxxtools/include/cxxtools/settings.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/time.h, cxxtools/src/applicationimpl.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/conditionimpl.cpp, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/directory.cpp, cxxtools/src/directoryimpl.cpp, cxxtools/src/file.cpp, cxxtools/src/fileimpl.cpp, cxxtools/src/iodevice.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/ioerror.cpp, cxxtools/src/library.cpp, cxxtools/src/libraryimpl.cpp, cxxtools/src/muteximpl.cpp, cxxtools/src/pipeimpl.cpp, cxxtools/src/selectorimpl.cpp, cxxtools/src/semaphoreimpl.cpp, cxxtools/src/serializationerror.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/src/settings.cpp, cxxtools/src/settingsreader.cpp, cxxtools/src/streambuffer.cpp, cxxtools/src/systemerror.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/threadimpl.cpp, cxxtools/src/time.cpp: Remove SourceInfo since I don't want to know where a error was detected but what happened. git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1355 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-05 maekitalo * cxxtools/src/bin/worker.cpp, cxxtools/src/http/worker.cpp: we need at least a short idle timeout in http server and binar rpc server; otherwise performance is bad git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1354 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/src/bin/rpcserver.cpp, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/bin/rpcserverimpl.h, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/worker.cpp, cxxtools/src/http/serverimplbase.h, cxxtools/src/http/worker.cpp: remove idle timeout in http server and binary rpc server to make stopping server faster (I don't think it was worth anyway) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1353 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/test/binrpc-test.cpp, cxxtools/test/xmlrpc-test.cpp: do not recreate the event loop in unit tests for each test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1352 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/test/xmlrpc-test.cpp: use configured port in unit xmlrpc test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1351 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/include/cxxtools/csvserializer.h, cxxtools/include/cxxtools/decomposer.h, cxxtools/include/cxxtools/xml/xmlformatter.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/src/decomposer.cpp, cxxtools/src/xml/Makefile.am, cxxtools/src/xml/xmlformatter.cpp, cxxtools/src/xml/xmlserializer.cpp, cxxtools/test/Makefile.am, cxxtools/test/xmlserializer-test.cpp: remove obsolete class SerializationContext git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1350 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/include/cxxtools/http/server.h: increase default listen backlog from 5 to 64 in http server and binary rpc server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1349 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/src/tcpserverimpl.cpp: do not throw exception on EINTR in accept system call but just repeat it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1348 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/demo/json.cpp: use new shorter variant of json serializer in json demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1347 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/src/jsonserializer.cpp, cxxtools/test/Makefile.am, cxxtools/test/jsonserializer-test.cpp: add method "JsonSerializer::serializer(const T&)" to serializer a C++ value without wrapping it into a json object git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1346 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/demo/rpcasyncaddclient.cpp, cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/deserializer.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/scanner.h: update license headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1345 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-04 maekitalo * cxxtools/include/cxxtools/composer.h, cxxtools/include/cxxtools/deserializer.h, cxxtools/src/composer.cpp: minor cleanup in composer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1344 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-03 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/bin/deserializer.h, cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/composer.h, cxxtools/include/cxxtools/csvdeserializer.h, cxxtools/include/cxxtools/csvserializer.h, cxxtools/include/cxxtools/{serializer.h => decomposer.h}, cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/jsondeserializer.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/remoteclient.h, cxxtools/include/cxxtools/remoteprocedure.h, cxxtools/include/cxxtools/serviceprocedure.h, cxxtools/include/cxxtools/xml/xmldeserializer.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/scanner.h, cxxtools/src/Makefile.am, cxxtools/src/bin/deserializer.cpp, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/scanner.h, cxxtools/src/bin/valueparser.cpp, cxxtools/src/composer.cpp, cxxtools/src/csvdeserializer.cpp, cxxtools/src/{serializer.cpp => decomposer.cpp}, cxxtools/src/deserializer.cpp, cxxtools/src/jsondeserializer.cpp, cxxtools/src/jsonparser.cpp, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/responder.cpp, cxxtools/src/xmlrpc/scanner.cpp: rename Serializer to Composer and Deserializer to Decomposer to distinguish them from real Serializer classes (and consistency with Pt) add optional name parameter to deserialize method of Deserializer to make it symetric with Serialzer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1343 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-02 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/test/binserializer-test.cpp: zero byte in std::string works know in binary format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1342 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-02 maekitalo * cxxtools/src/csvdeserializer.cpp, cxxtools/test/csvdeserializer-test.cpp: fix csvdeserializer: empty cells are processed correctly now and lf, cr and cr/lf is all allowed as a row delimiter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1341 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-12-01 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/test/convert-test.cpp: converting empty string to number should fail git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1340 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-30 maekitalo * cxxtools/configure.in: change configure.in back after accidental change git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1339 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-30 maekitalo * cxxtools/src/xmlrpc/httpclientimpl.cpp: accept character set specification in content type reply header in xmlrpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1338 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-30 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/bin/valueparser.cpp, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/serializer.cpp, cxxtools/src/settingswriter.cpp, cxxtools/src/time.cpp, cxxtools/test/binrpc-test.cpp, cxxtools/test/serializationinfo-test.cpp, cxxtools/test/xmlrpc-test.cpp: remove template helper methods toValue and getValue from SerializationInfo since gcc 4.1 seems to have problems with it (at least it does not compile on red hat 5.3) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1337 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-29 maekitalo * cxxtools/src/bindeserializer.cpp: remove obsolete file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1336 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-29 maekitalo * cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/csvformatter.h, cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/include/cxxtools/xmlrpc/formatter.h, cxxtools/src/Makefile.am, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/bindeserializer.cpp, cxxtools/src/convert.cpp, cxxtools/src/csvformatter.cpp, cxxtools/src/deserializer.cpp, cxxtools/src/formatter.cpp, cxxtools/src/jsonserializer.cpp, cxxtools/src/serializationinfo.cpp, cxxtools/src/serializer.cpp, cxxtools/src/settingswriter.cpp, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlserializer.cpp, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/test/Makefile.am, cxxtools/test/binrpc-test.cpp, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp, cxxtools/test/serializationinfo-test.cpp: major optimzations: - SerializationInfo has now a union with different types instead of just converting everyting into unicode string - remove reference feature from serialization framework since there is currently no format, which actually uses it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1335 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-27 maekitalo * cxxtools/test/rpcbenchclient.cpp: use passed ip address also in rpcbenchclient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1334 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/rpcasyncaddclient.cpp, cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/src/bin/formatter.cpp, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/scanner.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/unit/testcontext.cpp, cxxtools/test/Makefile.am, cxxtools/test/binrpc-test.cpp, cxxtools/test/xmlrpc-test.cpp: implement async functionality in binary rpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1333 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-26 maekitalo * cxxtools/test/rpcbenchclient.cpp: use right port by default in rpcbenchclient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1332 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-26 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/binrpcserver.cpp, cxxtools/demo/rpcaddclient.cpp, cxxtools/demo/rpcechoclient.cpp, cxxtools/demo/rpcserver.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/bin/rpcclient.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/remoteprocedure.h, cxxtools/src/bin/Makefile.am, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/rpcclient.cpp, cxxtools/src/bin/rpcclientimpl.cpp, cxxtools/src/bin/rpcclientimpl.h, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/bin/scanner.cpp, cxxtools/src/bin/scanner.h, cxxtools/src/bin/worker.cpp, cxxtools/test/Makefile.am, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp: add rpc binary client (asyncronous requests do not work yet) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1331 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-26 maekitalo * cxxtools/demo/binrpcserver.cpp, cxxtools/doc/binserialization.txt, cxxtools/src/bin/responder.cpp: add error code to binary exception response git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1330 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-25 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/xmlrpc/result.h: remove obsolete header cxxtools/xmlrpc/result.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1329 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-25 maekitalo * cxxtools/test/jsondeserializer-test.cpp: fix jsondesrializer test, so that it works with IBM xlC compiler also git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1328 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-24 maekitalo * cxxtools/test/jsondeserializer-test.cpp: add another test for json deserializer for complex objects git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1327 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-24 maekitalo * cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/include/cxxtools/jsondeserializer.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/include/cxxtools/remoteclient.h, cxxtools/include/cxxtools/remoteexception.h, cxxtools/src/bin/rpcserver.cpp, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/bin/rpcserverimpl.h, cxxtools/src/bin/socket.cpp, cxxtools/src/bin/socket.h, cxxtools/src/bin/worker.h, cxxtools/src/jsondeserializer.cpp, cxxtools/src/jsonparser.cpp: update license headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1326 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-23 maekitalo * cxxtools/demo/rpcaddclient.cpp, cxxtools/demo/rpcechoclient.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/remoteclient.h, cxxtools/include/cxxtools/remoteexception.h, cxxtools/include/cxxtools/{xmlrpc => }/remoteprocedure.h, cxxtools/include/cxxtools/remoteresult.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/{src/xmlrpc/fault.cpp => include/cxxtools/xmlrpc/errorcodes.h}, cxxtools/include/cxxtools/xmlrpc/fault.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/src/xmlrpc/Makefile.am, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/responder.cpp, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/xmlrpc-test.cpp: generalize rpc client in preparation for binary rpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1325 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-23 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/csvdeserializer.h, cxxtools/include/cxxtools/jsondeserializer.h, cxxtools/include/cxxtools/jsonparser.h, cxxtools/src/Makefile.am, cxxtools/src/jsondeserializer.cpp, cxxtools/src/jsonparser.cpp, cxxtools/test/Makefile.am, cxxtools/test/jsondeserializer-test.cpp: implement json deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1324 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-23 maekitalo * cxxtools/src/xml/xmlserializer.cpp, cxxtools/src/xml/xmlwriter.cpp: add checks for empty tags in xml writer and xml serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1323 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-23 maekitalo * cxxtools/test/trim-test.cpp: fix unit test for trim git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1322 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-22 maekitalo * cxxtools/include/cxxtools/trim.h: add missing inline into trim functions and add cr and lf to default white space git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1321 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-21 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: std::list and std::deque do have a reserve method only in GNU git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1320 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-21 maekitalo * cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/serializer.h, cxxtools/src/serializationinfo.cpp: new method cxxtools::SerializationInfo::swap git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1319 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-20 maekitalo * cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/socket.cpp, cxxtools/src/bin/valueparser.cpp: fix error handling in binary server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1318 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-20 maekitalo * cxxtools/src/bin/valueparser.cpp: handle utf8 correctly when parsing binary format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1317 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-20 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/binrpcserver.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/bin/rpcserver.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/src/bin/Makefile.am, cxxtools/src/bin/listener.h, cxxtools/src/bin/responder.cpp, cxxtools/src/bin/responder.h, cxxtools/src/bin/rpcserver.cpp, cxxtools/src/bin/rpcserverimpl.cpp, cxxtools/src/bin/rpcserverimpl.h, cxxtools/src/bin/socket.cpp, cxxtools/src/bin/socket.h, cxxtools/src/bin/worker.cpp, cxxtools/src/bin/worker.h, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: implementation of binary rpc server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1316 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-19 maekitalo * cxxtools/include/cxxtools/hmac.h: add missing hedaer hmac.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1315 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-19 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/md5.h, cxxtools/src/md5stream.cpp, cxxtools/test/Makefile.am, cxxtools/test/md5-test.cpp: add hmac (rfc 2104) implementation and unit tests for md5 and hmac (yofuh) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1314 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-18 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/csvdeserializer.h, cxxtools/include/cxxtools/csvformatter.h, cxxtools/include/cxxtools/csvserializer.h, cxxtools/src/Makefile.am, cxxtools/src/csvdeserializer.cpp, cxxtools/src/csvformatter.cpp, cxxtools/test/Makefile.am, cxxtools/test/csvserializer-test.cpp: implement csv serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1313 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-17 maekitalo * cxxtools/src/xml/xmlreader.cpp: allow colon in attribute names of xml files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1312 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-16 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: small optimization of SerializationInfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1311 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-16 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/csvdeserializer.h, cxxtools/src/Makefile.am, cxxtools/src/csvdeserializer.cpp, cxxtools/src/selectorimpl.cpp, cxxtools/test/Makefile.am, cxxtools/test/csvdeserializer-test.cpp: implement deserializer for csv git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1310 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/serviceprocedure.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/xmlrpc/service.cpp: move ServiceProcedure from namespace cxxtools::xmlrpc to cxxtools git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1309 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/bin/formatter.h, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/src/bin/Makefile.am, cxxtools/src/bin/{serializer.cpp => formatter.cpp}: move cxxtools::bin::Formatter into separate header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1308 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/include/cxxtools/bin/deserializer.h: remove reference to removed binary serializer error in binary deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1307 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/include/cxxtools/argin.h, cxxtools/include/cxxtools/argout.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/posix/exec.h, cxxtools/src/bin/deserializer.cpp, cxxtools/src/bin/valueparser.cpp, cxxtools/src/http/mapper.cpp, cxxtools/src/http/mapper.h, cxxtools/utils/setLicense.pl: update copyright header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1306 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/src/Makefile.am, cxxtools/src/processimpl.cpp, cxxtools/src/processimpl.h: remove obsolete class ProcessImpl git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1305 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/{bindeserializer.h => bin/deserializer.h}, cxxtools/include/cxxtools/bin/serializer.h, cxxtools/include/cxxtools/bin/valueparser.h, cxxtools/include/cxxtools/binserializer.h, cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/src/Makefile.am, cxxtools/src/bin/Makefile.am, cxxtools/src/bin/deserializer.cpp, cxxtools/src/{binserializer.cpp => bin/serializer.cpp}, cxxtools/src/bin/valueparser.cpp, cxxtools/test/Makefile.am, cxxtools/test/binserializer-test.cpp, cxxtools/test/serializer-bench.cpp: move binary serializer and deserializer into separate library and rewrite binary deserializer to fit better into a binary rpc server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1304 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-13 maekitalo * cxxtools/src/bindeserializer.cpp: minor fix in bindeserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1303 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-12 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp: change binary serialization format for easier parsing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1302 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-09 maekitalo * cxxtools/include/cxxtools/net/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/tcpstream.cpp: simplyfy use of cxxtools::net::TcpStream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1301 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-08 maekitalo * cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp, cxxtools/test/serializer-bench.cpp: encode bool as single byte in binary serialization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1300 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-08 maekitalo * cxxtools/ChangeLog: fix typo in ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1299 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-07 maekitalo * cxxtools/src/Makefile.am: add missing header to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1298 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-05 maekitalo * cxxtools/doc/binserialization.txt: specify remote methods for binary serialization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1297 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-05 maekitalo * cxxtools/include/cxxtools/string.h: add marker for exported function to output operator of cxxtools::String git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1296 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-04 maekitalo * cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/string.cpp: optimize cxxtools::String::replace methods and do some code cleanup in cxxtools::String class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1295 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-11-01 maekitalo * cxxtools/test/serializer-bench.cpp: improve serializer benchmark program git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1294 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-31 maekitalo * cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp: improve rpc benchmark client and server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1293 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-28 maekitalo * cxxtools/include/cxxtools/fdstream.h, cxxtools/src/fdstream.cpp: fix handling of buffer in cxxtools::Fdiostream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1292 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-28 maekitalo * cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/src/md5.c, cxxtools/src/md5.h, cxxtools/src/md5stream.cpp: move private md5 interface to private header and md5 helper functions to cxxtools/md5.h header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1291 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-27 maekitalo * cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/string.cpp: string improvements: extend string capacity by factor of 1.5 instead of 2 and define output operator to std::ostream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1290 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-27 maekitalo * cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp: add help page to xmlrpc benchmark programs git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1289 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-26 maekitalo * cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/string.cpp, cxxtools/src/xml/xmlserializer.cpp, cxxtools/test/string-test.cpp: allow assignment of narrow string to cxxtools::String git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1288 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-25 maekitalo * cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc32.h, cxxtools/include/cxxtools/atomicity.gcc.sparc64.h: add missing files for atomicity/sparc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1287 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-25 maekitalo * cxxtools/src/string.cpp: fix String::widen_assign git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1286 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-25 maekitalo * cxxtools/include/cxxtools/string.h: minor fixes in string class (formatting, export macro) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1285 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-25 maekitalo * cxxtools/test/Makefile.am: reduce number of shared libraries linked to test programs git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1284 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-25 maekitalo * cxxtools/include/cxxtools/string.h: minor fix in cxxtools::String (fix data type) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1283 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-24 maekitalo * cxxtools/src/http/serverimplbase.h: fix to remove compiler warning git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1282 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-24 maekitalo * cxxtools/src/string.cpp: add some missing return statements in String class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1281 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-24 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/include/cxxtools/stringdata.h, cxxtools/include/cxxtools/stringdata.tpp, cxxtools/src/binserializer.cpp, cxxtools/src/string.cpp, cxxtools/src/xml/xmlserializer.cpp, cxxtools/test/serializer-bench.cpp, cxxtools/test/string-test.cpp: optimize cxxtools::String (short string optimization, no refcounting) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1280 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-24 maekitalo * cxxtools/test/rpcbenchclient.cpp: use atomic operation in rpcbenchclient to increment request counter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1279 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-22 maekitalo * cxxtools/m4/asmtype.m4: fix detection of sparc 64 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1278 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-22 maekitalo * cxxtools/include/cxxtools/atomicity.h: fix detection of 64 bit sparc in generic part git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1277 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-22 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/m4/asmtype.m4, cxxtools/src/Makefile.am, cxxtools/src/atomicity.cpp, cxxtools/src/atomicity.gcc.sparc32.cpp, cxxtools/src/{atomicity.gcc.sparc.cpp => atomicity.gcc.sparc64.cpp}: make distinction between sparc32 and sparc64 (yofuh) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1276 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-22 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/string-test.cpp: add unittest for cxxtools::String (copied from pt-framework) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1275 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-20 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/serverimplbase.h: abstract http server implementation even more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1274 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-20 maekitalo * cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/Makefile.am, cxxtools/src/string.cpp: do not inline everything from cxxtools::String git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1273 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-17 maekitalo * cxxtools/include/cxxtools/serializer.h: make SerializationContext non copyable as it should be git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1272 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-17 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/rpcbenchclient.cpp, cxxtools/test/rpcbenchserver.cpp: add benchmark client and server for xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1271 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-16 maekitalo * cxxtools/src/http/clientimpl.cpp: fix reading chunked encoding in http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1270 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-07 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/argin.h, cxxtools/include/cxxtools/argout.h: fix cxxtools::ArgIn and cxxtools::ArgOut classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1269 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-10-05 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: make cxxtools::SerializationInfo serializable and deserializable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1268 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-30 maekitalo * cxxtools/test/serializer-bench.cpp: improve serializer benchmark program (passing flag -f program writes output to files) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1267 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-28 maekitalo * cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/utils/xmlrpcservice.pl: xmlrpc::Service::createResponder should be protected git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1266 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-28 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/rpcaddclient.cpp, cxxtools/demo/{rpcechoserver.cpp => rpcserver.cpp}, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/utils/xmlrpcservice.pl: add template methods registerFunction and registerCallable to xmlrpc service to even more simplify definition of xmlrpc service functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1265 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-22 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/binserializer.h, cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp, cxxtools/test/binserializer-test.cpp, cxxtools/test/serializer-bench.cpp: implement bcd encoding for double values in binary serialization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1264 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-22 maekitalo * cxxtools/include/cxxtools/unit/assertion.h, cxxtools/test/xmlrpc-test.cpp: unit test assertion macros are now only one statement git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1263 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-22 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/bindeserializer.h, cxxtools/include/cxxtools/binserializer.h, cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp, cxxtools/test/binserializer-test.cpp: binary integers in binary serialization format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1262 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-21 adig33 * cxxtools/configure.in: one more fix for autoconf version 2.68 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1261 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-21 maekitalo * cxxtools/configure.in: another fix autoconf check since autoconf version 2.68 do not accept the current any more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1260 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-21 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/typetraits.h, cxxtools/src/convert.cpp, cxxtools/test/convert-test.cpp: optimized cxxtools::convert (ported from Pt-framework) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1259 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-21 maekitalo * cxxtools/demo/json.cpp: add missing return statement git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1258 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-20 maekitalo * cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/posix/commandinput.h, cxxtools/include/cxxtools/posix/commandoutput.h, cxxtools/src/http/Makefile.am, cxxtools/test/convert-test.cpp, cxxtools/test/serializer-bench.cpp, cxxtools/test/xmlreader-test.cpp, cxxtools/test/xmlrpc-test.cpp: fix problems with AIX/xlC git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1257 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-20 maekitalo * cxxtools/m4/asmtype.m4: fix autoconf check since autoconf version 2.68 do not accept the current any more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1256 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-19 adig33 * cxxtools/src/facets.cpp: revert to 1252 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1255 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-19 adig33 * cxxtools/src/facets.cpp: undo change git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1254 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-19 adig33 * cxxtools/src/facets.cpp: added #include facets.h in facets.cpp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1253 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-18 maekitalo * cxxtools/src/http/mapper.h: add missing include guards (had no effect, but better to have it) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1252 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-06 maekitalo * cxxtools/include/cxxtools/smartptr.h: change SmartPtr again for compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1251 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-05 maekitalo * cxxtools/include/cxxtools/membar.h, cxxtools/include/cxxtools/smartptr.h: add missing file membar.h change default destroy policy in smartptr again for compatibility reasons git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1250 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-05 maekitalo * cxxtools/include/cxxtools/smartptr.h: define old DefaultDestroyPolicy again for compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1249 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-04 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/membar.gcc.arm.h, cxxtools/include/cxxtools/membar.gcc.h, cxxtools/include/cxxtools/membar.gcc.mips.h, cxxtools/include/cxxtools/membar.gcc.nosmp.h, cxxtools/include/cxxtools/membar.gcc.ppc.h, cxxtools/include/cxxtools/membar.gcc.sparc32.h, cxxtools/include/cxxtools/membar.gcc.sparc64.h, cxxtools/include/cxxtools/membar.gcc.x86.h, cxxtools/include/cxxtools/membar.sun.h, cxxtools/include/cxxtools/membar.windows.h: add memory barrier code (thanks yofuh) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1248 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-04 maekitalo * cxxtools/include/cxxtools/pool.h: rename DefaultDestroyPolicy to DeletePolicy in SmartPtr since it expresses better, what is really done (forgot to fix pool.h) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1247 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-04 maekitalo * cxxtools/include/cxxtools/smartptr.h: rename DefaultDestroyPolicy to DeletePolicy in SmartPtr since it expresses better, what is really done git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1246 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-09-03 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1245 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-30 maekitalo * cxxtools/src/http/mapper.cpp: fix crash in http server when last service is manually removed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1244 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-28 maekitalo * cxxtools/include/cxxtools/singleton.h, cxxtools/include/cxxtools/streambuffer.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/timer.h: fix typos in comments git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1243 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-28 maekitalo * cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/xmlrpc/service.cpp: fix potential memory leak remove unused template parameter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1242 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-27 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/cxxtools/bindeserializer.h, cxxtools/include/cxxtools/binserializer.h, cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp, cxxtools/test/serializer-bench.cpp: optimize binary serialization format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1241 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-26 maekitalo * cxxtools/include/cxxtools/bindeserializer.h, cxxtools/include/cxxtools/binserializer.h, cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp, cxxtools/test/binserializer-test.cpp, cxxtools/test/serializer-bench.cpp: fix license headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1240 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-26 maekitalo * cxxtools/include/cxxtools/bindeserializer.h, cxxtools/include/cxxtools/binserializer.h: add missing files from binary serializer/deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1239 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-26 maekitalo * cxxtools/doc/binserialization.txt, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/deserializer.h, cxxtools/src/Makefile.am, cxxtools/src/bindeserializer.cpp, cxxtools/src/binserializer.cpp, cxxtools/test/Makefile.am, cxxtools/test/binserializer-test.cpp, cxxtools/test/serializer-bench.cpp: implement binary serializer/deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1238 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-26 maekitalo * cxxtools/include/cxxtools/argin.h, cxxtools/include/cxxtools/argout.h: helper classes for controling input or output using command line argument git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1237 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-23 maekitalo * cxxtools/test/process-test.cpp: remove another obsolete test program git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1236 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-23 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/abort.cpp: remove obsolete test program and non existing test module accidentally added to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1235 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-22 maekitalo * cxxtools/test/Makefile.am, cxxtools/test/arg-test.cpp, cxxtools/test/base64-test.cpp, cxxtools/test/cache-test.cpp, cxxtools/test/convert-test.cpp, cxxtools/test/pool-test.cpp, cxxtools/test/process-test.cpp, cxxtools/test/smartptr-test.cpp, cxxtools/test/tcpsockettest.cpp, cxxtools/test/trim-test.cpp, cxxtools/test/uri-test.cpp, cxxtools/test/xmlreader-test.cpp, cxxtools/test/xmlrpc-test.cpp: remove single test programs since they can be called using -t switch of alltests git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1234 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-08-12 maekitalo * cxxtools/src/iconvstream.cpp: fix error checking in iconvstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1233 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-06-24 maekitalo * cxxtools/include/cxxtools/iostream.h: fix for clang++: looks like it is pinkier about missing this when accessing members of base classes in template classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1232 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-06-06 maekitalo * cxxtools/src/http/serverimpl.cpp: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1231 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-06-05 maekitalo * cxxtools/src/http/serverimpl.cpp: ignore SIGPIPE in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1230 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-06-05 maekitalo * cxxtools/include/cxxtools/http/responder.h, cxxtools/src/http/responder.cpp: read body into request body in http server by default git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1229 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-06-04 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/regex.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/mapper.cpp, cxxtools/src/http/mapper.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: regular expressions can now be used for mapping to responder in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1228 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-31 maekitalo * cxxtools/include/cxxtools/posix/exec.h, cxxtools/src/posix/commandinput.cpp, cxxtools/src/posix/commandoutput.cpp: do not throw after fork but just exit with -1 in command input and output git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1227 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-26 maekitalo * cxxtools/include/cxxtools/ioerror.h, cxxtools/include/cxxtools/net/tcpserver.h, cxxtools/src/ioerror.cpp, cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp: add address to exception message of AddressInUse git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1226 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-25 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/posix/fork.h, cxxtools/include/cxxtools/process.h, cxxtools/src/Makefile.am, cxxtools/src/pipe.cpp, cxxtools/src/posix/pipestream.cpp, cxxtools/src/process.cpp: replace last references to cxxtools/syserror.h with cxxtools/systemerror.h remove now obsolet class process.cpp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1225 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-23 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/syserror.h: remove obsolete cxxtools::SysError class (replaced with cxxtools::SystemError long time ago) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1224 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-22 maekitalo * cxxtools/demo/execLs.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/posix/commandinput.h, cxxtools/include/cxxtools/posix/commandoutput.h, cxxtools/include/cxxtools/posix/fork.h, cxxtools/include/cxxtools/posix/pipestream.h, cxxtools/src/Makefile.am, cxxtools/src/posix/commandinput.cpp, cxxtools/src/posix/commandoutput.cpp, cxxtools/test/Makefile.am: add classes cxxtools::posix::CommandInput and cxxtools::posix::CommandOutput for easily reading from and writing to processes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1223 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-21 maekitalo * cxxtools/demo/execLs.cpp, cxxtools/demo/pipestream.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/fork.h, cxxtools/include/cxxtools/posix/exec.h, cxxtools/include/cxxtools/posix/fork.h: move Fork-class from cxxtools to cxxtools::posix namespace add a wrapper cxxtools::posix::Exec around exec??-functions of posix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1222 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-21 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/execLs.cpp, cxxtools/include/cxxtools/posix/pipe.h, cxxtools/src/pipeimpl.cpp, cxxtools/src/pipeimpl.h, cxxtools/src/posix/posixpipe.cpp: inherit pipe filedescriptor by default in cxxtools::posix::Pipe git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1221 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-19 maekitalo * cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/xml/xmlreader.cpp: set default char ? to cxxtools::Char::narrow use ? instead of _ as default in cxxtools::String::narrow fix error message in xml reader when unexpected character is found git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1220 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-08 maekitalo * cxxtools/include/cxxtools/convert.h: add conversion function from std::string to std::string (just assignment) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1219 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-05-06 maekitalo * cxxtools/src/log.cpp: print log messages to stderr instead of stdout git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1218 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-04-29 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/xml/xmlserializer.h: add beautify flag to static toString methods of xml and json serializers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1217 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-04-29 maekitalo * cxxtools/include/cxxtools/file.h, cxxtools/src/file.cpp, cxxtools/src/fileimpl.cpp, cxxtools/src/fileimpl.h: add link and symlink methods to file class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1216 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-04-24 maekitalo * cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/sourceinfo.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/src/unit/testprotocol.cpp, cxxtools/src/xml/xmldeserializer.cpp: replace Pt with cxxtools in some comments, which were left over git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1215 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-04-03 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1214 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-04-02 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/regex.cpp: add regex demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1213 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-29 maekitalo * cxxtools/src/http/serverimpl.cpp: fix stopping http server without listener git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1212 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-28 maekitalo * cxxtools/src/tcpsocketimpl.h: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1211 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-28 maekitalo * cxxtools/include/cxxtools/http/messageheader.h: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1210 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-27 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/sudo.h, cxxtools/src/sudo.cpp: remove cxxtools::sodo - it was non functional anyway git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1209 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-26 maekitalo * cxxtools/include/cxxtools/smartptr.h: make destroy policy method public in smartptr (it is called in tntnet directly) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1208 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-26 maekitalo * cxxtools/include/cxxtools/smartptr.h, cxxtools/test/Makefile.am, cxxtools/test/pool-test.cpp, cxxtools/test/smartptr-test.cpp: add documentation and unit test to smartptr and do some minor fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1207 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-26 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/rpcecho.cpp, cxxtools/demo/rpcechoclient.cpp, cxxtools/demo/rpcechoserver.cpp: split rpcecho demo into separate client and server for simplification git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1206 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-24 maekitalo * cxxtools/src/jsonserializer.cpp: make null from nan, inf and -inf in json serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1205 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-03-21 maekitalo * cxxtools/include/cxxtools/net/tcpserver.h, cxxtools/include/cxxtools/net/tcpsocket.h: purely cosmetic change git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1204 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-02-27 maekitalo * cxxtools/demo/pool.cpp, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/smartptr.h, cxxtools/test/Makefile.am, cxxtools/test/pool-test.cpp, cxxtools/test/pooltest.cpp: reimplement cxxtools::pool using smart pointer instead of proxy object git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1203 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-02-04 maekitalo * cxxtools/include/cxxtools/query_params.h: do not pass output_iterator as reference to QueryParams::get to get unnamed params; iterators should be always by value git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1202 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-02-03 maekitalo * cxxtools/src/jsonserializer.cpp: do not put boolean values into quotation marks in json git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1201 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-31 maekitalo * cxxtools/include/cxxtools/cache.h, cxxtools/test/Makefile.am, cxxtools/test/cache-test.cpp: add put_top method to cache to use it as a simple lru cache git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1200 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-31 maekitalo * cxxtools/src/convert.cpp, cxxtools/test/convert-test.cpp: accept "inifity" for float and double values in convert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1199 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-31 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/json.cpp: add demo for json serializer in a http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1198 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-29 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/src/convert.cpp, cxxtools/test/convert-test.cpp: improved support nan and inf in conversion functions for float and double git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1197 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-26 maekitalo * cxxtools/include/cxxtools/atomicity.h: fix include guard in atomicity.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1196 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-24 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/src/Makefile.am, cxxtools/src/convert.cpp: do not inline larger functions in cxxtools::convert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1195 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-24 maekitalo * cxxtools/demo/threadpool.cpp, cxxtools/include/cxxtools/threadpool.h, cxxtools/src/threadpool.cpp, cxxtools/src/threadpoolimpl.cpp, cxxtools/src/threadpoolimpl.h: fix license header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1194 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-24 maekitalo * cxxtools/include/cxxtools/convert.h: fix data type in conversion function git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1193 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-23 maekitalo * cxxtools/include/cxxtools/datetime.h, cxxtools/src/datetime.cpp, cxxtools/src/http/messageheader.cpp, cxxtools/src/uri.cpp: move some larger methods from DateTime to cpp file and other small code cleanup git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1192 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-23 maekitalo * cxxtools/include/cxxtools/datetime.h: add compare operators to cxxtools::DateTime git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1191 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-15 maekitalo * cxxtools/include/cxxtools/net/uri.h: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1190 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-15 maekitalo * cxxtools/test/xmlrpc-test.cpp: do not use explicit IPv4 addresses in xmlrpc unittest git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1189 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-15 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/xml/xmldeserializer.h, cxxtools/include/cxxtools/xml/xmlserializer.h: add static toString and toObject methods to serializers and deserializer to simplify api git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1188 15ae5fad-cc11-0410-8fac-bce609e504b0 2011-01-15 maekitalo * cxxtools/include/cxxtools/net/uri.h, cxxtools/test/uri-test.cpp: fix typo, add CXXTOOLS_API specifier to class definition git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1187 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-31 maekitalo * cxxtools/include/cxxtools/conversionerror.h, cxxtools/src/processimpl.cpp, cxxtools/src/tcpserverimpl.cpp: fix some problems due to apache stl (were issues in cxxtools - not apache stl) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1186 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-28 maekitalo * cxxtools/src/serializationinfo.cpp, cxxtools/src/xml/xmldeserializer.cpp: 2 fixes for xmldeserialation: move type from tag name back to typeName in serializationinfo do not change category from Array to Object when elements are added to an array git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1185 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-28 maekitalo * cxxtools/include/cxxtools/string.tpp: bugfix: accidentally removed allocation for string when copied git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1184 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-27 maekitalo * cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/xml/xmldeserializer.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/include/cxxtools/xmlrpc/scanner.h, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlserializer.cpp, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/src/xmlrpc/scanner.cpp: add category to xmlserializer set type of serializationinfo in xmlrpc scanner reduce some more allocations git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1183 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-26 maekitalo * cxxtools/include/cxxtools/xml/doctypedeclaration.h, cxxtools/src/http/messageheader.cpp, cxxtools/src/tcpsocketimpl.h: formatting fix, fixed comment, explicit declarator added git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1182 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-21 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/http/messageheader.h, cxxtools/include/cxxtools/string.tpp, cxxtools/include/cxxtools/xml/characters.h, cxxtools/include/cxxtools/xml/comment.h, cxxtools/include/cxxtools/xml/doctypedeclaration.h, cxxtools/include/cxxtools/xml/enddocument.h, cxxtools/include/cxxtools/xml/endelement.h, cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/include/cxxtools/xml/namespace.h, cxxtools/include/cxxtools/xml/namespacecontext.h, cxxtools/include/cxxtools/xml/processinginstruction.h, cxxtools/include/cxxtools/xml/startelement.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/formatter.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/http/messageheader.cpp, cxxtools/src/http/socket.cpp, cxxtools/src/xml/Makefile.am, cxxtools/src/xml/characters.cpp, cxxtools/src/xml/comment.cpp, cxxtools/src/xml/doctypedeclaration.cpp, cxxtools/src/xml/enddocument.cpp, cxxtools/src/xml/endelement.cpp, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/namespace.cpp, cxxtools/src/xml/namespacecontext.cpp, cxxtools/src/xml/processinginstruction.cpp, cxxtools/src/xml/startelement.cpp, cxxtools/src/xmlrpc/Makefile.am, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/src/xmlrpc/remoteprocedure.cpp, cxxtools/src/xmlrpc/service.cpp, cxxtools/test/tcpsockettest.cpp: reduced library size by inlining trivial methods and other small optimizations git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1181 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-19 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/string.tpp, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/src/xml/xmlserializer.cpp, cxxtools/src/xml/xmlwriter.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/remoteprocedure.cpp: reduced allocations git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1180 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-18 maekitalo * cxxtools/include/cxxtools/xml/comment.h, cxxtools/include/cxxtools/xml/endelement.h, cxxtools/include/cxxtools/xml/startelement.h, cxxtools/src/xml/comment.cpp, cxxtools/src/xml/endelement.cpp, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/startelement.cpp: pass strings by const reference instead of const copies in xml reader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1179 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-18 maekitalo * cxxtools/src/xml/xmlreader.cpp: fix reading xml entities in xml attribute values git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1178 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-18 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/stringstream.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/xmlreader.cpp, cxxtools/src/xml/xmlwriter.cpp, cxxtools/test/xmlreader-test.cpp: reverse xml entity resolver better error reporting in failed unittests cxxtools::OStringStream and cxxtools::IStringStream as typedefs use reverse xml entity resolver in xml writer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1177 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-17 maekitalo * cxxtools/test/xmlreader-test.cpp: add xmlreader test frame git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1176 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-17 maekitalo * cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/src/xml/entityresolver.cpp, cxxtools/test/Makefile.am: remove need for static initialization and locking in xml entityresolver git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1175 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-16 maekitalo * cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/include/cxxtools/xml/startelement.h, cxxtools/include/cxxtools/xml/xmldeserializer.h, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/startelement.cpp, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlserializer.cpp: set xml attribute "type" in xmlserializer and read it in deserializer clearn up some code (breaking abi) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1174 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-16 maekitalo * cxxtools/include/Makefile.am: formatting fix in Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1173 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-16 maekitalo * cxxtools/include/cxxtools/arg.h: fix parsing options like --option=value git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1172 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-13 maekitalo * cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/xmlreader.cpp: use static entity map with delayed initialization in xmlreader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1171 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-13 maekitalo * cxxtools/src/tcpserverimpl.cpp: small optimization in tcpserver: don't use poll in accept, if we have only one listener git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1170 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-11 maekitalo * cxxtools/ChangeLog: update changelog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1169 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-10 maekitalo * cxxtools/include/cxxtools/net/uri.h, cxxtools/src/uri.cpp, cxxtools/src/xmlrpc/httpclient.cpp, cxxtools/test/uri-test.cpp: add query and fragment parts to uri class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1168 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-12-07 maekitalo * cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/time.cpp: accept dates, times and datetimes with discrete components in deserialization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1167 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-21 maekitalo * cxxtools/src/xml/entityresolver.cpp: improve initialization of entityresolver git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1166 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-21 maekitalo * cxxtools/src/http/clientimpl.cpp: set user agent header in http client if not set by user git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1165 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-20 maekitalo * cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/xmlreader.cpp, cxxtools/src/xml/xmlwriter.cpp: support for special characters in xml attributes as well as html entities add all html4 entities into default list of entities in entityresolver delay instantiation of entityresolver until really needed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1164 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-20 maekitalo * cxxtools/src/threadimpl.cpp, cxxtools/src/threadimpl.h: fix handling of detached threads git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1163 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-17 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: fix serialization of std::pair (type name was not set) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1162 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-13 maekitalo * cxxtools/include/cxxtools/threadpool.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/log.cpp, cxxtools/src/net.cpp, cxxtools/src/properties.cpp, cxxtools/src/query_params.cpp, cxxtools/src/uri.cpp: cleanup the code a little to reduce compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1161 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-08 maekitalo * cxxtools/include/cxxtools/net/uri.h, cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/uri.cpp, cxxtools/src/xmlrpc/httpclient.cpp: add default constructor to cxxtools::net::Uri add connect via cxxtools::net::Uri to xmlrpc-client class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1160 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-08 maekitalo * cxxtools/src/xmlrpc/httpclient.cpp: use username and password from uri class in xmlrpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1159 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-08 maekitalo * cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/xmlrpc/httpclient.cpp: add constructor for Uri into xmlrpc client class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1158 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-08 maekitalo * cxxtools/include/cxxtools/net/uri.h, cxxtools/src/uri.cpp: update license header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1157 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-08 maekitalo * cxxtools/include/Makefile.am, cxxtools/src/uri.cpp, cxxtools/test/uri-test.cpp: prepend slash always in url part of cxxtools::Uri install uri.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1156 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-07 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/net/uri.h, cxxtools/src/Makefile.am, cxxtools/src/http/client.cpp, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/uri.cpp, cxxtools/test/Makefile.am, cxxtools/test/uri-test.cpp: add class cxxtools::net::Uri for parsing uris git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1155 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-05 maekitalo * cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/xmlrpc/httpclient.cpp, cxxtools/src/xmlrpc/httpclientimpl.h: make selector settable in cxxtools::xmlrpc::HttpClient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1154 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-05 maekitalo * cxxtools/src/http/clientimpl.h: close socket in http client when new address is set git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1153 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-11-01 maekitalo * cxxtools/include/cxxtools/date.h, cxxtools/include/cxxtools/datetime.h, cxxtools/include/cxxtools/time.h, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/time.cpp: add serialization operators to Date, Time and DateTime git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1152 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-29 maekitalo * cxxtools/Makefile.am, cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: build fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1151 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-29 maekitalo * cxxtools/include/cxxtools/cache.h: new method clear in cxxtools::Cache to clear the cache (obviously - isn't it) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1150 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-25 maekitalo * cxxtools/include/cxxtools/trim.h, cxxtools/test/Makefile.am, cxxtools/test/trim-test.cpp: add include guards (and a unit test) to trim.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1149 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-17 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/md5.h, cxxtools/src/md5.c, cxxtools/src/md5stream.cpp: add cxxtools prefix to md5 code to prevent name clash with other md5 libraries git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1148 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-14 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: new member template function SerialzationInfo::getMember(name, value), which deserializes a member only if the value is found and do not throw, if the member is not found; a success flag is returned as bool git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1147 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-08 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: add serialization operator for string constant git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1146 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-08 maekitalo * cxxtools/include/Makefile.am: add cxxtools/trim.h to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1145 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-10-04 maekitalo * cxxtools/include/cxxtools/md5stream.h: add helper templates cxxtools::md5 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1144 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-27 maekitalo * cxxtools/src/xmlrpc/responder.cpp: add log_info message when calling xmlrpc method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1143 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-27 maekitalo * cxxtools/include/cxxtools/http/requestheader.h, cxxtools/src/http/server.cpp, cxxtools/src/http/socket.cpp: add log_info output to http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1142 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-12 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/splitter.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/join.h, cxxtools/include/cxxtools/regex.h, cxxtools/include/cxxtools/split.h, cxxtools/include/cxxtools/trim.h, cxxtools/src/Makefile.am: new utility functions split, join and trim git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1141 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-12 maekitalo * cxxtools/configure.in, cxxtools/src/tcpserverimpl.cpp: add configure check for IPv6 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1140 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-12 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix handling of IPv6 in server socket git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1139 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-10 maekitalo * cxxtools/src/signal.cpp: do not use make_pair since there are incomplete stl implementations, which do not have it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1138 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-09-10 maekitalo * cxxtools/include/cxxtools/cache.h: remove obsolete line git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1137 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-08-19 maekitalo * cxxtools/src/atomicity.gcc.arm.cpp: fix compile problem for atomicity for arm git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1136 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-08-19 maekitalo * cxxtools/src/atomicity.sun.cpp: fixes for atomicity on sun git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1135 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-08-16 maekitalo * cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/chunkedreader.h, cxxtools/src/http/clientimpl.cpp: fix reading of chunked encoded data in http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1134 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-08-01 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in: update version number to 2.0 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1132 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-07-09 maekitalo * cxxtools/include/cxxtools/application.h, cxxtools/include/cxxtools/conversionerror.h, cxxtools/include/cxxtools/convert.h, cxxtools/src/application.cpp, cxxtools/src/conversionerror.cpp, cxxtools/src/xmlrpc/Makefile.am: better error message in cxxtools::convert by using typeinfo::name() to print type name git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1131 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-07-04 maekitalo * cxxtools/src/tcpserverimpl.cpp: fallback to accept if accept4 is not supported by the kernel git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1130 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-07-04 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/string.h: std::revers_iterator in sunstudio needs 5 template parameters instead of 1 - add configure check for that and use it when needed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1129 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-23 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp: small optimization: to disconnect signals store connection and use close when needed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1128 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-23 maekitalo * cxxtools/include/cxxtools/signal.tpp: remove unnecessarey disconnect template functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1127 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-22 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix compile problem in AIX (and other platforms, which do not support defer acceppt) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1126 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-19 maekitalo * cxxtools/ChangeLog: update changelog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1125 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-16 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/xml/xmlserializer.h: flush content in finish method of xml- and jsonserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1124 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-16 maekitalo * cxxtools/src/settingsreader.cpp, cxxtools/src/settingsreader.h: fix reading of settings file (ini-files) with empty entry git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1123 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-07 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: fix race condition in http server when handling idle sockets git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1122 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-07 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: fix naming of parameter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1121 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-06 maekitalo * cxxtools/src/http/messageheader.cpp, cxxtools/src/http/parser.cpp: add missing headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1120 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-06 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix logging category git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1119 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-06 maekitalo * cxxtools/ChangeLog: update changelog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1118 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-06 maekitalo * cxxtools/src/eventloop.cpp: allow eventloop to run multiple times git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1117 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-06-06 maekitalo * cxxtools/include/cxxtools/arg.h: add ostream operator for cxxtools::Arg git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1116 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-28 maekitalo * cxxtools/src/http/clientimpl.cpp: do not try to read from socket after cancel git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1115 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-25 maekitalo * cxxtools/include/cxxtools/unit/assertion.h: add macro CXXTOOLS_UNIT_FAIL to unit test framework git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1114 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-24 maekitalo * cxxtools/src/xmlrpc/responder.cpp: fix crash in xmlrpc server when too many arguments are received git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1113 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-23 maekitalo * cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: add missing headers to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1112 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-21 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/test/Makefile.am, cxxtools/test/convert-test.cpp: allow white space after numbers in cxxtools::convert and better error checking git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1111 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-21 maekitalo * cxxtools/src/xml/xmlerror.cpp: improved error messages in xmlreader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1110 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-21 maekitalo * cxxtools/include/cxxtools/xml/xmlerror.h: improved error messages in xmlreader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1109 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-21 maekitalo * cxxtools/src/xml/xmlreader.cpp: improved error messages in xmlreader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1108 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-21 maekitalo * cxxtools/src/char.cpp: fix ctype::do_is for cxxtools::Char git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1107 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-20 maekitalo * cxxtools/include/cxxtools/unit/assertion.h: add macro CXXTOOLS_UNIT_ASSERT_NOTHROW git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1106 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-20 maekitalo * cxxtools/include/cxxtools/unit/assertion.h: fix minor typo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1105 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-16 maekitalo * cxxtools/demo/httprequest.cpp: set default port of http request demo to same port as http server demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1104 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-09 maekitalo * : updated xmlrpc documentation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1103 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-05-05 maekitalo * cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/utils/xmlrpcservice.pl: extend xmlrpc server to receiving up to 10 arguments git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1102 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-26 maekitalo * cxxtools/src/utf8codec.cpp: add error check in Utf8Codec::decode git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1101 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-26 maekitalo * cxxtools/include/cxxtools/queue.h: add some needed typename specifications git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1100 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-25 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/threadpool.cpp, cxxtools/include/cxxtools/queue.h, cxxtools/include/cxxtools/threadpool.h, cxxtools/src/Makefile.am, cxxtools/src/threadpool.cpp, cxxtools/src/threadpoolimpl.cpp, cxxtools/src/threadpoolimpl.h: add new class ThreadPool git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1099 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-25 maekitalo * cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/iodevice.cpp, cxxtools/src/streambuffer.cpp: return number of bytes written immediately in beginWrite git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1098 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-25 maekitalo * cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/queue.h, cxxtools/src/http/service.cpp, cxxtools/src/iodeviceimpl.cpp: remove compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1097 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-23 maekitalo * cxxtools/include/cxxtools/iodevice.h, cxxtools/src/iodeviceimpl.cpp: optimization: try to write in beginWrite to reduce unnecessary calls to poll git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1096 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-23 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: replace mutex with read-write-mutex for http services git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1095 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-21 maekitalo * cxxtools/include/cxxtools/http/responder.h, cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/http/service.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/service.cpp: when removing a service wait until no requests are running on that service git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1094 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-21 maekitalo * cxxtools/include/cxxtools/arg.h: fix some comments git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1093 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-21 maekitalo * cxxtools/include/cxxtools/ioerror.h: add api specifier to classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1092 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-15 maekitalo * cxxtools/src/tcpsocketimpl.cpp: fix handling of closed sockets git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1091 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-15 maekitalo * cxxtools/test/arg-test.cpp: add unit tests for parsing command line arguments with spaces git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1090 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-14 maekitalo * cxxtools/demo/arg-set.cpp, cxxtools/include/cxxtools/arg.h, cxxtools/test/arg-test.cpp: remove Argp template again and include the functionality into Arg template git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1089 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-14 maekitalo * cxxtools/include/cxxtools/http/messageheader.h: bugfix: initialize end offset in messageheader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1088 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-13 maekitalo * cxxtools/include/cxxtools/ioerror.h, cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/src/iodevice.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/ioerror.cpp, cxxtools/src/tcpsocketimpl.cpp: fix handling of POLLHUP git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1087 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-10 maekitalo * cxxtools/include/cxxtools/http/messageheader.h, cxxtools/src/http/messageheader.cpp: store offset to message end in message header for quicker find git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1086 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-10 maekitalo * cxxtools/src/tcpserverimpl.cpp: fix stupid bug introduced recently in checking poll event in tcpserver git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1085 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-09 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/http/messageheader.h, cxxtools/include/cxxtools/net/net.h, cxxtools/include/cxxtools/net/tcpserver.h, cxxtools/src/http/messageheader.cpp, cxxtools/src/net.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/src/udp.cpp, cxxtools/src/xmlrpc/httpclientimpl.cpp, cxxtools/src/xmlrpc/service.cpp: fix checking of http headers code cleanup in network classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1084 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-09 maekitalo * cxxtools/src/tcpsocketimpl.cpp: fix compile error in tcpsocketimpl git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1083 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-06 maekitalo * cxxtools/src/http/worker.cpp: bugfix: do not use deleted http socket any more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1082 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-06 maekitalo * cxxtools/include/cxxtools/http/messageheader.h, cxxtools/include/cxxtools/http/reply.h, cxxtools/include/cxxtools/http/request.h, cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/listener.h, cxxtools/src/http/messageheader.cpp, cxxtools/src/http/notauthenticatedresponder.cpp, cxxtools/src/http/parser.cpp, cxxtools/src/http/parser.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp: optimization: collect http header data in a fixed 4k buffer instead of std::map git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1081 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-06 maekitalo * cxxtools/include/cxxtools/net/tcpserver.h, cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/include/cxxtools/net/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/http/socket.cpp, cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpserverimpl.h, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/src/tcpstream.cpp: - rename READFIRST flag in accept to DEFER_ACCEPT - add INHERIT and DEFER_ACCEPT flags to TcpServer listen - listen on multiple filedecriptors in TcpServer when available - remove obsolete methods TcpStream::canRead(), TcpServer::getAddr() and TcpServer::getFd() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1080 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-05 maekitalo * cxxtools/src/directory.cpp: small improvement in DirectoryIterator assignment operator git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1079 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-05 maekitalo * cxxtools/demo/dir.cpp: use cxxtools/directory.h instead of compatibility header cxxtools/dir.h in directory demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1078 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-05 maekitalo * cxxtools/test/arg-test.cpp: add template class Argp for reading arguments with parameter and add unit tests for Arg* template classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1077 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-05 maekitalo * cxxtools/include/cxxtools/arg.h, cxxtools/test/Makefile.am: add template class Argp for reading arguments with parameter and add unit tests for Arg* template classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1076 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-04-04 maekitalo * cxxtools/src/fdstream.cpp: return correct type in fdstream::underflow git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1075 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-25 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: remove the threadStartDelay parameter again - it was not such a good idea git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1074 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-25 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: delay starting of new threads in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1073 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-24 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/include/cxxtools/net/tcpstream.h, cxxtools/src/http/socket.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: add support for TCP_DEFER_ACCEPT git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1072 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-24 maekitalo * cxxtools/src/iodeviceimpl.cpp: check for deleted iodevice in case of error before emiting outputReady signal git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1071 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-24 maekitalo * cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/socket.cpp: some cosmetic changes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1070 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-24 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp, cxxtools/src/http/worker.h: remove selector from http-worker and simplify handling of signal connections in httpserver git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1069 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-23 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: predefine slots for connections in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1068 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-23 maekitalo * cxxtools/src/http/worker.cpp: fix processing of idle sockets in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1067 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-23 maekitalo * cxxtools/configure.in, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/worker.cpp: bugfixes in http client and server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1066 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-22 maekitalo * cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/src/Makefile.am, cxxtools/src/http/Makefile.am, cxxtools/src/unit/Makefile.am, cxxtools/src/xml/Makefile.am, cxxtools/src/xmlrpc/Makefile.am, cxxtools/test/Makefile.am: support for out of tree builds git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1065 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-21 maekitalo * cxxtools/src/http/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h: some small fixes in http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1064 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-19 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/streambuffer.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/result.h, cxxtools/src/http/client.cpp, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/streambuffer.cpp, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/httpclientimpl.cpp, cxxtools/src/xmlrpc/httpclientimpl.h: replace errorOccured signal with throwing errors in endXXX-methods git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1063 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-17 maekitalo * vim/.vim/filetype.vim, vim/.vim/skeletons/skel.cpp, vim/.vim/skeletons/skel.h, vim/.vim/syntax/eruby.tm.vim, vim/.vim/syntax/eruby.vim: update year and remove vim settings for eruby git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1062 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-16 maekitalo * cxxtools/src/http/serverimpl.cpp: fix memory leak in http server on shutdown git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1061 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-16 d-marc * cxxtools/include/cxxtools/timer.h, cxxtools/src/timer.cpp: allow destruction of timer in callback for timeout signal git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1060 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-15 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp: remove this connectInput parameter from http::Socket::setSelector again and implement it better git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1059 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-15 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: do not delete timer in his timer callback but send a event instead git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1058 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-15 maekitalo * cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/chunkedreader.h: fix memory leak in chunked reader of http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1057 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-15 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/stopwatch.h: remove obsolete file and add atomicity header for avr32 to installation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1056 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-13 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp: bugfix in httpserver: do not process requests in main thread git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1055 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-12 maekitalo * cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp: bugfix: attach iodevice signal always git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1054 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-12 maekitalo * cxxtools/include/cxxtools/net/tcpstream.h: remove unused header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1053 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-11 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h: fix write timeout handling in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1052 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-09 maekitalo * cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp: fix possible race condition in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1051 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-07 maekitalo * cxxtools/src/settingsreader.h: allow empty values in settings file fix typo in class name of settings reader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1050 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-07 maekitalo * cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/xmlrpc/httpclient.cpp, cxxtools/src/xmlrpc/httpclientimpl.h: make url settable in http xmlrpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1049 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-07 maekitalo * cxxtools/src/xmlrpc/httpclientimpl.cpp, cxxtools/src/xmlrpc/httpclientimpl.h: verify http header also when using syncronous api of xmlrpc http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1048 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-07 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: terminate http server before deleting the impl git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1047 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-07 maekitalo * cxxtools/include/cxxtools/queue.h: use const reference to pass objects to the queue git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1046 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-05 maekitalo * cxxtools/configure.in: fix with-iconvstream configure flag git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1045 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-05 maekitalo * cxxtools/src/http/serverimpl.cpp: bugfix for http server: for each closed socket a additinal accept was initiated git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1044 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-04 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h: - fix some handling of exceptions in http server - delete socket on keep alive timeout git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1043 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-04 maekitalo * cxxtools/src/selectorimpl.cpp: fix compiler warnings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1042 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-04 maekitalo * cxxtools/src/tcpsocketimpl.cpp: add peer address to debug log when connection is established git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1041 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-04 maekitalo * cxxtools/src/tcpsocketimpl.cpp: add peer address to debug log when connection is established git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1040 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-04 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/worker.cpp: bugfix: delete worker threads after termination git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1039 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-04 maekitalo * cxxtools/src/http/clientimpl.cpp: fix error handling in http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1038 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-03 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: use EventLoopBase instead of EventLoop in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1037 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-02 maekitalo * cxxtools/include/cxxtools/event.h, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/worker.cpp: add new BasicEvent template for easier event definition and use it in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1036 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-03-02 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/serializationinfo.h: check for long long and unsigned long long types and add serialization operators for them git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1035 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-28 maekitalo * cxxtools/src/http/serverimpl.cpp: use allocator when cloning and destroying events git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1034 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-28 maekitalo * cxxtools/src/http/Makefile.am: add missing header files to Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1033 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-28 maekitalo * cxxtools/demo/getini.cpp, cxxtools/demo/logbench.cpp, cxxtools/include/cxxtools/http/responder.h, cxxtools/include/cxxtools/http/service.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/notauthenticatedresponder.cpp, cxxtools/src/http/notauthenticatedresponder.h, cxxtools/src/http/notauthenticatedservice.cpp, cxxtools/src/http/notauthenticatedservice.h, cxxtools/src/http/notfoundresponder.cpp, cxxtools/src/http/notfoundresponder.h, cxxtools/src/http/notfoundservice.cpp, cxxtools/src/http/notfoundservice.h, cxxtools/src/http/responder.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/test/process-test.cpp: code cleanup git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1032 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-28 maekitalo * cxxtools/include/cxxtools/condition.h: fix comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1031 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-28 maekitalo * cxxtools/include/cxxtools/queue.h: - add thread safety to all queue methods - add comments git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1030 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-28 maekitalo * cxxtools/include/cxxtools/queue.h: update license header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1029 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/worker.cpp: request new threads by event in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1028 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/demo/rpcecho.cpp, cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/test/Makefile.am, cxxtools/test/xmlrpc-test.cpp: use slot in httpserver for faster connecting and disconnecting events let the httpserver automatically start and stop with the event loop git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1027 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/include/cxxtools/eventloop.h, cxxtools/src/eventloop.cpp: add exited signal to event loop git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1026 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/src/iodeviceimpl.cpp: fix formatting of debug output git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1025 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/demo/httpserver.cpp, cxxtools/demo/rpcecho.cpp, cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/listener.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/http/worker.cpp, cxxtools/src/http/{listener.cpp => worker.h}, cxxtools/test/xmlrpc-test.cpp: run http server in event loop git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1024 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/httpserver.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/demo/rpcecho.cpp, cxxtools/include/cxxtools/net/addrinfo.h, cxxtools/src/addrinfo.cpp, cxxtools/src/addrinfoimpl.cpp, cxxtools/src/tcpserverimpl.cpp: add support for listen on any socket and connect to any local by passing an empty ip address git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1023 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/queue.h: add template class for (thread-)queue git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1022 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/include/cxxtools/signal.h: add missing disconnect functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1021 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/include/cxxtools/iodevice.h: fix comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1020 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/include/cxxtools/selector.h: fix comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1019 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-27 maekitalo * cxxtools/include/cxxtools/eventloop.h: fix typo in comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1018 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-14 maekitalo * cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/streambuffer.cpp: fix bug in error handling of http client (and cxxtools::StreamBuffer) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1017 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-12 maekitalo * cxxtools/src/iodevice.cpp, cxxtools/src/selectable.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/src/xmlrpc/clientimpl.cpp: fix crash when deleing iodevices after closing and visiting the selector git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1016 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-07 maekitalo * cxxtools/src/tcpsocketimpl.cpp: accept gets a inherit flag instead of closeOnExec; forgot to fix that in tcpsocketimpl.cpp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1015 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-06 maekitalo * cxxtools/src/http/clientimpl.cpp: do not enable exceptions in input stream of httpclient but handle failed requests otherwise git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1014 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-06 maekitalo * cxxtools/src/http/client.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/xmlrpc/scanner.cpp: remove some logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1013 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-06 maekitalo * cxxtools/src/xmlrpc/clientimpl.cpp: fix bug where syncronous xmlrpc request prevented keep alive in xmlrpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1012 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-06 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/http/clientimpl.h, cxxtools/src/xmlrpc/httpclient.cpp, cxxtools/src/xmlrpc/httpclientimpl.h: add method "void connect(const net::AddrInfo& addrinfo, const std::string& url)" to xmlrpc::HttpClient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1011 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-06 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/cache.h: add new class cxxtools::Cache git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1010 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-05 maekitalo * cxxtools/configure.in: fix spelling in comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1009 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-05 maekitalo * cxxtools/src/applicationimpl.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h: fix possible deadlock in signal handling of application class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1008 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-05 maekitalo * cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: add mutex to service list in httpserver, so that other threads may add or remove services while the server is running git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1007 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-04 maekitalo * cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/utils/remoteprocedure.pl, cxxtools/{ => utils}/setLicense.pl: extend number of parameters in xmlrpc clienth from 5 to 10 using a perl script (which is also checked in here) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1006 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-03 maekitalo * cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/src/iodevice.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/pipeimpl.cpp, cxxtools/src/pipeimpl.h, cxxtools/src/selectorimpl.cpp, cxxtools/src/tcpsocket.cpp: add cancel method to IODevice git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1005 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-03 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/src/http/client.cpp, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/httpclientimpl.cpp, cxxtools/src/xmlrpc/httpclientimpl.h: - add cancel method to http and xmlrpc client - fix some error handling in tcpsocket - handle addrinfo list of tcpsocket in TcpSocketImpl::checkPollEvent instad of endConnect to prevent blocking git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1004 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-01 maekitalo * cxxtools/src/http/clientimpl.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/tcpsocket.cpp: slightly improve error handling in iodevice and httpclient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1003 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-01 maekitalo * cxxtools/include/cxxtools/eventloop.h, cxxtools/include/cxxtools/timer.h: fix documentation and remove unneeded forward reference git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1002 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-02-01 maekitalo * cxxtools/demo/netio.cpp: do not use the not-yet-standard method std::vector::data() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1001 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-31 maekitalo * cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/streambuffer.cpp: delay exception in endWrite until user had a chance to handle it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1000 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-31 maekitalo * cxxtools/src/http/clientimpl.cpp: throw exception when reading body fails in http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@999 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-31 maekitalo * cxxtools/src/iodevice.cpp: end reading and writing mode even on error git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@998 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-30 maekitalo * cxxtools/include/cxxtools/directory.h, cxxtools/src/directory.cpp: add arrow operator to directory iterator git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@997 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-29 maekitalo * cxxtools/src/http/clientimpl.cpp: fix error handling in reconnect when using asynchrounus interface git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@996 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-25 maekitalo * cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/streambuffer.cpp: - reconnect http client on error even when beginWrite was successful - reorder http-clientimpl members git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@995 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/include/cxxtools/net/tcpstream.h, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.h: swap meaning of flag to accept from close-on-exec to inherit git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@994 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/src/addrinfo.cpp: add debug output to addrinfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@993 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/configure.in: fix finding of source directory in configure.in git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@992 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/ChangeLog: add release date of version 1.4.8 to ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@991 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/src/mime.cpp: use Base64ostream::terminate() instead of compatibility method end() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@990 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/src/http/clientimpl.cpp: always close socket when keep alive is not enabled in the current request in httpclient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@989 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-24 maekitalo * cxxtools/include/cxxtools/log.h: include log_init macro in cxxtools/log.h header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@988 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-21 maekitalo * cxxtools/include/cxxtools/base64stream.h, cxxtools/src/Makefile.am, cxxtools/src/base64stream.cpp: reimplement base64stream using the generinc textstream with base64codec git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@987 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-20 maekitalo * cxxtools/include/cxxtools/base64codec.h, cxxtools/test/Makefile.am, cxxtools/test/base64-test.cpp: fix bug in base64codec git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@986 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-14 maekitalo * cxxtools/include/cxxtools/regex.h, cxxtools/src/regex.cpp: handle not found entries in regular expressions correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@985 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-11 maekitalo * cxxtools/src/selector.cpp, cxxtools/src/selectorimpl.cpp, cxxtools/src/selectorimpl.h: use correct type std::size_t for timeout parameter of SelectorImpl::wait git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@984 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-10 maekitalo * cxxtools/include/cxxtools/convert.h: simplify conversion from std::string to bool git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@983 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-03 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/demo/rpcecho.cpp, cxxtools/include/cxxtools/http/api.h, cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/include/cxxtools/unit/registertest.h, cxxtools/include/cxxtools/unit/reporter.h, cxxtools/include/cxxtools/unit/test.h, cxxtools/include/cxxtools/unit/testcase.h, cxxtools/include/cxxtools/unit/testcontext.h, cxxtools/include/cxxtools/unit/testfixture.h, cxxtools/include/cxxtools/unit/testmethod.h, cxxtools/include/cxxtools/unit/testprotocol.h, cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/applicationimpl.h, cxxtools/src/http/listener.cpp, cxxtools/src/http/listener.h, cxxtools/src/iodeviceimpl.h, cxxtools/src/processimpl.h, cxxtools/src/selectableimpl.h, cxxtools/src/selectorimpl.cpp, cxxtools/src/selectorimpl.h, cxxtools/src/semaphoreimpl.h, cxxtools/src/settingsreader.h, cxxtools/src/settingswriter.h, cxxtools/src/unicode.h, cxxtools/src/unit/application.cpp, cxxtools/src/unit/assertion.cpp, cxxtools/src/unit/reporter.cpp, cxxtools/src/unit/test.cpp, cxxtools/src/unit/testcase.cpp, cxxtools/src/unit/testcontext.cpp, cxxtools/src/unit/testprotocol.cpp, cxxtools/src/unit/testsuite.cpp, cxxtools/test/abort.cpp, cxxtools/test/process-test.cpp, cxxtools/test/test-main.cpp: update copyright header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@982 15ae5fad-cc11-0410-8fac-bce609e504b0 2010-01-03 maekitalo * cxxtools/ChangeLog: update ChangeLog git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@981 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-28 maekitalo * cxxtools/src/http/clientimpl.cpp: bugfix: request after a unsuccessful request failed in http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@980 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/src/udp.cpp: remove cxxtools::Dynbuffer (use std::vector instead) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@979 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-27 maekitalo * cxxtools/m4/asmtype.m4: add atomicity test for mips git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@978 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-22 maekitalo * cxxtools/demo/pipestream.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/posix/pipe.h, cxxtools/include/cxxtools/{ => posix}/pipestream.h, cxxtools/src/Makefile.am, cxxtools/src/log.cpp, cxxtools/src/{ => posix}/pipestream.cpp, cxxtools/src/posix/posixpipe.cpp, cxxtools/src/processimpl.cpp, cxxtools/src/processimpl.h: split pipe class into generic and posix specific functionality git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@977 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-22 maekitalo * cxxtools/configure.in: version number 1.99.5 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@976 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-21 maekitalo * cxxtools/src/iodeviceimpl.cpp: fix formatting git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@975 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-21 d-marc * cxxtools/demo/pipestream.cpp, cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/src/pipe.cpp, cxxtools/src/pipeimpl.cpp, cxxtools/src/pipeimpl.h, cxxtools/src/pipestream.cpp, cxxtools/src/processimpl.cpp: fixed IODevice usage in Process and Pipe class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@974 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-20 maekitalo * cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/include/cxxtools/net/tcpstream.h: remove old compatibility typedefs cxxtools::net::Server and cxxtools::net::Stream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@973 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-17 maekitalo * cxxtools/include/cxxtools/utf8codec.h, cxxtools/src/utf8codec.cpp: new static methods Utf8Codec::encode and Utf8Codec::decode git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@972 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-15 maekitalo * : new document introduction into xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@971 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-10 maekitalo * cxxtools/include/cxxtools/clock.h, cxxtools/include/cxxtools/textstream.h: fix some typos and add explicit keyword where missing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@970 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-08 d-marc * cxxtools/src/iodeviceimpl.cpp: fixed wait timeout git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@969 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-07 maekitalo * cxxtools/src/http/responder.cpp, cxxtools/src/tcpserver.cpp: remove unused log_defines git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@968 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-07 maekitalo * cxxtools/include/cxxtools/process.h, cxxtools/src/processimpl.cpp: fix redirection in process class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@967 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-07 maekitalo * cxxtools/src/processimpl.cpp: fix redirection of stdoutput in process class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@966 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-06 maekitalo * cxxtools/src/xmlrpc/scanner.cpp: rename helper function, which throws an error git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@965 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-06 maekitalo * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/test/Makefile.am: make building of demos and unittests optional by configure flags --disable-demos and --disable-unittest git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@964 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-03 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h: implement runmodeChanged signal in http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@963 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-03 maekitalo * cxxtools/demo/rpcecho.cpp: remove warning git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@962 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-03 maekitalo * cxxtools/test/abort.cpp: add missing file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@961 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-03 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.h: make minimum and maximum number of working threads configurable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@960 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-03 maekitalo * cxxtools/configure.in, cxxtools/test/Makefile.am, cxxtools/test/process-test.cpp: pass unit test directory as absolute path to process-test so that the abort program will be found git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@959 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-12-02 maekitalo * cxxtools/include/cxxtools/process.h, cxxtools/src/processimpl.cpp, cxxtools/test/Makefile.am, cxxtools/test/process-test.cpp: throw exception when process fails in Process::wait() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@958 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-26 maekitalo * cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/include/cxxtools/xmlrpc/result.h: fix some missing includes and forward declarations git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@957 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-24 maekitalo * cxxtools/configure.in: add check for csignal header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@956 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-24 maekitalo * cxxtools/src/tcpsocketimpl.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@955 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-24 maekitalo * cxxtools/include/cxxtools/xml/httpclient.h: remove useless file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@954 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-19 maekitalo * cxxtools/src/xmlrpc/httpclientimpl.cpp: check for correct http return code and content type in xmlrpc http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@953 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-16 maekitalo * cxxtools/configure.in: fix autoconf check for accept4 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@952 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-16 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/include/cxxtools/net/tcpstream.h, cxxtools/src/http/socket.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/pipeimpl.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: support for FD_CLOEXEC flag on sockets and support for accept4 (conditional by configure check) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@951 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-16 maekitalo * cxxtools/include/cxxtools/http/messageheader.h, cxxtools/src/http/messageheader.cpp: make StringLessIgnoreCase::compare static as it is ought to be git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@950 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-15 maekitalo * cxxtools/include/cxxtools/pipe.h, cxxtools/src/pipe.cpp, cxxtools/src/pipeimpl.cpp, cxxtools/src/pipeimpl.h: formatting updates git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@949 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-15 maekitalo * cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/process.h, cxxtools/src/pipeimpl.cpp, cxxtools/src/process.cpp, cxxtools/src/processimpl.cpp, cxxtools/src/processimpl.h, cxxtools/test/Makefile.am, cxxtools/test/process-test.cpp, cxxtools/test/test-main.cpp, cxxtools/test/xmlrpc-test.cpp: improve Process class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@948 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-09 maekitalo * cxxtools/src/error.h, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/systemerror.cpp: add system error message to exception text git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@947 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-09 maekitalo * cxxtools/include/cxxtools/pipe.h: bugfix: read and write sides of pipe were switched git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@946 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-07 maekitalo * cxxtools/include/cxxtools/pipe.h: add read and write method to pipe for compatibility and simplification git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@945 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-07 maekitalo * cxxtools/src/tcpserverimpl.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@944 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-07 maekitalo * cxxtools/demo/arg-set.cpp, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp: remove using directive from demos git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@943 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-03 maekitalo * cxxtools/demo/pipestream.cpp, cxxtools/include/cxxtools/pipe.h, cxxtools/src/applicationimpl.cpp, cxxtools/src/pipe.cpp, cxxtools/src/pipeimpl.cpp, cxxtools/src/pipeimpl.h: merge cxxtools::ext::Pipe and cxxtools::Pipe into cxxtools::Pipe git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@942 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-02 maekitalo * cxxtools/src/processimpl.cpp, cxxtools/src/processimpl.h: remove obsolete dtor git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@941 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-02 maekitalo * cxxtools/include/cxxtools/iostream.h: fix typo: OStream is a BasicOStream, not a BasicIStream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@940 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-11-02 maekitalo * cxxtools/include/cxxtools/process.h: return *this in ProcessInfo::addArg for command chaining git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@939 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-31 maekitalo * cxxtools/include/Makefile.am: remove duplicate target file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@938 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-30 maekitalo * cxxtools/include/cxxtools/refcounted.h: make SimpleRefCounted the default in RefCounted again git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@937 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-19 maekitalo * cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/src/tcpserverimpl.cpp: code cleanup git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@936 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-16 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/net/addrinfo.h, cxxtools/include/cxxtools/net/tcpsocket.h, cxxtools/include/cxxtools/net/tcpstream.h, cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/thread.h, cxxtools/src/Makefile.am, cxxtools/src/addrinfo.cpp, cxxtools/src/addrinfoimpl.cpp, cxxtools/src/{addrinfo.h => addrinfoimpl.h}, cxxtools/src/http/Makefile.am, cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/chunkedreader.h, cxxtools/src/http/client.cpp, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/http/listener.cpp, cxxtools/src/http/listener.h, cxxtools/src/http/server.cpp, cxxtools/src/http/serverimpl.cpp, cxxtools/src/http/serverimpl.h, cxxtools/src/http/socket.cpp, cxxtools/src/http/socket.h, cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpserverimpl.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/src/udp.cpp, cxxtools/src/xmlrpc/httpclientimpl.cpp: - new class cxxtools::net::AddrInfo, which encapsulates ip and port - let cxxtools::RefCounted use atomic_t - support for multiple listeners to httpserver - update some copyright headers - impl http server - fix in httpserver: process read multiple requests received in a single read git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@935 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-16 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/http/parser.cpp, cxxtools/{include/cxxtools => src}/http/parser.h, cxxtools/src/http/server.cpp, cxxtools/src/http/socket.cpp, cxxtools/{include/cxxtools => src}/http/socket.h, cxxtools/src/xmlrpc/formatter.cpp: impl http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@934 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-09 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: code cleanup git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@933 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-09 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/src/jsonserializer.cpp: simplify api of json serializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@932 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-10-04 maekitalo * cxxtools/src/tcpsocketimpl.cpp: update some comments git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@931 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-26 maekitalo * cxxtools/src/tcpsocketimpl.cpp: bugfix: the pollfd of iodevice needs to be reinitialized when the next addrinfo is tried since the previous socket is closed and a new created git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@930 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-25 maekitalo * cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: fix handling of address info list in connect git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@929 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-23 maekitalo * cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/tcpsocketimpl.cpp: fix some connectivity bugs from last check in git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@928 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-21 maekitalo * cxxtools/src/addrinfo.cpp, cxxtools/src/addrinfo.h, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/src/udp.cpp: fix incorrect iteration over addressinfos in tcpsocket git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@927 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-21 maekitalo * cxxtools/src/http/clientimpl.cpp: minor optimization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@926 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-21 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/demo/httpserver.cpp, cxxtools/include/cxxtools/http/request.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/request.cpp, cxxtools/src/tcpsocketimpl.cpp: - add authentication support in httprequest - use textstream and base64codec for http authentication (client and server) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@925 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-21 maekitalo * cxxtools/src/xmlrpc/httpclientimpl.cpp: set http method to POST git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@924 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-16 maekitalo * cxxtools/include/cxxtools/xmlrpc/scanner.h, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/src/xmlrpc/scanner.cpp: use string as default value in xmlrpc values git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@923 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-16 maekitalo * cxxtools/src/jsonserializer.cpp: do not escape needlessly the slash character git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@922 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-08 maekitalo * cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/chunkedreader.h: fix return type git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@921 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-08 maekitalo * cxxtools/include/Makefile.am: add header to dist package git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@920 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-07 maekitalo * cxxtools/include/cxxtools/http/service.h: fix typo in method name and add implementation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@919 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-07 maekitalo * cxxtools/src/xmlrpc/httpclientimpl.h: add missing file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@918 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-09-06 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/demo/rpcecho.cpp, cxxtools/include/cxxtools/xml/httpclient.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/httpclient.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/xmlrpc/Makefile.am, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h, cxxtools/src/xmlrpc/httpclient.cpp, cxxtools/src/xmlrpc/httpclientimpl.cpp, cxxtools/test/xmlrpc-test.cpp: extract http code from xmlrpc client into a separate class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@917 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-28 maekitalo * cxxtools/include/cxxtools/jsonserializer.h, cxxtools/src/jsonserializer.cpp: do not indent json by default but make it optional git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@916 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-28 maekitalo * cxxtools/src/http/clientimpl.cpp: process body in http client as long as data is available before returning from callback git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@915 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-28 maekitalo * cxxtools/include/cxxtools/jsonserializer.h: bugfix: don't call JsonFormatter::begin twice git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@914 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-27 maekitalo * cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/chunkedreader.h: code cleanup git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@913 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-25 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/clientimpl.cpp: fix chunked encoding in http client remove obsolete log messages improve http client demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@912 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-24 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/http/messageheader.h, cxxtools/include/cxxtools/http/parser.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/chunkedreader.cpp, cxxtools/src/http/chunkedreader.h, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/http/messageheader.cpp, cxxtools/src/http/server.cpp, cxxtools/src/iodeviceimpl.cpp: support for chunked encoding transfer in http-client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@911 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-24 maekitalo * cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/iodevice.cpp, cxxtools/src/streambuffer.cpp: - fix blocking read and write while in async mode - remove reading flag from streambuffer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@910 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-19 maekitalo * cxxtools/src/xmlrpc/clientimpl.cpp: reset xmlparser before executing a new request git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@909 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-19 maekitalo * cxxtools/src/xml/xmlreader.cpp: remove unused variable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@908 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-18 maekitalo * cxxtools/src/http/clientimpl.h: revert accidetally checked in file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@907 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-18 maekitalo * cxxtools/include/cxxtools/http/responder.h, cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/http/service.h, cxxtools/src/http/clientimpl.h, cxxtools/src/http/responder.cpp, cxxtools/src/http/server.cpp: add support for authentication to http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@906 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-13 maekitalo * cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/src/xmlrpc/Makefile.am, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/clientimpl.cpp, cxxtools/src/xmlrpc/clientimpl.h: impl xmlrpc::Client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@905 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-13 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/src/http/client.cpp: fix: delete implementation in dtor of http::Client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@904 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-13 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/src/http/Makefile.am, cxxtools/src/http/client.cpp, cxxtools/src/http/clientimpl.cpp, cxxtools/src/http/clientimpl.h, cxxtools/src/xmlrpc/client.cpp: impl http-client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@903 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-08-02 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/src/http/client.cpp: add http authorization to http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@902 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-28 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: deactivate logging when mutex is destroyed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@901 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-26 maekitalo * cxxtools/m4/asmtype.m4: fix autoconf check for arm git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@900 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-06 d-marc * cxxtools/src/xml/xmlserializer.cpp: use typename if name is not set git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@899 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-06 d-marc * cxxtools/src/xml/xmlserializer.cpp: use typename if name is not set git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@898 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-05 maekitalo * cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: compile iconvstream only if explicitely configured git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@897 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-05 maekitalo * cxxtools/src/clockimpl.cpp: fix compile problems with openBSD git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@896 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-03 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/jsonserializer.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/include/cxxtools/xmlrpc/formatter.h, cxxtools/src/Makefile.am, cxxtools/src/jsonserializer.cpp, cxxtools/src/serializer.cpp, cxxtools/src/xml/xmlserializer.cpp, cxxtools/src/xmlrpc/formatter.cpp: - implement json serializer - extend formatter to pass always type name to derived classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@895 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-03 maekitalo * cxxtools/src/streambuffer.cpp: fix check for full stream buffer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@894 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-03 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/settings.h, cxxtools/include/cxxtools/xml/xmldeserializer.h, cxxtools/include/cxxtools/xml/xmlserializer.h, cxxtools/src/Makefile.am, cxxtools/src/settings.cpp, cxxtools/src/settingsreader.cpp, cxxtools/src/settingsreader.h, cxxtools/src/settingswriter.cpp, cxxtools/src/settingswriter.h, cxxtools/src/xml/Makefile.am, cxxtools/src/xml/xmldeserializer.cpp, cxxtools/src/xml/xmlserializer.cpp: added settings and xml serialization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@893 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-07-01 d-marc * cxxtools/src/xml/xmlreader.cpp: clear Characters after start tags with attributes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@892 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-23 maekitalo * cxxtools/src/fileimpl.cpp, cxxtools/src/http/messageheader.cpp: add missing headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@891 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-21 maekitalo * cxxtools/include/cxxtools/serializationinfo.h, cxxtools/test/xmlrpc-test.cpp: add serialization for all std container templates git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@890 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-19 maekitalo * cxxtools/src/http/server.cpp: increase default max threads setting in http server from 10 to 100 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@889 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-18 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/src/http/server.cpp, cxxtools/src/tcpserverimpl.cpp: bugfix: connection refused exception lead to a hanging http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@888 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-16 maekitalo * cxxtools/include/cxxtools/string.tpp, cxxtools/include/cxxtools/stringdata.h, cxxtools/include/cxxtools/stringdata.tpp, cxxtools/include/cxxtools/textbuffer.h, cxxtools/test/xmlrpc-test.cpp: fix formatting git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@887 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-15 maekitalo * cxxtools/src/xml/xmlwriter.cpp: add quot and apos html encodings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@886 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-15 maekitalo * cxxtools/test/xmlrpc-test.cpp: extend string test for high latin1 characters and html entity characters git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@885 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-15 maekitalo * cxxtools/include/cxxtools/textbuffer.h: return correct amount of consumed characters in textbuffer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@884 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-15 maekitalo * cxxtools/include/cxxtools/stringdata.tpp: do not reallocate if enough capacity is available git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@883 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-12 maekitalo * cxxtools/demo/rpcecho.cpp: extend rpcecho demo to help benchmarking git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@881 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-12 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/rpcecho.cpp: add new rpcclient and server demo rpcecho git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@880 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-11 maekitalo * cxxtools/src/xml/xmlwriter.cpp: write xml declaration by default git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@879 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-10 maekitalo * cxxtools/include/cxxtools/string.tpp, cxxtools/include/cxxtools/stringdata.h, cxxtools/include/cxxtools/stringdata.tpp, cxxtools/src/xml/xmlreader.cpp: string and xmlreader optimizations git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@878 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-09 maekitalo * cxxtools/src/streambuffer.cpp: fix streambuffer extend git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@877 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-08 maekitalo * cxxtools/include/cxxtools/textbuffer.h, cxxtools/src/fdstream.cpp, cxxtools/src/pipestream.cpp, cxxtools/src/streambuffer.cpp: fix buffer handling bug git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@876 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-05 maekitalo * cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/fault.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/result.h, cxxtools/src/xmlrpc/client.cpp, cxxtools/test/xmlrpc-test.cpp: handle xmlrpc faults with rc=0 correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@875 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-05 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/xmlrpc/client.h: add getters for server, port and url git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@874 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-02 maekitalo * cxxtools/include/cxxtools/unit/assertion.h, cxxtools/src/unit/assertion.cpp: do not derive cxxtools::Assertion from std::exception to reduce influence to program flow git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@873 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-02 maekitalo * cxxtools/include/cxxtools/ioerror.h, cxxtools/src/Makefile.am, cxxtools/src/error.cpp, cxxtools/src/error.h, cxxtools/src/http/client.cpp, cxxtools/src/systemerror.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/test/xmlrpc-test.cpp: propagte connect error in http client through errorOccured signal git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@872 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-02 maekitalo * cxxtools/src/xmlrpc/client.cpp: add TODO about better error handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@871 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-06-02 maekitalo * cxxtools/src/xmlrpc/client.cpp, cxxtools/test/xmlrpc-test.cpp: do not call onFinished twice on error git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@870 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-31 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: serialization for std::deque git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@869 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-28 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/fault.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/result.h, cxxtools/src/xmlrpc/client.cpp, cxxtools/test/xmlrpc-test.cpp: improved exception handling in xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@868 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-27 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: serializer for std::list and std::set git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@867 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-25 maekitalo * cxxtools/include/cxxtools/serializationinfo.h: clear vector prior deserialization git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@866 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-21 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/src/http/client.cpp, cxxtools/src/xmlrpc/client.cpp: add empty constructors and connect-methods to http and xmlrpc clients git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@865 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-19 maekitalo * cxxtools/include/cxxtools/deserializer.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/include/cxxtools/serializer.h, cxxtools/src/serializationinfo.cpp: clear serializer and deserializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@864 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-19 maekitalo * cxxtools/src/xmlrpc/client.cpp: fix xml format git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@863 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-19 maekitalo * cxxtools/include/cxxtools/stringdata.h, cxxtools/include/cxxtools/stringdata.tpp: remove dependency of binary interface from NDEBUG git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@862 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-19 maekitalo * cxxtools/include/cxxtools/xml/xmlwriter.h, cxxtools/src/xml/xmlwriter.cpp, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/responder.cpp: add flag UseXmlDeclaration in xmlwriter to make xml declaration optional git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@861 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-18 maekitalo * cxxtools/include/cxxtools/xmlrpc/responder.h: fix license text git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@860 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 maekitalo * cxxtools/src/fileimpl.cpp: put local functions into anonymous namespace git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@859 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 maekitalo * cxxtools/src/processimpl.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@858 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 maekitalo * cxxtools/src/fileimpl.cpp: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@857 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 d-marc * cxxtools/src/fileimpl.cpp: fail if file cannot be created git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@856 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 d-marc * cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/xml/xmlreader.h, cxxtools/src/http/server.cpp: reverted test code git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@855 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 d-marc * cxxtools/src/fileimpl.cpp: fail if file cannot be created git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@854 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 d-marc * cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/xml/xmlreader.h, cxxtools/src/fileimpl.cpp, cxxtools/src/http/server.cpp: fail if file cannot be created git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@853 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-11 maekitalo * cxxtools/src/http/socket.cpp: do not debug-output this pointer - it is mostly useless git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@852 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-08 maekitalo * cxxtools/src/xml/xmlwriter.cpp: fix formatting of xml documents git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@851 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-08 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/src/http/client.cpp: fix non blocking http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@850 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-07 maekitalo * cxxtools/src/processimpl.cpp: use waitpid for kill git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@849 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-07 maekitalo * cxxtools/include/cxxtools/http/server.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/src/http/server.cpp, cxxtools/src/xmlrpc/client.cpp, cxxtools/test/xmlrpc-test.cpp: terminate httpserver in dtor improve error handling in xmlrpc client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@848 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-07 maekitalo * cxxtools/src/xmlrpc/responder.cpp: fix error handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@847 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-07 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h: prevent deadlock in iostream of xlC git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@846 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-05-07 maekitalo * cxxtools/include/cxxtools/api.h: prevent deadlock in iostream of xlC git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@845 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-27 maekitalo * cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/src/http/client.cpp, cxxtools/src/xmlrpc/client.cpp: timeout for blocking api in xmlrpc-client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@844 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-27 maekitalo * cxxtools/include/cxxtools/http/socket.h, cxxtools/src/http/responder.cpp, cxxtools/src/http/socket.cpp, cxxtools/src/xmlrpc/responder.cpp: improve error handling of xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@843 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-24 maekitalo * cxxtools/src/tcpsocketimpl.cpp: fix typo in log_debug-output git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@842 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-24 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/xml/xmlwriter.h, cxxtools/src/xml/xmlwriter.cpp, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/responder.cpp: remove whitespace from xmlrpc-documents git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@841 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-24 maekitalo * cxxtools/src/tcpsocketimpl.cpp: fix asyncronous connect git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@840 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-23 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/src/atomicity.sun.cpp, cxxtools/src/fileimpl.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/processimpl.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpstream.cpp: missing headers and other fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@839 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-23 maekitalo * cxxtools/src/http/client.cpp: sync argument ordering with xmlrpc-client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@838 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-23 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/src/xmlrpc/client.cpp: sync argument ordering with xmlrpc-client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@837 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-23 d-marc * cxxtools/src/xmlrpc/scanner.cpp, cxxtools/test/xmlrpc-test.cpp: allow empty arrays git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@836 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-23 maekitalo * cxxtools/src/tcpsocketimpl.cpp: fix typo on debug output git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@835 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-21 d-marc * cxxtools/include/cxxtools/string.tpp: fixed string assignment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@834 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-20 maekitalo * cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/service.h: fixed xmlrpc service with up to 5 parameters git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@833 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-20 d-marc * cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/service.h: allow up to 5 arguments in remote calls git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@832 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-17 maekitalo * cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/xml/xmlreader.cpp, cxxtools/src/xmlrpc/responder.cpp, cxxtools/src/xmlrpc/service.cpp: - use one ServiceProcedure instance per xmlrpc-Responder - another bugfix in xmlparser which failed on special characters at first position on character data git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@831 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-17 maekitalo * cxxtools/configure.in, cxxtools/src/xml/xmlreader.cpp, cxxtools/test/xmlrpc-test.cpp: allow special characters in xml data git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@830 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-11 maekitalo * cxxtools/src/threadimpl.cpp: do not propagate exception from thread entry function git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@829 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-10 maekitalo * cxxtools/include/cxxtools/md5stream.h, cxxtools/src/md5stream.cpp: initialize md5sum correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@828 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-10 maekitalo * cxxtools/src/iodeviceimpl.cpp, cxxtools/src/streambuffer.cpp: fix important bug when write was only partially successful in streambuffer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@827 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-09 d-marc * cxxtools/include/cxxtools/serializationinfo.h: remove operator >>= and <<= git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@826 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-09 d-marc * cxxtools/include/cxxtools/serializationinfo.h: operator <<= >= nt in cxxtools namespace git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@825 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-09 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/src/http/client.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/streambuffer.cpp: - fix non blocking keep alive in http client - add timeout to blocking http client - add some log statements git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@824 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-09 d-marc * cxxtools/src/xmlrpc/scanner.cpp, cxxtools/test/xmlrpc-test.cpp: allow empty values git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@823 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-08 d-marc * cxxtools/include/cxxtools/serializationinfo.h: moved methods in header file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@822 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-08 d-marc * cxxtools/src/xmlrpc/client.cpp: throw Fault exception git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@821 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-08 d-marc * cxxtools/include/cxxtools/textstream.h: cleaned up docs for textstreams git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@820 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-08 d-marc * cxxtools/include/cxxtools/textbuffer.h, cxxtools/include/cxxtools/textstream.h, cxxtools/src/Makefile.am, cxxtools/src/textbuffer.cpp, cxxtools/src/textstream.cpp: clean up of textstream and textbuffer source files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@819 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-08 d-marc * cxxtools/src/pipeimpl.cpp: unset eof flag when iodevices are opened git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@818 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-07 maekitalo * cxxtools/include/cxxtools/http/client.h, cxxtools/include/cxxtools/http/parser.h, cxxtools/include/cxxtools/streambuffer.h, cxxtools/include/cxxtools/xml/xmlreader.h, cxxtools/src/http/client.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/streambuffer.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/xml/xmlreader.cpp, cxxtools/src/xmlrpc/client.cpp: fixed bugs in http-client and xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@817 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-07 maekitalo * cxxtools/src/http/parser.cpp: fix typo in logging category git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@816 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-06 maekitalo * cxxtools/include/cxxtools/iostream.h, cxxtools/src/http/client.cpp, cxxtools/src/iostream.cpp, cxxtools/src/streambuffer.cpp: - fix handling of streambuffer - add extend flag to iostream-classes - set extend flag in httpclient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@815 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-06 d-marc * cxxtools/src/iodeviceimpl.cpp: throw exception when connection is lost during writing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@814 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-06 d-marc * cxxtools/test/xmlrpc-test.cpp: changed xml rpc test to use MT http server mode git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@813 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-06 d-marc * cxxtools/test/Makefile.am: added http library dependecy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@812 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-06 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: add missing includes in Makefiles git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@811 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-05 maekitalo * cxxtools/include/cxxtools/http/api.h: add missing file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@810 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-04 maekitalo * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/httprequest.cpp, cxxtools/demo/httpserver.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/{httpclient.h => http/client.h}, cxxtools/include/cxxtools/{httpmessageheader.h => http/messageheader.h}, cxxtools/include/cxxtools/{httpparser.h => http/parser.h}, cxxtools/include/cxxtools/{httpreply.h => http/reply.h}, cxxtools/include/cxxtools/{httpreplyheader.h => http/replyheader.h}, cxxtools/include/cxxtools/{httprequest.h => http/request.h}, cxxtools/include/cxxtools/{httprequestheader.h => http/requestheader.h}, cxxtools/include/cxxtools/{httpresponder.h => http/responder.h}, cxxtools/include/cxxtools/{httpserver.h => http/server.h}, cxxtools/include/cxxtools/{httpservice.h => http/service.h}, cxxtools/include/cxxtools/{httpsocket.h => http/socket.h}, cxxtools/include/cxxtools/{ => net}/net.h, cxxtools/include/cxxtools/{ => net}/tcpserver.h, cxxtools/include/cxxtools/{ => net}/tcpsocket.h, cxxtools/include/cxxtools/{ => net}/tcpstream.h, cxxtools/include/cxxtools/{ => net}/udp.h, cxxtools/include/cxxtools/{ => net}/udpstream.h, cxxtools/include/cxxtools/xml/api.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/Makefile.am, cxxtools/src/http/Makefile.am, cxxtools/src/{httpclient.cpp => http/client.cpp}, cxxtools/src/{httpmessageheader.cpp => http/messageheader.cpp}, cxxtools/src/{httpparser.cpp => http/parser.cpp}, cxxtools/src/{httpresponder.cpp => http/responder.cpp}, cxxtools/src/{httpserver.cpp => http/server.cpp}, cxxtools/src/{httpsocket.cpp => http/socket.cpp}, cxxtools/src/log.cpp, cxxtools/src/net.cpp, cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp, cxxtools/src/udpstream.cpp, cxxtools/src/xmlrpc/Makefile.am, cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/responder.cpp, cxxtools/src/xmlrpc/service.cpp, cxxtools/test/tcpsockettest.cpp, cxxtools/test/xmlrpc-test.cpp: move http to a separate library move net-headers to own subdirectory git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@809 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 maekitalo * cxxtools/src/httpserver.cpp: fix a bug, which prevented the httpserver from finishing in some circumstances git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@808 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 d-marc * cxxtools/src/tcpsocketimpl.cpp, cxxtools/test/tcpsockettest.cpp: throw on endConnect if connect failed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@807 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 maekitalo * cxxtools/src/tcpsocketimpl.cpp: check for POLLERR in tcpsocket git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@806 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 maekitalo * cxxtools/include/cxxtools/httpserver.h, cxxtools/src/httpserver.cpp: delay listen and select until all worker threads are running git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@805 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 maekitalo * cxxtools/src/iodeviceimpl.cpp, cxxtools/src/selectorimpl.cpp: fix bug in iodevice when a new iodevice is just added to the selector during wait git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@804 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 d-marc * cxxtools/src/Makefile.am, cxxtools/test/Makefile.am, cxxtools/test/xmlrpc-test.cpp: added unit test for xmlrpc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@803 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 d-marc * cxxtools/src/xmlrpc/client.cpp, cxxtools/src/xmlrpc/formatter.cpp, cxxtools/src/xmlrpc/remoteprocedure.cpp, cxxtools/src/xmlrpc/responder.cpp, cxxtools/src/xmlrpc/service.cpp: added xmlrpc library git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@802 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-03 d-marc * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/cxxtools/typetraits.h, cxxtools/include/cxxtools/xmlrpc/api.h, cxxtools/include/cxxtools/xmlrpc/client.h, cxxtools/include/cxxtools/xmlrpc/fault.h, cxxtools/include/cxxtools/xmlrpc/formatter.h, cxxtools/include/cxxtools/xmlrpc/remoteprocedure.h, cxxtools/include/cxxtools/xmlrpc/responder.h, cxxtools/include/cxxtools/xmlrpc/scanner.h, cxxtools/include/cxxtools/xmlrpc/service.h, cxxtools/src/xmlrpc/Makefile.am, cxxtools/src/xmlrpc/fault.cpp, cxxtools/src/xmlrpc/scanner.cpp: added xmlrpc library git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@801 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-02 d-marc * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/textstream.h, cxxtools/include/cxxtools/xml/api.h, cxxtools/include/cxxtools/xml/characters.h, cxxtools/include/cxxtools/xml/comment.h, cxxtools/include/cxxtools/xml/doctypedeclaration.h, cxxtools/include/cxxtools/xml/enddocument.h, cxxtools/include/cxxtools/xml/endelement.h, cxxtools/include/cxxtools/xml/entityresolver.h, cxxtools/include/cxxtools/xml/namespace.h, cxxtools/include/cxxtools/xml/namespacecontext.h, cxxtools/include/cxxtools/xml/node.h, cxxtools/include/cxxtools/xml/processinginstruction.h, cxxtools/include/cxxtools/xml/startelement.h, cxxtools/include/cxxtools/xml/xmlerror.h, cxxtools/include/cxxtools/xml/xmlreader.h, cxxtools/include/cxxtools/xml/xmlwriter.h, cxxtools/src/textstream.cpp, cxxtools/src/xml/Makefile.am, cxxtools/src/xml/characters.cpp, cxxtools/src/xml/comment.cpp, cxxtools/src/xml/doctypedeclaration.cpp, cxxtools/src/xml/enddocument.cpp, cxxtools/src/xml/endelement.cpp, cxxtools/src/xml/entityresolver.cpp, cxxtools/src/xml/namespace.cpp, cxxtools/src/xml/namespacecontext.cpp, cxxtools/src/xml/processinginstruction.cpp, cxxtools/src/xml/startelement.cpp, cxxtools/src/xml/xmlerror.cpp, cxxtools/src/xml/xmlreader.cpp, cxxtools/src/xml/xmlwriter.cpp: added xml reader and writer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@800 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/deserializer.h, cxxtools/src/Makefile.am, cxxtools/src/deserializer.cpp: added Deserializer class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@799 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/formatter.h, cxxtools/include/cxxtools/serializer.h, cxxtools/src/Makefile.am, cxxtools/src/serializer.cpp: added serializer class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@798 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/serializationerror.h, cxxtools/include/cxxtools/serializationinfo.h, cxxtools/src/Makefile.am, cxxtools/src/serializationerror.cpp, cxxtools/src/serializationinfo.cpp: added SerializationInfo class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@797 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-01 maekitalo * cxxtools/include/cxxtools/config.h.in: readd lost ATOMICITY define git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@796 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-01 d-marc * cxxtools/include/cxxtools/stringstream.h, cxxtools/src/stringstream.cpp: added stringstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@795 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-01 d-marc * cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: added stringstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@794 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-04-01 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/base64codec.h, cxxtools/include/cxxtools/utf8codec.h, cxxtools/src/Makefile.am, cxxtools/src/utf8codec.cpp: added codecs git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@793 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-31 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/api.h, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/log.h, cxxtools/m4/cxxtools_logging.m4: fix CXXTOOLS_WITH_STD_LOCALE macro git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@792 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-31 maekitalo * cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpstream.cpp: - more granular logging in tcp classes - remove obsolete code git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@791 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-31 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/api.h, cxxtools/include/cxxtools/char.h, cxxtools/include/cxxtools/facets.h, cxxtools/include/cxxtools/textbuffer.h, cxxtools/include/cxxtools/textcodec.h, cxxtools/include/cxxtools/textstream.h, cxxtools/src/Makefile.am, cxxtools/src/char.cpp, cxxtools/src/facets.cpp, cxxtools/src/textcodec.cpp, cxxtools/src/textstream.cpp, cxxtools/src/unicode.h: added textstreams git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@790 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-31 maekitalo * cxxtools/src/iodeviceimpl.cpp: add missing return statement git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@789 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-28 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/httpmessage.h, cxxtools/src/httpserver.cpp: remove obsolete files formatting fix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@788 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-28 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/cxxtools/httpservice.h: bug fixed in httpserver demo add HttpCachedService template to ease implementing http-service classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@787 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-28 maekitalo * cxxtools/include/cxxtools/httpserver.h, cxxtools/src/httpserver.cpp: bugfixes in multithreaded httpserver git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@786 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-27 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/httpresponder.h, cxxtools/include/cxxtools/httpserver.h, cxxtools/include/cxxtools/httpservice.h, cxxtools/include/cxxtools/httpsocket.h, cxxtools/src/Makefile.am, cxxtools/src/httpclient.cpp, cxxtools/src/httpresponder.cpp, cxxtools/src/httpserver.cpp, cxxtools/src/httpsocket.cpp: split httpserver files into separate files and do some bugfixing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@785 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-27 maekitalo * cxxtools/src/httpclient.cpp: add mandatory host-header to request git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@784 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-27 maekitalo * cxxtools/configure.in: add autoconf test for C++ locale support git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@783 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-27 d-marc * cxxtools/include/cxxtools/string.h: changed iterator git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@782 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 maekitalo * cxxtools/src/httpserver.cpp: fix some, but not all bugs in multithreaded httpserver git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@781 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 d-marc * cxxtools/include/cxxtools/char.h: added operator != for wchar_t git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@780 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 d-marc * cxxtools/include/cxxtools/char.h: added operator != for wchar_t git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@779 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/string.h, cxxtools/include/cxxtools/string.tpp, cxxtools/include/cxxtools/stringdata.h, cxxtools/include/cxxtools/stringdata.tpp: added unicode capable string class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@778 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 d-marc * cxxtools/include/cxxtools/char.h: undeprecated Char::null git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@777 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/include/cxxtools/httpserver.h, cxxtools/src/httpserver.cpp: make httpserver multithreaded (untested) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@776 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-26 d-marc * cxxtools/include/cxxtools/httpclient.h, cxxtools/include/cxxtools/httpmessageheader.h: added CXXTOOLS_API macros git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@775 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-25 maekitalo * cxxtools/src/httpmessageheader.cpp: send right date in httpheader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@774 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-25 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/src/httpserver.cpp: bugfix for httpserver eof handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@773 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-25 d-marc * cxxtools/include/cxxtools/unit/testmethod.h, cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/eventsource.cpp, cxxtools/src/httpclient.cpp, cxxtools/src/selector.cpp: fix compile errors on solaris: std__make_pair not supported git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@772 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-24 maekitalo * cxxtools/demo/httpserver.cpp, cxxtools/src/httpserver.cpp: changes in httpserver: - add logging - fix keep alive - fix timeout handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@771 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-24 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/httpserver.cpp: add httpserver demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@770 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-24 maekitalo * cxxtools/src/httpclient.cpp: bugfis: wrong error type git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@769 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-24 d-marc * cxxtools/src/httpclient.cpp, cxxtools/src/tcpsocket.cpp: send connected Signal when beginConnect is immediately ready git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@768 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-24 d-marc * cxxtools/src/httpclient.cpp: handle the case when beginRead is immediately ready git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@767 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-23 d-marc * cxxtools/include/cxxtools/atomicity.h, cxxtools/src/atomicity.cpp: include AVR-32 when detected, sync with Pt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@766 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-23 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/char.h: added unicode char class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@765 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-23 d-marc * cxxtools/src/httpmessageheader.cpp: calculate day of week correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@764 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-23 d-marc * cxxtools/src/httpmessageheader.cpp: use Clock to get GMT time for header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@763 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-23 d-marc * cxxtools/include/cxxtools/clock.h, cxxtools/src/clockimpl.cpp: use localtime_r git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@762 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-23 d-marc * cxxtools/include/cxxtools/clock.h, cxxtools/src/clock.cpp, cxxtools/src/clockimpl.cpp, cxxtools/src/clockimpl.h: added getSystemTime method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@761 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-22 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/httpclient.h, cxxtools/include/cxxtools/httpmessage.h, cxxtools/include/cxxtools/httpmessageheader.h, cxxtools/include/cxxtools/httpparser.h, cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httpreplyheader.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/httprequestheader.h, cxxtools/include/cxxtools/httpserver.h, cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/Makefile.am, cxxtools/src/httpclient.cpp, cxxtools/src/httpmessageheader.cpp, cxxtools/src/httpparser.cpp, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/httpserver.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/streambuffer.cpp, cxxtools/src/tcpsocketimpl.cpp: http client rewritten and new http server git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@760 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-16 maekitalo * cxxtools/include/cxxtools/unit/assertion.h: clearer formatting of error message in CXXTOOLS_UNIT_ASSERT_EQUALS git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@759 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-13 d-marc * cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h: use DestructionSentry to detect self deletion git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@758 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-12 d-marc * cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h: allow self deteltion inside i/o callback git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@757 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-11 maekitalo * cxxtools/src/httprequest.cpp: set proper content-type header in post requests of http client git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@756 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-06 maekitalo * cxxtools/include/cxxtools/unit/testmain.h: initialize logging with log_init in unittest main git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@755 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-04 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/unit/assertion.h: add macro CXXTOOLS_UNIT_ASSERT_EQUALS to unittests and fix makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@754 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-04 maekitalo * cxxtools/test/Makefile.am: do not install unittest program git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@753 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-03-01 maekitalo * cxxtools/configure.in, cxxtools/m4/asmtype.m4, cxxtools/src/Makefile.am, cxxtools/test/Makefile.am: cleanup build integrate atomicity support avr32 into build git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@752 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-27 d-marc * cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/streambuffer.cpp: extensible output buffer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@751 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-27 maekitalo * cxxtools/include/cxxtools/smartptr.h: new FreeDestroyPolicy for smart pointers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@750 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-26 maekitalo * cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/selectable.h, cxxtools/include/cxxtools/tcpsocket.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/udp.h, cxxtools/src/selectorimpl.cpp: cleanup includes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@749 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-26 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/iostream.h, cxxtools/include/cxxtools/tcpstream.h: - add some more delegate methods to TcpStream - remove commented out classes - add explicit keyword to some xxStream-ctors git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@748 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-23 d-marc * cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: replace iostream with TcpStream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@747 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-23 d-marc * cxxtools/include/cxxtools/iostream.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/iostream.cpp: added TCP iostream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@746 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-23 d-marc * cxxtools/include/cxxtools/atomicity.gcc.avr32.h, cxxtools/src/atomicity.gcc.avr32.cpp: avr32 atomics added git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@745 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-21 maekitalo * cxxtools/demo/getini.cpp: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@744 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-21 maekitalo * cxxtools/include/cxxtools/config.h.in: remove unused macros git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@743 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-19 d-marc * cxxtools/src/win32.h: removed unneeded headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@742 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-19 d-marc * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/cxxtools/unit/registertest.h, cxxtools/include/cxxtools/unit/testmain.h, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h, cxxtools/test/Makefile.am, cxxtools/test/net-test.cpp, cxxtools/test/tcpsockettest.cpp: added unit test for tcp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@741 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-19 d-marc * cxxtools/src/unit/application.cpp, cxxtools/src/unit/testsuite.cpp: unit testing module updated git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@740 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: remoced comments git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@739 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/include/cxxtools/unit/registertest.h, cxxtools/include/cxxtools/unit/reporter.h, cxxtools/include/cxxtools/unit/test.h, cxxtools/include/cxxtools/unit/testcase.h, cxxtools/include/cxxtools/unit/testcontext.h, cxxtools/include/cxxtools/unit/testfixture.h, cxxtools/include/cxxtools/unit/testmethod.h, cxxtools/include/cxxtools/unit/testprotocol.h, cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/unit/Makefile.am, cxxtools/src/unit/application.cpp, cxxtools/src/unit/assertion.cpp, cxxtools/src/unit/reporter.cpp, cxxtools/src/unit/test.cpp, cxxtools/src/unit/testcase.cpp, cxxtools/src/unit/testcontext.cpp, cxxtools/src/unit/testprotocol.cpp, cxxtools/src/unit/testsuite.cpp: added unit testing library git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@738 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/src/tcpsocketimpl.cpp: set fd non-blocking when accepting git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@737 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/include/cxxtools/eventloop.h, cxxtools/include/cxxtools/selector.h, cxxtools/src/eventloop.cpp, cxxtools/src/selectable.cpp, cxxtools/src/selector.cpp: added onReinit method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@736 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/src/iodeviceimpl.cpp: removed unused header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@735 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/src/iodevice.cpp: rethrow exception git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@734 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/pollclass.h, cxxtools/src/Makefile.am, cxxtools/src/pollclass.cpp: removed pollclass git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@733 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 d-marc * cxxtools/src/iodevice.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: do not block but use timeout when syncronous read/write git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@732 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-18 maekitalo * cxxtools/src/iodeviceimpl.cpp: handle ECONNRESET on read correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@731 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 maekitalo * cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: I need still some features for tntnet git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@730 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/include/cxxtools/selectable.h, cxxtools/src/selectable.cpp: added comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@729 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/include/cxxtools/selectable.h: added comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@728 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/include/cxxtools/selectable.h: added comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@727 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/selectorimpl.cpp: do not reinit poll array on state change git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@726 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/selectorimpl.cpp, cxxtools/src/selectorimpl.h: check previously available selectables git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@725 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/demo/netio.cpp, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/tcpstream.cpp: handle EPIPE and ECONNRESET git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@724 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: implemented getPeerAddr git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@723 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: implemented blocking read/write with timeout git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@722 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/tcpsocket.cpp: sockets are always async git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@721 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/tcpsocketimpl.cpp: implemented getSockAddr git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@720 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/tcpsocketimpl.cpp: keep POLLOUT after endConnect when write is scheduled git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@719 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-17 d-marc * cxxtools/src/tcpsocketimpl.cpp: endConnect ends beginConnect synchronously with timeout git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@718 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: setup of pollfd works for reading/writing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@717 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/src/tcpsocketimpl.cpp: optional endConnect in blocking connect git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@716 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: derive from IODevice and IODeviceImpl git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@715 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: derive from IODeviceImpl git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@714 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: derive from i/o device git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@713 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/tcpsocket.cpp: derive from i/o device git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@712 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: added getSockAddr method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@711 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/include/cxxtools/ioerror.h, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/ioerror.cpp, cxxtools/src/net.cpp, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: added blocking and non-blocking connect git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@710 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 d-marc * cxxtools/src/addrinfo.cpp, cxxtools/src/addrinfo.h: typedef for Addrinfo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@709 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: return std::string for ip adresses instead of system specific structure git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@708 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-16 maekitalo * cxxtools/demo/dlloader.cpp, cxxtools/src/library.cpp: fixed library loading git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@707 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-13 maekitalo * cxxtools/src/tcpsocketimpl.cpp: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@706 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-13 maekitalo * cxxtools/include/cxxtools/smartptr.h: make destroy policy methods of smart pointer public git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@705 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-13 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/tcpsocket.h, cxxtools/src/Makefile.am, cxxtools/src/tcpserver.cpp, cxxtools/src/tcpserverimpl.cpp, cxxtools/src/tcpserverimpl.h, cxxtools/src/tcpsocket.cpp, cxxtools/src/tcpsocketimpl.cpp, cxxtools/src/tcpsocketimpl.h: added blocking connect git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@704 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-13 d-marc * cxxtools/src/tcpserverimpl.cpp: check FD_SETSIZE in wait git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@703 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-13 d-marc * cxxtools/src/tcpserverimpl.cpp: exception safety git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@702 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-13 d-marc * cxxtools/include/cxxtools/selector.h, cxxtools/src/selectable.cpp: changed attach/deach order git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@701 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-12 d-marc * cxxtools/src/library.cpp: open method attempts to open several library base names git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@700 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-12 d-marc * cxxtools/include/cxxtools/library.h, cxxtools/src/library.cpp: open method attempts to open several library base names git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@699 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-12 d-marc * cxxtools/src/library.cpp: open method attempts to open several library base names git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@698 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-12 d-marc * cxxtools/src/tcpserverimpl.cpp: removed unused fdset git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@697 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-11 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/{tcpserversocket.h => tcpserver.h}, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/{tcpserversocket.cpp => tcpserver.cpp}, cxxtools/src/{tcpserversocketimpl.cpp => tcpserverimpl.cpp}, cxxtools/src/{tcpserversocketimpl.h => tcpserverimpl.h}: renamed to TcpServer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@696 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-11 maekitalo * cxxtools/src/tcpserversocketimpl.cpp: bugfix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@695 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-11 d-marc * cxxtools/include/cxxtools/tcpserversocket.h, cxxtools/src/tcpserversocket.cpp, cxxtools/src/tcpserversocketimpl.cpp, cxxtools/src/tcpserversocketimpl.h: changed signal signature git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@694 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-11 d-marc * cxxtools/include/cxxtools/fileinfo.h: removed false docs git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@693 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/src/tcpserversocket.cpp, cxxtools/src/tcpserversocketimpl.cpp, cxxtools/src/tcpserversocketimpl.h: added signal for pending connections git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@692 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/include/cxxtools/tcpserversocket.h: added signal for pending connections git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@691 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/src/tcpserversocketimpl.cpp, cxxtools/src/tcpserversocketimpl.h: removed unnedded method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@690 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/src/tcpserversocketimpl.cpp: use select in wait method, because its alwys available git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@689 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/src/tcpserversocketimpl.cpp: added comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@688 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/include/cxxtools/tcpserversocket.h, cxxtools/src/tcpserversocket.cpp, cxxtools/src/tcpserversocketimpl.cpp, cxxtools/src/tcpserversocketimpl.h: TcpServersocket is a Selectable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@687 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-10 d-marc * cxxtools/include/cxxtools/selectable.h, cxxtools/src/iodeviceimpl.cpp: range check for wait time git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@686 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-09 maekitalo * cxxtools/src/addrinfo.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@685 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-09 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/tcpserversocket.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/tcpserversocket.cpp, cxxtools/src/tcpserversocketimpl.cpp, cxxtools/src/tcpserversocketimpl.h, cxxtools/src/tcpstream.cpp: moved tcp server socket to separate header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@684 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-09 d-marc * cxxtools/include/cxxtools/net.h, cxxtools/src/Makefile.am, cxxtools/src/addrinfo.cpp, cxxtools/{include/cxxtools => src}/addrinfo.h, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: moved addrinfo to src dir git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@683 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-09 d-marc * cxxtools/include/cxxtools/addrinfo.h, cxxtools/include/cxxtools/net.h, cxxtools/src/Makefile.am, cxxtools/src/addrinfo.cpp, cxxtools/src/net.cpp: moved addrinfo to separate files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@682 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-04 maekitalo * cxxtools/src/condition.cpp: do not broadcast condition in dtor git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@681 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-04 maekitalo * cxxtools/include/Makefile.am: add missing file to Makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@680 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-02-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/conversionerror.h, cxxtools/include/cxxtools/convert.h, cxxtools/src/Makefile.am, cxxtools/src/{convert.cpp => conversionerror.cpp}: moved conversion error to separate header file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@679 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-01-30 maekitalo * cxxtools/demo/logbench.cpp, cxxtools/src/thread.cpp: allow threads to be started again when they are finished git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@678 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-01-27 maekitalo * cxxtools/demo/logbench.cpp: fix multithreaded mode in logbench git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@677 15ae5fad-cc11-0410-8fac-bce609e504b0 2009-01-27 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h: improve performance of log statements when logging is not yet initialized git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@676 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-19 d-marc * cxxtools/include/cxxtools/iostream.h: added iostreams for iodevices git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@675 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-19 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/streambuffer.h, cxxtools/src/Makefile.am, cxxtools/src/streambuffer.cpp: added streambuf for iodevices git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@674 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-18 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/semaphore.h, cxxtools/src/Makefile.am, cxxtools/src/semaphore.cpp, cxxtools/src/semaphoreimpl.cpp, cxxtools/src/semaphoreimpl.h: added semaphore class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@673 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-17 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/application.h, cxxtools/include/cxxtools/eventloop.h, cxxtools/include/cxxtools/iodevice.h, cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/process.h, cxxtools/include/cxxtools/selectable.h, cxxtools/include/cxxtools/selector.h, cxxtools/include/cxxtools/timer.h, cxxtools/src/Makefile.am, cxxtools/src/application.cpp, cxxtools/src/applicationimpl.cpp, cxxtools/src/applicationimpl.h, cxxtools/src/eventloop.cpp, cxxtools/src/iodevice.cpp, cxxtools/src/iodeviceimpl.cpp, cxxtools/src/iodeviceimpl.h, cxxtools/src/pipe.cpp, cxxtools/src/pipeimpl.cpp, cxxtools/src/pipeimpl.h, cxxtools/src/process.cpp, cxxtools/src/processimpl.cpp, cxxtools/src/processimpl.h, cxxtools/src/selectable.cpp, cxxtools/src/selectableimpl.h, cxxtools/src/selector.cpp, cxxtools/src/selectorimpl.cpp, cxxtools/src/selectorimpl.h, cxxtools/src/timer.cpp: initial version for different classes (except for pipe) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@672 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-17 maekitalo * cxxtools/demo/thread.cpp: use the right sleep-function in demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@671 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-17 maekitalo * cxxtools/demo/thread.cpp, cxxtools/src/conditionimpl.cpp, cxxtools/src/muteximpl.cpp: fix error handling of mutex and conditions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@670 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-16 maekitalo * cxxtools/include/cxxtools/pipe.h, cxxtools/src/pipe.cpp: handle EINTR in read/write of pipe git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@669 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-16 maekitalo * cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/src/pipe.cpp: new methods in pipe to easily redirect stdin, stdout and stderr git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@668 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-16 maekitalo * cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: new method cxxtools::net::iostream::canRead() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@667 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-16 maekitalo * cxxtools/src/net.cpp: check error when switching blocking mode git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@666 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-14 maekitalo * cxxtools/m4/asmtype.m4: let x86-64 fail on x86-32 and fix x86-32 test to succeed in autoconf atomic test git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@665 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-14 maekitalo * cxxtools/configure.in, cxxtools/m4/asmtype.m4, cxxtools/m4/cxxtools_logging.m4, cxxtools/src/atomicity.generic.cpp: improved configure checks for atomic stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@664 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-13 maekitalo * cxxtools/src/eventsink.cpp: fix typo in #include-statement git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@663 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-12 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/eventsink.h, cxxtools/include/cxxtools/eventsource.h, cxxtools/src/Makefile.am, cxxtools/src/eventsink.cpp, cxxtools/src/eventsource.cpp: added event soure and sink class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@662 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-10 maekitalo * cxxtools/demo/arg-set.cpp, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp, cxxtools/demo/cxxlog.cpp, cxxtools/demo/dir.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/getini.cpp, cxxtools/demo/hd.cpp, cxxtools/demo/httprequest.cpp, cxxtools/demo/iconv.cpp, cxxtools/demo/log.cpp, cxxtools/demo/logbench.cpp, cxxtools/demo/logsh.cpp, cxxtools/demo/md5sum.cpp, cxxtools/demo/mime.cpp, cxxtools/demo/multifstream.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/demo/pipestream.cpp, cxxtools/demo/pool.cpp, cxxtools/demo/signals.cpp, cxxtools/demo/thread.cpp, cxxtools/demo/uuencode.cpp, cxxtools/include/cxxtools/allocator.h, cxxtools/include/cxxtools/api.h, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.mips.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.gcc.x86_64.h, cxxtools/include/cxxtools/atomicity.generic.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.pthread.h, cxxtools/include/cxxtools/atomicity.sun.h, cxxtools/include/cxxtools/atomicity.windows.h, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/byteorder.h, cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/cgi.h, cxxtools/include/cxxtools/clock.h, cxxtools/include/cxxtools/condition.h, cxxtools/include/cxxtools/connectable.h, cxxtools/include/cxxtools/connection.h, cxxtools/include/cxxtools/constmethod.h, cxxtools/include/cxxtools/convert.h, cxxtools/include/cxxtools/date.h, cxxtools/include/cxxtools/datetime.h, cxxtools/include/cxxtools/delegate.h, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/event.h, cxxtools/include/cxxtools/fdstream.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/fileinfo.h, cxxtools/include/cxxtools/fork.h, cxxtools/include/cxxtools/function.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/iconverter.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/inifile.h, cxxtools/include/cxxtools/iniparser.h, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/ioerror.h, cxxtools/include/cxxtools/library.h, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/log/disable.h, cxxtools/include/cxxtools/log/disable_init.h, cxxtools/include/cxxtools/log/log4cplus.h, cxxtools/include/cxxtools/log/log4cplus_init.h, cxxtools/include/cxxtools/log/log4cxx.h, cxxtools/include/cxxtools/log/log4cxx_init.h, cxxtools/include/cxxtools/loginit.h, cxxtools/include/cxxtools/main.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/method.h, cxxtools/include/cxxtools/mime.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/mutex.h, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/noncopyable.h, cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/properties.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/quotedprintablestream.h, cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/regex.h, cxxtools/include/cxxtools/signal.h, cxxtools/include/cxxtools/singleton.h, cxxtools/include/cxxtools/slot.h, cxxtools/include/cxxtools/smartptr.h, cxxtools/include/cxxtools/sourceinfo.h, cxxtools/include/cxxtools/stopwatch.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/syserror.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/time.h, cxxtools/include/cxxtools/timespan.h, cxxtools/include/cxxtools/types.h, cxxtools/include/cxxtools/typetraits.h, cxxtools/include/cxxtools/udp.h, cxxtools/include/cxxtools/udpstream.h, cxxtools/include/cxxtools/uuencode.h, cxxtools/include/cxxtools/void.h, cxxtools/include/cxxtools/xmltag.h, cxxtools/lgpl++.txt, cxxtools/setLicense.pl, cxxtools/src/atomicity.gcc.arm.cpp, cxxtools/src/atomicity.gcc.mips.cpp, cxxtools/src/atomicity.gcc.ppc.cpp, cxxtools/src/atomicity.gcc.sparc.cpp, cxxtools/src/atomicity.gcc.x86.cpp, cxxtools/src/atomicity.gcc.x86_64.cpp, cxxtools/src/atomicity.generic.cpp, cxxtools/src/atomicity.pthread.cpp, cxxtools/src/atomicity.sun.cpp, cxxtools/src/atomicity.windows.cpp, cxxtools/src/base64stream.cpp, cxxtools/src/cgi.cpp, cxxtools/src/clock.cpp, cxxtools/src/clockimpl.cpp, cxxtools/src/clockimpl.h, cxxtools/src/condition.cpp, cxxtools/src/conditionimpl.cpp, cxxtools/src/conditionimpl.h, cxxtools/src/connectable.cpp, cxxtools/src/connection.cpp, cxxtools/src/convert.cpp, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/directory.cpp, cxxtools/src/directoryimpl.cpp, cxxtools/src/directoryimpl.h, cxxtools/src/fdstream.cpp, cxxtools/src/file.cpp, cxxtools/src/fileimpl.cpp, cxxtools/src/fileimpl.h, cxxtools/src/fileinfo.cpp, cxxtools/src/fileinfoimpl.h, cxxtools/src/hdstream.cpp, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/inifile.cpp, cxxtools/src/iniparser.cpp, cxxtools/src/ioerror.cpp, cxxtools/src/library.cpp, cxxtools/src/libraryimpl.cpp, cxxtools/src/libraryimpl.h, cxxtools/src/log.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/mime.cpp, cxxtools/src/multifstream.cpp, cxxtools/src/mutex.cpp, cxxtools/src/muteximpl.cpp, cxxtools/src/muteximpl.h, cxxtools/src/net.cpp, cxxtools/src/pipe.cpp, cxxtools/src/pipestream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/properties.cpp, cxxtools/src/query_params.cpp, cxxtools/src/quotedprintablestream.cpp, cxxtools/src/regex.cpp, cxxtools/src/signal.cpp, cxxtools/src/sudo.cpp, cxxtools/src/systemerror.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/threadimpl.cpp, cxxtools/src/threadimpl.h, cxxtools/src/time.cpp, cxxtools/src/timespan.cpp, cxxtools/src/udp.cpp, cxxtools/src/udpstream.cpp, cxxtools/src/uuencode.cpp, cxxtools/src/win32.h, cxxtools/src/xmltag.cpp, cxxtools/test/cgitest.cpp, cxxtools/test/inifile.cpp, cxxtools/test/pooltest.cpp, cxxtools/test/query_params_it.cpp, cxxtools/test/query_params_test.cpp: update copyright text git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@661 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-10 maekitalo * cxxtools/configure.in: fixed configure check for sun atomicity git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@660 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-10 maekitalo * cxxtools/src/Makefile.am: fixed wrong filename in Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@659 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-09 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/atomicity.h: fix atomicity tests after disabling inlineing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@658 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-09 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.mips.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.gcc.x86_64.h, cxxtools/include/cxxtools/atomicity.generic.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.pthread.h, cxxtools/include/cxxtools/atomicity.sun.h, cxxtools/include/cxxtools/atomicity.windows.h, cxxtools/src/Makefile.am, cxxtools/src/atomicity.gcc.arm.cpp, cxxtools/src/atomicity.gcc.mips.cpp, cxxtools/src/atomicity.gcc.ppc.cpp, cxxtools/src/atomicity.gcc.sparc.cpp, cxxtools/src/atomicity.gcc.x86.cpp, cxxtools/src/atomicity.gcc.x86_64.cpp, cxxtools/src/atomicity.generic.cpp, cxxtools/src/{atomicity.cpp => atomicity.pthread.cpp}, cxxtools/src/atomicity.sun.cpp, cxxtools/src/atomicity.windows.cpp: do not inline atomic functions - this makes problems at least on xlC/AIX git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@657 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-09 d-marc * cxxtools/include/cxxtools/signal.h: specialized connect() for Signal git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@656 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-07 maekitalo * cxxtools/src/tcpstream.cpp: dD not throw an exception when peer closes connection in write. Return 0 instead git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@655 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-06 maekitalo * cxxtools/include/cxxtools/smartptr.h: fix RefLinked pointer policy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@654 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/src/timespan.cpp: add missing file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@653 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/hirestime.h, cxxtools/include/cxxtools/timespan.h, cxxtools/src/Makefile.am, cxxtools/src/hirestime.cpp: replace cxxtools::HiresTime with cxxtools::Timespan git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@652 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/configure.in: bump so number git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@651 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/src/library.cpp: add debug log messages git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@650 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/src/systemerror.cpp: add debug logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@649 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: revert to using mutex instead of spinmutex due to compile problems on AIX git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@648 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-05 maekitalo * cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: add include files to Makefile.am to get them into the dist package git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@647 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-03 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/condition.h, cxxtools/include/cxxtools/mutex.h, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/singleton.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/log.cpp, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: remove cxxtools::net::Error and other small fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@646 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/src/fdstream.cpp: retired syserror git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@645 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.windows.h: added atomicity for ReactOS and compatible OS git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@644 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/cxxtools/systemerror.h, cxxtools/src/Makefile.am, cxxtools/src/fdstream.cpp, cxxtools/src/log.cpp, cxxtools/src/pipe.cpp, cxxtools/src/pipestream.cpp, cxxtools/src/syserror.cpp, cxxtools/src/syserrorinternal.h, cxxtools/src/systemerror.cpp: retired syserror git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@643 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/main.h: added wmain wrapper git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@642 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/demo/signals.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/{signals.h => signal.h}, cxxtools/include/cxxtools/{signals.tpp => signal.tpp}, cxxtools/src/signal.cpp: renamed signals to signal git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@641 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/Makefile.am: added singleton template and typetraits git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@640 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/cxxtools/singleton.h, cxxtools/include/cxxtools/typetraits.h: added singleton template and typetraits git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@639 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/clock.h, cxxtools/src/Makefile.am, cxxtools/src/clock.cpp, cxxtools/src/clockimpl.cpp, cxxtools/src/clockimpl.h: added high precision system clock git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@638 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/cxxtools/date.h, cxxtools/include/cxxtools/datetime.h, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp: added date and time classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@637 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/time.h, cxxtools/src/Makefile.am, cxxtools/src/time.cpp: added date and time classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@636 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-02 d-marc * cxxtools/include/cxxtools/condition.h, cxxtools/src/Makefile.am, cxxtools/src/condition.cpp, cxxtools/src/conditionimpl.cpp, cxxtools/src/conditionimpl.h: separate implementation for Condition git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@635 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/configure.in: fix typo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@634 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/include/Makefile.am: add missing include files in Makefile.am git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@633 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/cxxtools-config.in: default to maxbackupindex of 2 instead of 10 in cxxtools-config-script git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@632 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: use spinlock instead of mutex in logger git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@631 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/src/net.cpp: style fix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@630 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/src/muteximpl.cpp, cxxtools/src/muteximpl.h: remove unused header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@629 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 maekitalo * cxxtools/src/timeclass.cpp: remove obsolete file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@628 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 d-marc * cxxtools/include/cxxtools/mutex.h: separate mutex implementation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@627 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 d-marc * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/mutex.h, cxxtools/src/condition.cpp, cxxtools/src/log.cpp, cxxtools/src/mutex.cpp: separate mutex implementation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@626 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 d-marc * cxxtools/src/Makefile.am, cxxtools/src/muteximpl.cpp, cxxtools/src/muteximpl.h: separate mutex implementation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@625 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 d-marc * cxxtools/include/cxxtools/timespan.h, cxxtools/include/cxxtools/types.h: initial commit git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@624 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 d-marc * cxxtools/include/cxxtools/api.h: added macros for symbol export/import git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@623 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-12-01 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/convert.h, cxxtools/src/Makefile.am, cxxtools/src/convert.cpp: added conversion algos git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@622 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-30 maekitalo * cxxtools/demo/thread.cpp, cxxtools/include/cxxtools/pool.h: do not include compatibility header but new new condition.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@621 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-30 maekitalo * cxxtools/src/condition.cpp: do not include compatibility header but new new condition.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@620 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-28 d-marc * cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/smartptr.h: use volatile for atomic_t git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@619 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-28 maekitalo * cxxtools/include/cxxtools/condition.h: fix comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@618 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-27 d-marc * cxxtools/src/dlloader.cpp: renamed sharedlib to library for use in dlloader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@617 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-27 d-marc * cxxtools/demo/dlloader.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/{sharedlib.h => library.h}, cxxtools/src/Makefile.am, cxxtools/src/{sharedlib.cpp => library.cpp}, cxxtools/src/{sharedlibimpl.cpp => libraryimpl.cpp}, cxxtools/src/{sharedlibimpl.h => libraryimpl.h}: renamed sharedlib to library for use in dlloader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@616 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-27 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/sharedlib.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/src/Makefile.am, cxxtools/src/sharedlib.cpp, cxxtools/src/sharedlibimpl.cpp, cxxtools/src/systemerror.cpp: added shared library class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@615 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-27 d-marc * cxxtools/include/cxxtools/sharedlib.h, cxxtools/src/sharedlib.cpp, cxxtools/src/sharedlibimpl.cpp, cxxtools/src/sharedlibimpl.h: added shared library class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@614 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-26 d-marc * cxxtools/demo/getini.cpp, cxxtools/include/cxxtools/mutex.h, cxxtools/include/cxxtools/sourceinfo.h, cxxtools/src/condition.cpp, cxxtools/src/mutex.cpp, cxxtools/src/threadimpl.cpp: removed MutexException in favor of SystemError git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@613 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-26 d-marc * cxxtools/include/cxxtools/condition.h, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/ioerror.h, cxxtools/include/cxxtools/mutex.h, cxxtools/src/condition.cpp, cxxtools/src/directory.cpp, cxxtools/src/file.cpp, cxxtools/src/ioerror.cpp, cxxtools/src/log.cpp: mutex class consolidation; Added more IOError types git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@612 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-25 maekitalo * cxxtools/src/thread.cpp: join thread only if it is in running state git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@611 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-25 maekitalo * cxxtools/src/thread.cpp: remove unused include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@610 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-25 d-marc * cxxtools/include/cxxtools/mutex.h, cxxtools/src/mutex.cpp: added tryReadLock and tryWriteLock for ReadWriteMutex git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@609 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-24 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/ioerror.h, cxxtools/src/Makefile.am, cxxtools/src/directory.cpp, cxxtools/src/file.cpp, cxxtools/src/ioerror.cpp: added IOError and AccessFailed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@608 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-19 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/condition.h, cxxtools/include/cxxtools/mutex.h, cxxtools/src/Makefile.am, cxxtools/src/condition.cpp, cxxtools/src/mutex.cpp: separate file for condition git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@607 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-19 d-marc * cxxtools/include/cxxtools/mutex.h, cxxtools/src/mutex.cpp: renamed timedwait in condition git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@606 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-15 maekitalo * cxxtools/src/hdstream.cpp: use right eof-value git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@605 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-14 d-marc * cxxtools/include/cxxtools/signals.h, cxxtools/include/cxxtools/syserror.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/src/signal.cpp, cxxtools/src/syserror.cpp, cxxtools/src/systemerror.cpp: signal not inline; syserror systemerror unification git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@604 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-14 d-marc * cxxtools/include/cxxtools/allocator.h, cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/connectable.h, cxxtools/include/cxxtools/connection.h, cxxtools/include/cxxtools/constmethod.h, cxxtools/include/cxxtools/constmethod.tpp, cxxtools/include/cxxtools/delegate.h, cxxtools/include/cxxtools/delegate.tpp, cxxtools/include/cxxtools/event.h, cxxtools/include/cxxtools/function.tpp, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/method.h, cxxtools/include/cxxtools/method.tpp, cxxtools/include/cxxtools/signals.h, cxxtools/include/cxxtools/signals.tpp, cxxtools/include/cxxtools/slot.h, cxxtools/src/Makefile.am, cxxtools/src/connectable.cpp, cxxtools/src/connection.cpp: updated signals and slots git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@603 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-07 maekitalo * cxxtools/src/fdstream.cpp, cxxtools/src/log.cpp, cxxtools/src/pipe.cpp, cxxtools/src/pipestream.cpp, cxxtools/src/syserror.cpp, cxxtools/src/syserrorinternal.h, cxxtools/src/thread.cpp, cxxtools/src/threadimpl.cpp: save some space by using a helper function to throw exceptions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@602 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-07 maekitalo * cxxtools/src/threadimpl.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@601 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 maekitalo * cxxtools/include/cxxtools/mutex.h, cxxtools/src/mutex.cpp: rename RWLock to RWMutex and add typedef for old name for compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@600 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 maekitalo * cxxtools/src/thread.cpp: remove unused include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@599 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 maekitalo * cxxtools/include/cxxtools/function.h: fix formatting of license part git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@598 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 maekitalo * cxxtools/src/thread.cpp: remove unused include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@597 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 maekitalo * cxxtools/demo/thread.cpp: start thread in demo was missing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@596 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 d-marc * cxxtools/src/threadimpl.cpp: init corrected, removed inheritsched git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@595 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 d-marc * cxxtools/src/threadimpl.cpp: do not pass ret by reference git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@594 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-05 d-marc * cxxtools/include/cxxtools/thread.h: explicit ctor for thread git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@593 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-04 d-marc * cxxtools/src/threadimpl.cpp: unified attached and detached thread classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@592 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-11-04 d-marc * cxxtools/demo/logbench.cpp, cxxtools/demo/pool.cpp, cxxtools/demo/thread.cpp, cxxtools/include/cxxtools/thread.h, cxxtools/src/Makefile.am, cxxtools/src/thread.cpp, cxxtools/src/threadimpl.cpp, cxxtools/src/threadimpl.h: unified attached and detached thread classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@591 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-10-30 d-marc * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: use callables as thread functors git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@590 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-10-02 maekitalo * cxxtools/include/cxxtools/net.h, cxxtools/src/dlloader.cpp, cxxtools/src/net.cpp: use RTLD_LOCAL for dynamic linking and don't inline exception classes to help detection of type information git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@589 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-09-27 maekitalo * cxxtools/src/tcpstream.cpp: use separate input and output buffers in tcpstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@588 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-09-12 maekitalo * cxxtools/demo/arg-set.cpp, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp, cxxtools/demo/cxxlog.cpp, cxxtools/demo/dir.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/getini.cpp, cxxtools/demo/hd.cpp, cxxtools/demo/httprequest.cpp, cxxtools/demo/iconv.cpp, cxxtools/demo/log.cpp, cxxtools/demo/logbench.cpp, cxxtools/demo/logsh.cpp, cxxtools/demo/md5sum.cpp, cxxtools/demo/mime.cpp, cxxtools/demo/multifstream.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/demo/pipestream.cpp, cxxtools/demo/pool.cpp, cxxtools/demo/signals.cpp, cxxtools/demo/thread.cpp, cxxtools/demo/uuencode.cpp, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.mips.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.gcc.x86_64.h, cxxtools/include/cxxtools/atomicity.generic.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.pthread.h, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/byteorder.h, cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/cgi.h, cxxtools/include/cxxtools/connectable.h, cxxtools/include/cxxtools/constmethod.h, cxxtools/include/cxxtools/delegate.h, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/fdstream.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/fileinfo.h, cxxtools/include/cxxtools/fork.h, cxxtools/include/cxxtools/function.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/hirestime.h, cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/iconverter.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/inifile.h, cxxtools/include/cxxtools/iniparser.h, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/log/disable.h, cxxtools/include/cxxtools/log/disable_init.h, cxxtools/include/cxxtools/log/log4cplus.h, cxxtools/include/cxxtools/log/log4cplus_init.h, cxxtools/include/cxxtools/log/log4cxx.h, cxxtools/include/cxxtools/log/log4cxx_init.h, cxxtools/include/cxxtools/loginit.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/method.h, cxxtools/include/cxxtools/mime.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/mutex.h, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/noncopyable.h, cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/properties.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/quotedprintablestream.h, cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/regex.h, cxxtools/include/cxxtools/signals.h, cxxtools/include/cxxtools/slot.h, cxxtools/include/cxxtools/smartptr.h, cxxtools/include/cxxtools/sourceinfo.h, cxxtools/include/cxxtools/stopwatch.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/syserror.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/udp.h, cxxtools/include/cxxtools/udpstream.h, cxxtools/include/cxxtools/uuencode.h, cxxtools/include/cxxtools/void.h, cxxtools/include/cxxtools/xmltag.h, cxxtools/src/atomicity.cpp, cxxtools/src/base64stream.cpp, cxxtools/src/cgi.cpp, cxxtools/src/connectable.cpp, cxxtools/src/connection.cpp, cxxtools/src/directoryimpl.h, cxxtools/src/dlloader.cpp, cxxtools/src/fdstream.cpp, cxxtools/src/fileimpl.h, cxxtools/src/fileinfoimpl.h, cxxtools/src/hdstream.cpp, cxxtools/src/hirestime.cpp, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/inifile.cpp, cxxtools/src/iniparser.cpp, cxxtools/src/log.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/mime.cpp, cxxtools/src/multifstream.cpp, cxxtools/src/mutex.cpp, cxxtools/src/net.cpp, cxxtools/src/pipe.cpp, cxxtools/src/pipestream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/properties.cpp, cxxtools/src/query_params.cpp, cxxtools/src/quotedprintablestream.cpp, cxxtools/src/regex.cpp, cxxtools/src/sudo.cpp, cxxtools/src/syserror.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/timeclass.cpp, cxxtools/src/udp.cpp, cxxtools/src/udpstream.cpp, cxxtools/src/uuencode.cpp, cxxtools/src/xmltag.cpp: add LGPL exception for large templates and macros git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@587 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-09-01 d-marc * cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.mips.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.gcc.x86_64.h, cxxtools/include/cxxtools/atomicity.generic.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.pthread.h, cxxtools/src/atomicity.cpp: atomicGet and AtomicSet added git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@586 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-27 maekitalo * cxxtools/src/tcpstream.cpp: fixed problem when connecting in non blocking mode takes too long (EINPROGRESS) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@585 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-27 maekitalo * cxxtools/src/directory.cpp: fixed naming git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@584 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-27 maekitalo * cxxtools/src/Makefile.am, cxxtools/src/dir.cpp: remove dir.cpp since it is not used any more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@583 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-27 maekitalo * cxxtools/demo/dir.cpp, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/directory.h: replaced old cxxtools::Dir with new cxxtools::Directory git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@582 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-17 d-marc * cxxtools/src/directory.cpp: fixed directory iterator advanceing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@581 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-15 d-marc * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/include/cxxtools/unit/registertest.h, cxxtools/include/cxxtools/unit/reporter.h, cxxtools/include/cxxtools/unit/test.h, cxxtools/include/cxxtools/unit/testcase.h, cxxtools/include/cxxtools/unit/testcontext.h, cxxtools/include/cxxtools/unit/testfixture.h, cxxtools/include/cxxtools/unit/testmethod.h, cxxtools/include/cxxtools/unit/testprotocol.h, cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/unit/Makefile.am, cxxtools/src/unit/application.cpp, cxxtools/src/unit/assertion.cpp, cxxtools/src/unit/reporter.cpp, cxxtools/src/unit/test.cpp, cxxtools/src/unit/testcase.cpp, cxxtools/src/unit/testcontext.cpp, cxxtools/src/unit/testprotocol.cpp, cxxtools/src/unit/testsuite.cpp: nobody likes testing :-( git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@580 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-14 maekitalo * cxxtools/include/cxxtools/mutex.h: additional optional parameter "locked" in SpinLock git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@579 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-14 maekitalo * cxxtools/include/cxxtools/thread.h: include mutex.h in thread.h for compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@578 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-14 d-marc * cxxtools/include/cxxtools/mutex.h: added tryLock method to SpinMutex git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@577 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-12 maekitalo * cxxtools/include/cxxtools/tcpstream.h: translate comment to english git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@576 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-11 maekitalo * cxxtools/include/cxxtools/mutex.h: spinlock simplified git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@575 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-11 maekitalo * cxxtools/include/cxxtools/tcpstream.h: fix ambiguity resolver from cxxtools::net::read git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@574 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-08 maekitalo * cxxtools/demo/thread.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/mutex.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/thread.h, cxxtools/src/Makefile.am, cxxtools/src/dlloader.cpp, cxxtools/src/log.cpp, cxxtools/src/mutex.cpp, cxxtools/src/thread.cpp: move mutex classes into separate files and add spinlock mutex git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@573 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-08 maekitalo * cxxtools/include/cxxtools/atomicity.gcc.ppc.h: improved atomicity functions for ppc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@572 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-08-07 maekitalo * cxxtools/include/cxxtools/atomicity.gcc.ppc.h: fixed atomicExchange for ppc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@571 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-07-03 maekitalo * cxxtools/src/log.cpp: fix compile error git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@570 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-07-03 maekitalo * cxxtools/configure.in, cxxtools/src/log.cpp: don't throw exceptions when logging fails git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@569 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-30 maekitalo * cxxtools/src/directoryimpl.cpp: add missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@568 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-29 maekitalo * cxxtools/ChangeLog, cxxtools/include/cxxtools/syserror.h: add some documentation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@567 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-19 maekitalo * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: revert the old template based mutexlock for binary compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@566 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-18 maekitalo * cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/smartptr.h: use non-atomic reference counting by default and add atomic refcounted class and smart pointer policy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@565 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-18 maekitalo * cxxtools/src/thread.cpp: remove unused include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@564 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-18 maekitalo * cxxtools/include/cxxtools/thread.h: don't use function pointers as template arguments since xlc 9.0 have problems here git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@563 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-17 maekitalo * cxxtools/src/Makefile.am: add missing files to Makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@562 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-13 maekitalo * cxxtools/include/Makefile.am: remove removed classes also from Makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@561 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/cxxtools/atomicity.h: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@560 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/cxxtools/atomicity.windows.h: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@559 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/cxxtools/atomicity.sun.h: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@558 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/convert.h, cxxtools/src/Makefile.am, cxxtools/src/convert.cpp: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@557 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/main.h, cxxtools/include/cxxtools/unit/testmain.h: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@556 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/api.h, cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/fileinfo.h, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/slot.h, cxxtools/include/cxxtools/sourceinfo.h, cxxtools/include/cxxtools/syserror.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/include/cxxtools/unit/api.h, cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/include/cxxtools/unit/reporter.h, cxxtools/include/cxxtools/unit/test.h, cxxtools/include/cxxtools/unit/testcase.h, cxxtools/include/cxxtools/unit/testcontext.h, cxxtools/include/cxxtools/unit/testfixture.h, cxxtools/include/cxxtools/unit/testmain.h, cxxtools/include/cxxtools/unit/testmethod.h, cxxtools/include/cxxtools/unit/testprotocol.h, cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/directoryimpl.h, cxxtools/src/fileimpl.h: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@555 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/cxxtools/file.h, cxxtools/src/file.cpp, cxxtools/src/fileimpl.cpp, cxxtools/src/fileimpl.h: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@554 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-10 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/any.h, cxxtools/include/cxxtools/typetraits.h, cxxtools/src/Makefile.am, cxxtools/src/any.cpp: removed unused stuff git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@553 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-09 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/date.h, cxxtools/include/cxxtools/datetime.h, cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/timespan.h, cxxtools/include/cxxtools/types.h, cxxtools/include/cxxtools/xtime.h, cxxtools/src/Makefile.am, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/fileimpl.h, cxxtools/src/time.cpp, cxxtools/src/timespan.cpp: removed obsolete classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@552 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-09 d-marc * cxxtools/include/cxxtools/types.h: remove unneeded ifdef git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@551 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-09 d-marc * cxxtools/src/fileinfoimpl.h: added new file/dir API git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@550 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-05 d-marc * cxxtools/include/cxxtools/syserror.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/src/syserror.cpp, cxxtools/src/systemerror.cpp: added new file/dir API git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@549 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-05 d-marc * cxxtools/include/Makefile.am: added new file/dir API git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@548 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-05 d-marc * cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/src/Makefile.am, cxxtools/src/directory.cpp, cxxtools/src/directoryimpl.cpp, cxxtools/src/directoryimpl.h, cxxtools/src/directoryimpl.posix.h, cxxtools/src/directoryimpl.win32.h, cxxtools/src/file.cpp, cxxtools/src/fileimpl.cpp, cxxtools/{include/cxxtools/filesystemnode.h => src/fileimpl.h}, cxxtools/src/fileimpl.posix.h, cxxtools/src/fileimpl.win32.h, cxxtools/src/fileinfo.cpp, cxxtools/src/filesystemnode.cpp, cxxtools/src/filesystemnodeimpl.posix.h, cxxtools/src/filesystemnodeimpl.win32.h: added new file/dir API git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@547 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-06-05 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/fileinfo.h, cxxtools/include/cxxtools/systemerror.h, cxxtools/src/Makefile.am, cxxtools/src/directoryimpl.cpp, cxxtools/src/directoryimpl.h, cxxtools/src/fileinfo.cpp, cxxtools/src/systemerror.cpp: added file information classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@546 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-26 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/hirestime.h: OS-X-specifix fixed from Roland Philppsen git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@544 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-21 d-marc * cxxtools/include/cxxtools/delegate.h: fixed typo in include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@541 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-19 d-marc * cxxtools/include/cxxtools/atomicity.gcc.mips.h: fixed variable name git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@540 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-16 d-marc * cxxtools/include/cxxtools/atomicity.gcc.mips.h: expected value not pointer in mips asm code git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@539 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-15 maekitalo * cxxtools/src/tcpstream.cpp: use memmove instead of std::memmove like before git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@538 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-05 d-marc * cxxtools/configure.in, cxxtools/include/cxxtools/signals.tpp, cxxtools/src/unit/Makefile.am: fixed signalslot, added cxxtools dependency to unit lib git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@536 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-04 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/cxxtools-config.in, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/loginit.h, cxxtools/src/Makefile.am, cxxtools/src/any.cpp, cxxtools/src/dir.cpp: sync with 1.4.8 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@535 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-04 maekitalo * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/regex.h, cxxtools/src/Makefile.am, cxxtools/src/regex.cpp: new wrapper class for regex(3) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@534 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-04 maekitalo * cxxtools/src/mime.cpp: add missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@533 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-01 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/config.h.in: fix support for asmtype sun in atomicity functions, prefer OS functions over inline assembler in atomicity git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@516 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-05-01 maekitalo * cxxtools/include/cxxtools/timeclass.h: remove unused file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@515 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-30 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/src/Makefile.am: there are compilers out there, which does not support typeid, so remove it git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@514 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-30 maekitalo * cxxtools/include/cxxtools/signals.h: fix include statement git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@513 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-30 maekitalo * cxxtools/include/cxxtools/config.h.in: add missing macro for sparc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@512 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-30 d-marc * cxxtools/include/cxxtools/constmethod.tpp, cxxtools/include/cxxtools/delegate.tpp, cxxtools/include/cxxtools/function.tpp, cxxtools/include/cxxtools/method.tpp, cxxtools/include/cxxtools/signals.h, cxxtools/include/cxxtools/slot.h: disconnect function added for signals and slots git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@511 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-14 d-marc * cxxtools/include/cxxtools/convert.h: revived result_type typedef git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@510 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-14 d-marc * cxxtools/include/cxxtools/convert.h: removed dead typedef git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@509 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-13 maekitalo * cxxtools/src/unit/Makefile: remove generated file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@508 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-13 maekitalo * cxxtools/include/cxxtools/convert.h, cxxtools/src/convert.cpp: add support for locales in cxxtools::convert and improve exception message git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@507 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-10 maekitalo * cxxtools/include/cxxtools/thread.h: rename parameter to fix conflicts with global errno variable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@506 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-10 maekitalo * cxxtools/src/httprequest.cpp: allow ':' in query parameters of http-request git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@505 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-10 d-marc * cxxtools/include/cxxtools/types.h: added time and date classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@504 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-10 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/date.h, cxxtools/include/cxxtools/datetime.h, cxxtools/include/cxxtools/timespan.h, cxxtools/include/cxxtools/xtime.h, cxxtools/src/Makefile.am, cxxtools/src/date.cpp, cxxtools/src/datetime.cpp, cxxtools/src/time.cpp, cxxtools/src/timespan.cpp: added time and date classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@503 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-03 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/main.h: added main wrapper git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@502 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-03 d-marc * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/unit/api.h, cxxtools/include/cxxtools/unit/application.h, cxxtools/include/cxxtools/unit/assertion.h, cxxtools/include/cxxtools/unit/registertest.h, cxxtools/include/cxxtools/unit/reporter.h, cxxtools/include/cxxtools/unit/test.h, cxxtools/include/cxxtools/unit/testcase.h, cxxtools/include/cxxtools/unit/testcontext.h, cxxtools/include/cxxtools/unit/testfixture.h, cxxtools/include/cxxtools/unit/testmain.h, cxxtools/include/cxxtools/unit/testmethod.h, cxxtools/include/cxxtools/unit/testprotocol.h, cxxtools/include/cxxtools/unit/testsuite.h, cxxtools/src/unit/Makefile, cxxtools/src/unit/Makefile.am, cxxtools/src/unit/application.cpp, cxxtools/src/unit/assertion.cpp, cxxtools/src/unit/reporter.cpp, cxxtools/src/unit/test.cpp, cxxtools/src/unit/testcase.cpp, cxxtools/src/unit/testcontext.cpp, cxxtools/src/unit/testprotocol.cpp, cxxtools/src/unit/testsuite.cpp: added unit testing framework git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@501 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-04-01 d-marc * cxxtools/src/Makefile.am, cxxtools/src/convert.cpp: added conversion functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@500 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-31 maekitalo * cxxtools/include/cxxtools/convert.h: fixed includes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@499 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-31 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/convert.h: added conversion functions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@498 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-27 maekitalo * cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp: improve and add documentation to http-client classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@497 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-27 maekitalo * cxxtools/configure.in: update version number git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@496 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-27 maekitalo * cxxtools/include/cxxtools/tcpstream.h: increase default buffer size of tcp-socket from 256 to 8192 bytes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@495 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-27 maekitalo * cxxtools/include/cxxtools/httprequest.h, cxxtools/src/httprequest.cpp: allow access to underlying iostream in httprequest git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@494 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-27 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.sun.h: added atomic ops for solaris git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@493 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-24 maekitalo * cxxtools/ChangeLog: convert tabs into spaces git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@491 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-23 maekitalo * cxxtools/demo/Makefile.am: don't install any programs with cxxtools git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@490 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-22 maekitalo * vim/.vim/skeletons/skel.cpp, vim/.vim/skeletons/skel.h: update copyright year git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@489 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-21 maekitalo * vim/.vim/skeletons/skel.pl: change default author git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@488 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-11 adig33 * cxxtools/src/thread.cpp: timedwait to expect an absolute time git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@487 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-11 d-marc * cxxtools/include/cxxtools/signals.tpp, cxxtools/include/cxxtools/sourceinfo.h: typedef in Signal is _Invokable now dont use __FUNCTION__ by default git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@486 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-09 maekitalo * cxxtools/cxxtools-config.in, cxxtools/src/log.cpp: remove flushdelay git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@485 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-09 maekitalo * cxxtools/src/tcpstream.cpp: don't try to write 0 bytes in cxxtools::net::streambuf::sync and fail git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@484 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-09 maekitalo * cxxtools/src/thread.cpp: add error checking to tryLock git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@483 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-09 maekitalo * cxxtools/src/tcpstream.cpp: fix bug in cxxtools::net::streambuf::sync introduced with partial writes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@482 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-09 maekitalo * cxxtools/ChangeLog, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: support for partial write in tcpstream translate documentation to english git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@481 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-08 maekitalo * cxxtools/configure.in, cxxtools/src/log.cpp: remove delayed log feature since this was not reliable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@480 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-07 maekitalo * cxxtools/include/cxxtools/httpreply.h: add missing const declaration git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@479 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-05 maekitalo * cxxtools/src/tcpstream.cpp: fix timeout handling in Stream::write in blocking mode git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@478 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-05 maekitalo * cxxtools/demo/md5sum.cpp: remove unused include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@477 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-02 maekitalo * vim/.vim/syntax/ecpp.vim: add syntax highlighting for ecpp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@476 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-02 maekitalo * vim/.vim/syntax/ecpp.vim: remove symlink git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@475 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-03-01 maekitalo * cxxtools/include/Makefile.am: add missing files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@474 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-27 maekitalo * cxxtools/src/tcpstream.cpp: use timeout in connect-method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@473 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-27 maekitalo * cxxtools/include/cxxtools/atomicity.h: fix typo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@472 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-27 maekitalo * cxxtools/src/syserror.cpp: add errno to error message git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@471 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-21 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/cxxlog.cpp: add new demo cxxlog, which is also a useful tool for logging from shell-scripts and therefore installed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@470 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-17 maekitalo * cxxtools/include/cxxtools/fork.h: fix doxygen comment tag git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@469 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-16 maekitalo * vim/.gvimrc, vim/.vim/filetype.vim, vim/.vim/htmlsubst, vim/.vim/skeletons/skel.cpp, vim/.vim/skeletons/skel.h, vim/.vim/skeletons/skel.html, vim/.vim/skeletons/skel.mason, vim/.vim/skeletons/skel.pl, vim/.vim/syntax/ecpp.vim, vim/.vim/syntax/eruby.tm.vim, vim/.vim/syntax/eruby.vim, vim/.vim/vimrc.c, vim/.vim/vimrc.cpp, vim/.vim/vimrc.ecpp, vim/.vim/vimrc.h, vim/.vim/vimrc.html, vim/.vim/vimrc.mason, vim/.vim/vimrc.perl, vim/.vimrc: my vim settings git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@468 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-11 d-marc * cxxtools/include/cxxtools/sourceinfo.h: cxxtools namespace instead of Pt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@467 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-02-11 d-marc * cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/callable.tpp, cxxtools/include/cxxtools/constmethod.h, cxxtools/include/cxxtools/constmethod.tpp, cxxtools/include/cxxtools/delegate.h, cxxtools/include/cxxtools/delegate.tpp, cxxtools/include/cxxtools/function.h, cxxtools/include/cxxtools/function.tpp, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/invokable.tpp, cxxtools/include/cxxtools/method.h, cxxtools/include/cxxtools/method.tpp, cxxtools/include/cxxtools/signals.h, cxxtools/include/cxxtools/signals.tpp, cxxtools/include/cxxtools/slot.h, cxxtools/include/cxxtools/slot.tpp: Signals and Delegates can take up to 10 parameters now git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@466 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-21 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/config.h.in: integrate atomicity for x84-64 into autoconf git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@465 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-21 maekitalo * cxxtools/AUTHORS: add marc to authors git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@464 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-21 d-marc * cxxtools/include/cxxtools/atomicity.gcc.x86_64.h: fixed operand size git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@463 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-18 maekitalo * cxxtools/include/cxxtools/pool.h: make creator of cxxtools::Pool accessable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@462 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-15 d-marc * cxxtools/include/cxxtools/atomicity.gcc.sparc.h: atomic ops for sparc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@461 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-08 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.gcc.x86_64.h: added experimental asm for x86-64 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@460 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-08 maekitalo * cxxtools/include/Makefile.am: rename typeinfo.h to typetraits.h in Makefile also git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@459 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-08 d-marc * cxxtools/include/cxxtools/any.h, cxxtools/include/cxxtools/typeinfo.h, cxxtools/include/cxxtools/typetraits.h: replace typeinfo with typetraits git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@458 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-08 d-marc * cxxtools/include/cxxtools/atomicity.gcc.mips.h: fixed mips asm code git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@457 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-07 maekitalo * cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/smartptr.h: use atomic operations for reference counters git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@456 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-07 maekitalo * cxxtools/m4/iconv.m4: fixes for autoconf 2.61 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@455 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-07 maekitalo * cxxtools/demo/Makefile.am: fix generation of properties-files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@454 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-07 maekitalo * cxxtools/configure.in: increase so-version-number git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@453 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-07 maekitalo * cxxtools/configure.in: fix typo in atomic-type detection on ppc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@452 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-03 maekitalo * cxxtools/configure.in, cxxtools/demo/mime.cpp, cxxtools/include/cxxtools/mime.h, cxxtools/src/mime.cpp, cxxtools/src/quotedprintablestream.cpp: fixed some formatting bugs in mime classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@451 15ae5fad-cc11-0410-8fac-bce609e504b0 2008-01-03 maekitalo * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: support for pthread_kill git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@450 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-27 maekitalo * cxxtools/demo/uuencode.cpp: add uuencode-demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@449 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-27 maekitalo * cxxtools/debian/README.Debian, cxxtools/debian/changelog, cxxtools/debian/compat, cxxtools/debian/control, cxxtools/debian/copyright, cxxtools/debian/libcxxtools-dev.install, cxxtools/debian/libcxxtools.install, cxxtools/debian/rules: remove obsolete debian package configuration git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@448 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/mime.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/mime.h, cxxtools/include/cxxtools/quotedprintablestream.h, cxxtools/include/cxxtools/uuencode.h, cxxtools/src/Makefile.am, cxxtools/src/mime.cpp, cxxtools/src/quotedprintablestream.cpp, cxxtools/src/uuencode.cpp: classes for creating mime objects git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@447 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-20 maekitalo * cxxtools/src/uuencode.cpp: end uuencode stream correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@446 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-18 maekitalo * cxxtools/src/uuencode.cpp: remove unused map git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@445 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-18 maekitalo * cxxtools/include/Makefile.am, cxxtools/src/Makefile.am: add uuencoder git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@444 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-18 maekitalo * cxxtools/include/cxxtools/uuencode.h, cxxtools/src/uuencode.cpp: finalize uuencoder git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@443 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-17 maekitalo * cxxtools/include/cxxtools/uuencode.h, cxxtools/src/uuencode.cpp: new classes for uuencoding/decoding (unfinished) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@442 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-17 maekitalo * cxxtools/demo/httprequest.cpp: remove unused headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@441 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-17 maekitalo * cxxtools/src/pipestream.cpp: bugfix: clear stream after flush git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@440 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-16 maekitalo * cxxtools/include/cxxtools/refcounted.h: make ctor with one parameter explicit git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@439 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-16 d-marc * cxxtools/include/cxxtools/refcounted.h: set refs in ctor git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@438 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-16 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in: version 1.4.6 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@434 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-13 maekitalo * cxxtools/demo/logbench.cpp: test logging with multiple threads git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@433 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-13 maekitalo * cxxtools/src/log.cpp: fix potential double unlock in logging system git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@432 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-13 maekitalo * cxxtools/include/cxxtools/thread.h: new method UnlockMonitor::unlock for explicit unlocking git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@431 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-13 maekitalo * cxxtools/src/thread.cpp: make AttachedThread reusable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@430 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-12 maekitalo * cxxtools/src/pipestream.cpp: sync and close before deleting buffers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@429 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-12 maekitalo * cxxtools/include/cxxtools/pipestream.h: flush pipestream before closing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@428 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-09 maekitalo * cxxtools/include/cxxtools/smartptr.h: fix getRefs-method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@427 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-09 d-marc * cxxtools/include/cxxtools/atomicity.generic.h: fixed tmp variable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@426 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-09 d-marc * cxxtools/include/cxxtools/atomicity.generic.h: match declaration in atomicity.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@425 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-09 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: check for sched_yield function in configure git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@424 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-09 maekitalo * cxxtools/cxxtools-config.in, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: logging through pipe to a forked process git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@423 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-09 maekitalo * cxxtools/include/cxxtools/fork.h: documentation update git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@422 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-07 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/sourceinfo.h: added SourceInfo class fixed missing haders in Makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@421 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-07 d-marc * cxxtools/include/cxxtools/delegate.h: added delegate class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@420 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-06 d-marc * cxxtools/src/filesystemnodeimpl.win32.h: workaround for .sys files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@419 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-06 maekitalo * cxxtools/src/log.cpp: fix possible delay of queued log messages git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@418 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-05 d-marc * cxxtools/include/cxxtools/directory.h, cxxtools/src/directory.cpp: made cmp operators inline git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@417 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-05 d-marc * cxxtools/include/cxxtools/directory.h: added typedef for iterator git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@416 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-05 d-marc * cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/filesystemnode.h, cxxtools/src/Makefile.mingw, cxxtools/src/directory.cpp, cxxtools/src/directoryimpl.posix.h, cxxtools/src/directoryimpl.win32.h, cxxtools/src/filesystemnode.cpp, cxxtools/src/filesystemnodeimpl.posix.h, cxxtools/src/filesystemnodeimpl.win32.h: added iterator for directories git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@415 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-05 maekitalo * cxxtools/src/log.cpp: use vector instead of list for queueing log messages git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@414 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-04 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/thread.h, cxxtools/src/log.cpp: reduce lock delays in logging and fix a possible deadlock in logging-code on aix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@413 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-04 maekitalo * cxxtools/configure.in, cxxtools/src/Makefile.am: use iconv.m4 again for detecting iconv git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@412 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-04 d-marc * cxxtools/src/file.cpp: fixed assignment operator not to use new/delete git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@411 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-04 d-marc * cxxtools/include/cxxtools/directory.h, cxxtools/include/cxxtools/file.h, cxxtools/include/cxxtools/filesystemnode.h: added file system classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@410 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-04 d-marc * cxxtools/src/Makefile.mingw, cxxtools/src/directory.cpp, cxxtools/src/file.cpp, cxxtools/src/fileimpl.posix.h, cxxtools/src/fileimpl.win32.h, cxxtools/src/win32.h: added file system classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@409 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-03 maekitalo * cxxtools/src/httprequest.cpp: bugfix: send http-body in POST-requests git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@408 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-02 maekitalo * cxxtools/configure.in, cxxtools/src/Makefile.am: fix bsd build git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@407 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-12-01 maekitalo * cxxtools/include/Makefile.am: add api.h to makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@406 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-30 maekitalo * cxxtools/src/Makefile.mingw: Makefile for building a windows dll with mingw on ubuntu (not finished yet) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@405 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-30 maekitalo * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/base64stream.cpp, cxxtools/src/httprequest.cpp: implement http-auth in httpclient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@404 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-22 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/atomicity.pthread.h, cxxtools/include/cxxtools/config.h.in, cxxtools/src/Makefile.am, cxxtools/src/atomicity.cpp: conditionally make atomicity.pthread git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@403 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-22 maekitalo * cxxtools/src/query_params.cpp: escape '&'-character in urls also git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@402 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-22 d-marc * cxxtools/include/cxxtools/api.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.windows.h, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/syserror.h, cxxtools/src/Makefile.win32: first win32 version git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@401 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-20 d-marc * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.pthread.h, cxxtools/src/Makefile.am, cxxtools/src/atomicity.cpp: added pthread fallback for atomic ops git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@400 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-19 d-marc * cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.generic.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.windows.h: fixed use of volatile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@399 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-16 maekitalo * cxxtools/include/cxxtools/smartptr.h: fix for external ref counted smart pointer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@397 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-15 maekitalo * cxxtools/include/cxxtools/smartptr.h: add method addRefs to smart pointer with external ref counted git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@396 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-05 d-marc * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.sparc.h, cxxtools/include/cxxtools/atomicity.h: added atomic ops for sparc improved atomic ops for ppc and arm git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@395 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-05 maekitalo * cxxtools/configure.in: don't warn, but just notice about unknown asm-type git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@394 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-04 maekitalo * cxxtools/include/cxxtools/smartptr.h: add ArrayDestroyPolicy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@393 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-03 maekitalo * cxxtools/ChangeLog, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/byteorder.h: functions for handling endianess (cxxtools/byteorder.h) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@392 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-02 maekitalo * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/atomicity.gcc.mips.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/config.h.in: check with autoconf, which atmicity variant to use git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@391 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-02 d-marc * cxxtools/include/cxxtools/any.h, cxxtools/src/any.cpp: sync docs with Pt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@390 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-11-01 d-marc * cxxtools/include/cxxtools/any.h, cxxtools/include/cxxtools/typeinfo.h, cxxtools/src/Makefile.am, cxxtools/src/any.cpp: added Any type and some compile-time typeinfo support git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@389 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-31 d-marc * cxxtools/include/cxxtools/atomicity.gcc.arm.h, cxxtools/include/cxxtools/atomicity.gcc.mips.h, cxxtools/include/cxxtools/atomicity.gcc.ppc.h, cxxtools/include/cxxtools/atomicity.gcc.x86.h, cxxtools/include/cxxtools/atomicity.generic.h, cxxtools/include/cxxtools/atomicity.h, cxxtools/include/cxxtools/atomicity.windows.h: added atomic operations git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@388 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-28 maekitalo * cxxtools/demo/iconv.cpp, cxxtools/include/cxxtools/iconvstream.h: set flags correctly, when iconv_open fails in ctor git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@387 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-25 maekitalo * cxxtools/demo/iconv.cpp: replace tabs with spaces in source git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@386 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-25 maekitalo * cxxtools/demo/pool.cpp, cxxtools/include/cxxtools/udpstream.h, cxxtools/src/fdstream.cpp, cxxtools/src/net.cpp, cxxtools/src/pipestream.cpp, cxxtools/src/thread.cpp: fixed some ansi violations, which lead to a warning or error with -pedantic flag in gcc git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@385 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-21 maekitalo * cxxtools/include/Makefile.am: function.h was missing git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@384 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-21 maekitalo * cxxtools/configure.in: version 1.4.5.1 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@382 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-21 maekitalo * cxxtools/include/cxxtools/inifile.h: empty constructor git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@381 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-21 maekitalo * cxxtools/include/cxxtools/smartptr.h: simplify code git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@380 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-18 d-marc * cxxtools/include/cxxtools/connectable.h, cxxtools/include/cxxtools/signals.h, cxxtools/src/connectable.cpp: fixed assignment of Connectables git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@379 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-17 maekitalo * cxxtools/src/fdstream.cpp: fix: fdstream::sync() must return 0 on not error git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@378 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-17 maekitalo * cxxtools/ChangeLog, cxxtools/Makefile.am, cxxtools/autogen.sh, cxxtools/configure.in, cxxtools/src/Makefile.am, cxxtools/src/dlloader.cpp: remove libltdl git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@377 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-17 maekitalo * cxxtools/include/cxxtools/smartptr.h: implement destroy policy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@376 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-17 d-marc * cxxtools/include/cxxtools/connectable.h, cxxtools/src/connectable.cpp: removed shutdown flag git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@375 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-15 maekitalo * cxxtools/include/Makefile.am: add signal/slot-headers to makefile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@374 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-15 d-marc * cxxtools/demo/signals.cpp, cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/connectable.h, cxxtools/include/cxxtools/connection.h, cxxtools/include/cxxtools/{signal.h => signals.h}, cxxtools/include/cxxtools/slot.h, cxxtools/src/connectable.cpp, cxxtools/src/connection.cpp: renamed signal.h to signals.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@373 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-12 d-marc * cxxtools/demo/Makefile.am, cxxtools/demo/signals.cpp, cxxtools/include/cxxtools/callable.h, cxxtools/include/cxxtools/connectable.h, cxxtools/include/cxxtools/connection.h, cxxtools/include/cxxtools/constmethod.h, cxxtools/include/cxxtools/function.h, cxxtools/include/cxxtools/invokable.h, cxxtools/include/cxxtools/method.h, cxxtools/include/cxxtools/signal.h, cxxtools/include/cxxtools/slot.h, cxxtools/include/cxxtools/void.h, cxxtools/src/Makefile.am, cxxtools/src/connectable.cpp, cxxtools/src/connection.cpp: added signals/slots git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@372 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-10-12 maekitalo * cxxtools/ChangeLog, cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/Makefile.am, cxxtools/src/dlloader.cpp, cxxtools/src/properties.cpp: doxygen comments in httprequest/httpreply bugfix in properties don't use libltdl by default any more git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@371 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-09-13 maekitalo * cxxtools/configure.in, cxxtools/src/Makefile.am: support for aix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@370 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-08-12 maekitalo * cxxtools/configure.in, cxxtools/src/iconvstream.cpp: check for const in iconv(3) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@369 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-08-12 maekitalo * cxxtools/include/cxxtools/arg.h, cxxtools/src/cgi.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/log.cpp, cxxtools/src/net.cpp, cxxtools/src/pipe.cpp, cxxtools/src/syserror.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: add missing headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@368 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-08-12 maekitalo * cxxtools/configure.in: check for iconv.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@367 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-20 maekitalo * cxxtools/configure.in, cxxtools/include/cxxtools/iconverter.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/src/iconvstream.cpp: fix cxxtools::iconvstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@366 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-20 maekitalo * cxxtools/cxxtools.spec: spec-file update by Christoph Haubrich git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@365 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-09 maekitalo * cxxtools/configure.in, cxxtools/demo/getini.cpp, cxxtools/include/cxxtools/inifile.h: extend demo/getini change name template-methods for automatic type-conversion in cxxtools::IniFile for clearer template resolution git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@363 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-09 maekitalo * cxxtools/README, cxxtools/configure.in: minor fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@362 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-08 maekitalo * cxxtools/src/log.cpp: ignore case in loglevel git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@361 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-07 maekitalo * cxxtools/ChangeLog, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/properties.h, cxxtools/src/Makefile.am, cxxtools/src/properties.cpp: parser for property-files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@360 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-07 maekitalo * cxxtools/include/cxxtools/iniparser.h: initialize parsingstate git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@359 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-07 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/getini.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/iniclass.h, cxxtools/include/cxxtools/inifile.h, cxxtools/include/cxxtools/iniparser.h, cxxtools/src/Makefile.am, cxxtools/src/iconvstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/inifile.cpp, cxxtools/src/iniparser.cpp: - rewritten ini-file-parser - make iconv unconditional and make iconv-buffer bigger for better performance git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@358 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-06 maekitalo * cxxtools/ChangeLog, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/noncopyable.h, cxxtools/include/cxxtools/refcounted.h, cxxtools/include/cxxtools/smartptr.h: - add policy based smart pointer implementation - add NonCopyable-class, which can be used as a base-class for objects, which must not be copied - fix bug in subtraction-method of cxxtools::HiresTime git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@357 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-07-05 maekitalo * cxxtools/src/hirestime.cpp: fix difference-calculation between HiresTime-objects git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@356 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-28 maekitalo * cxxtools/configure.in: version number update git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@355 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-12 maekitalo * cxxtools/src/log.cpp: fix crash, when flusherthread is not active git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@354 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-12 maekitalo * cxxtools/Makefile.am: add custom m4-macros in dist-package git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@352 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-12 maekitalo * cxxtools/configure.in: update version-number git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@351 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-12 maekitalo * cxxtools/src/log.cpp: delay opening logfile and starting flusherthread until really needed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@350 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-12 maekitalo * cxxtools/ChangeLog, cxxtools/cxxtools-config.in, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: logging can be disabled completely now in the logging-properties git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@349 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-11 maekitalo * cxxtools/ChangeLog, cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/m4/acx_pthread.m4: build-improvements (port to solaris/SunStudio) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@348 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-11 maekitalo * cxxtools/include/cxxtools/pool.h: make cxxtools::Pool working again git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@347 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-11 maekitalo * cxxtools/include/cxxtools/dlloader.h, cxxtools/src/dlloader.cpp: catch exceptions in destructor of cxxtools::Library git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@346 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-10 maekitalo * cxxtools/m4/acx_pthread.m4: modify order of pthread-flags-detection - it simply did not work on linux git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@345 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-10 maekitalo * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: derive ThreadException from SysError git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@344 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-10 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h: defer fetching logger until really needed to reduce problems with initialization-order git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@343 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-09 maekitalo * cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/m4/acx_pthread.m4, cxxtools/src/Makefile.am, cxxtools/test/Makefile.am: use ACX_PTHREAD-macro from autoconf-archive to detect pthread-build-flags git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@342 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-09 maekitalo * cxxtools/include/cxxtools/fdstream.h: use the passed flag to Fdiostream::setClose git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@341 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-04 maekitalo * cxxtools/ChangeLog, cxxtools/src/thread.cpp: remove pthread-initializer-constant - *_init-functions should be sufficient git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@340 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-04 maekitalo * cxxtools/include/cxxtools/udpstream.h, cxxtools/src/udpstream.cpp: replace std::string with char* as buffer for udpstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@339 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-03 maekitalo * cxxtools/include/cxxtools/net.h, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: make cxxtools::socket::doPoll-method public and rename to poll git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@338 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-05-03 maekitalo * cxxtools/ChangeLog, cxxtools/src/udpstream.cpp: bugfix: clear buffer of udpstream after sending message git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@337 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-27 maekitalo * cxxtools/src/log.cpp: allow logging via udp-broadcast git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@336 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-26 maekitalo * cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: try next addrinfo, when socket-creation fails git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@335 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-22 maekitalo * cxxtools/src/tcpstream.cpp: fixed error-handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@334 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-20 maekitalo * cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/fdstream.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/udpstream.h: fixed again std::ios-derived classes to conform ANSI git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@333 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-18 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in: updated to 1.4.3.5 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@331 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-18 maekitalo * cxxtools/include/cxxtools/pool.h: remove double-lock of mutex git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@330 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-17 maekitalo * cxxtools/ChangeLog, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/fdstream.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/udpstream.h: another change in initialization in std::ios-derived classes after reading the c++-standard (now std::ios::init is used for initialization) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@329 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-15 maekitalo * cxxtools/include/cxxtools/thread.h: fixed return-type git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@328 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-15 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/cxxtools-config.in, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/fdstream.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/udpstream.h: don't pass uninitialized std::streabuf to base-class in classes derived from std::[io]stream. This should be ok, but at least Sun Studio 11 fails here. git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@327 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-15 maekitalo * cxxtools/src/dlloader.cpp: add locks to library-loader git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@326 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-15 maekitalo * cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: add error-handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@325 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-15 maekitalo * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: new method lockNoThrow in Mutex and RWLock for unlocking without exception - just warning-log and return (they are used in Scoped-lock-classes) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@324 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-04-11 maekitalo * cxxtools/demo/dir.cpp, cxxtools/demo/pool.cpp, cxxtools/include/cxxtools/dir.h: added missing includes and a missing iterator git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@323 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-03-25 maekitalo * cxxtools/ChangeLog, cxxtools/demo/pool.cpp, cxxtools/include/cxxtools/pool.h, cxxtools/src/Makefile.am: replace semaphore with condition in cxxtools::Pool and make max-size of pool settable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@320 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-03-25 maekitalo * cxxtools/src/multifstream.cpp: add error-checking for glob in cxxtools::multifstreambuf git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@319 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-03-09 maekitalo * cxxtools/src/udpstream.cpp: discard udp-message when error occured git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@318 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-02-21 maekitalo * cxxtools/configure.in: version-number updated to 1.4.3.3 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@316 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-02-20 maekitalo * cxxtools/ChangeLog, cxxtools/src/tcpstream.cpp: fix bug in Stream::write - stream reported eof, when only part of data could be written git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@315 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-02-17 maekitalo * cxxtools/cxxtools-config.in: add commented entry for udp-logging into default properties-file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@314 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-02-13 maekitalo * cxxtools/src/tcpstream.cpp: debug-log listen-backlog-parameter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@313 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-25 maekitalo * cxxtools/ChangeLog: fix typo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@311 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-25 maekitalo * cxxtools/include/cxxtools/syserror.h, cxxtools/src/syserror.cpp: exception-class for system-errors git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@310 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-24 maekitalo * cxxtools/ChangeLog, cxxtools/demo/Makefile.am, cxxtools/demo/README, cxxtools/demo/pipestream.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/fdstream.h, cxxtools/include/cxxtools/fork.h, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/pipe.h, cxxtools/include/cxxtools/pipestream.h, cxxtools/src/Makefile.am, cxxtools/src/fdstream.cpp, cxxtools/src/net.cpp, cxxtools/src/pipe.cpp, cxxtools/src/pipestream.cpp: new wrappers for fork(2) and pipe(2) and a std::iostream on top of pipe(2) new cxxtools::Fdstream: std::iostream for filedescriptors git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@309 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-24 maekitalo * cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/udp.h, cxxtools/include/cxxtools/udpstream.h, cxxtools/src/udp.cpp: support for udp-broadcast git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@308 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-24 maekitalo * cxxtools/src/net.cpp: don't throw exception when connection is closed - report eof instead git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@307 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-15 maekitalo * cxxtools/AUTHORS, cxxtools/ChangeLog, cxxtools/configure.in: minor updates git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@306 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-15 maekitalo * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: Condition::timedwait git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@305 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-15 maekitalo * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: don't try to output current logstatement when exception occurs during createion of log-message git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@304 15ae5fad-cc11-0410-8fac-bce609e504b0 2007-01-15 maekitalo * cxxtools/demo/hd.cpp, cxxtools/include/cxxtools/hdstream.h, cxxtools/src/hdstream.cpp: make offset for hexdump settable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@303 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-12-31 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: fix eof-handling in socket-class look for udp-addrsses instead of tcp in udp-class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@302 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-12-28 maekitalo * cxxtools/ChangeLog, cxxtools/src/udp.cpp: bugfix: initialize length field of peer-adress git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@301 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-12-28 maekitalo * cxxtools/src/log.cpp: log process-id git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@300 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-12-28 maekitalo * cxxtools/include/cxxtools/query_params.h: make constructor of const_iterator explicit git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@299 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-12-08 maekitalo * cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/src/log.cpp: initialization of logger through std::istream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@298 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-28 maekitalo * cxxtools/demo/logsh.cpp: info-messages where not printed at all git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@296 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-27 maekitalo * cxxtools/ChangeLog, cxxtools/include/cxxtools/base64stream.h, cxxtools/src/base64stream.cpp: "putchar" is a macro somewhere - rename member-method to workaround this name-conflict git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@295 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-21 maekitalo * cxxtools/src/log.cpp: make loggers more private and instantiate existing loggers later git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@294 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-21 maekitalo * cxxtools/include/cxxtools/base64stream.h: undef possibly defined macro "putchar" for compatibility with FreeWRT/uClibc++ git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@293 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-20 maekitalo * cxxtools/src/tcpstream.cpp: use char-traits for type-conversion git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@292 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-20 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/src/tcpstream.cpp: fix tcpstream to correctly report end-of-file in all circumstances git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@291 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-11 maekitalo * cxxtools/include/cxxtools/httprequest.h: fix input-parameter: pass strings as const-reference git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@290 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-11-11 maekitalo * cxxtools/src/log.cpp: fixed a bufferoverflow in logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@289 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-09-09 maekitalo * cxxtools/src/dlloader.cpp: add debug-log statements git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@288 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-08-14 maekitalo * cxxtools/ChangeLog: git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@286 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-08-13 maekitalo * cxxtools/include/cxxtools/dynbuffer.h: fix memory-error detected by valgrind: invalid read off buffer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@285 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-08-10 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/iconv.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/iconverter.h, cxxtools/src/Makefile.am: new class cxxtools::IConverter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@284 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-08-10 maekitalo * cxxtools/src/iconvstream.cpp: throw exception, when conversion is not supported git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@283 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-08-10 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/include/Makefile.am, cxxtools/src/Makefile.am, cxxtools/src/iconvstream.cpp: fix iconvstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@282 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-08-10 maekitalo * cxxtools/src/hdstream.cpp, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/log.cpp: use non-locale-specific-functions isalnum, isdigit, ... from instead of git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@281 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-06-29 maekitalo * cxxtools/configure.in: bump version-number to 1.4.2 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@278 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-06-29 maekitalo * cxxtools/autogen.sh: revert last change in autogen.sh - I don't know, why I did it and it seems wrong git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@277 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-06-26 maekitalo * cxxtools/COPYING, cxxtools/ChangeLog, cxxtools/autogen.sh, cxxtools/configure.in, cxxtools/demo/arg-set.cpp, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp, cxxtools/demo/dir.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/getini.cpp, cxxtools/demo/hd.cpp, cxxtools/demo/httprequest.cpp, cxxtools/demo/log.cpp, cxxtools/demo/logbench.cpp, cxxtools/demo/logsh.cpp, cxxtools/demo/md5sum.cpp, cxxtools/demo/multifstream.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/demo/pool.cpp, cxxtools/demo/thread.cpp, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/cgi.h, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/hirestime.h, cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/iniclass.h, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/log/disable.h, cxxtools/include/cxxtools/log/disable_init.h, cxxtools/include/cxxtools/log/log4cplus.h, cxxtools/include/cxxtools/log/log4cplus_init.h, cxxtools/include/cxxtools/log/log4cxx.h, cxxtools/include/cxxtools/log/log4cxx_init.h, cxxtools/include/cxxtools/loginit.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/stopwatch.h, cxxtools/include/cxxtools/streamcounter.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/timeclass.h, cxxtools/include/cxxtools/udp.h, cxxtools/include/cxxtools/udpstream.h, cxxtools/include/cxxtools/xmltag.h, cxxtools/src/base64stream.cpp, cxxtools/src/cgi.cpp, cxxtools/src/dlloader.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/hirestime.cpp, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/log.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/multifstream.cpp, cxxtools/src/net.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/query_params.cpp, cxxtools/src/sudo.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/timeclass.cpp, cxxtools/src/udp.cpp, cxxtools/src/udpstream.cpp, cxxtools/src/xmltag.cpp: license changed to LGPL git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@276 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-06-16 maekitalo * cxxtools/Makefile.am: remove debian-directory from dist-package git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@275 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-06-16 maekitalo * cxxtools/m4/iconv.m4: update to iconv.m4 with copyright-statement git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@274 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-06-16 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/README: updated classname in README don't install log.properties from demo git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@273 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-05-25 maekitalo * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/include/cxxtools/udp.h, cxxtools/src/tcpstream.cpp: delay socket-creation until right type is known git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@272 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-05-23 maekitalo * cxxtools/src/tcpstream.cpp: delay creation of socket in connect until we know the right type git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@271 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-05-23 maekitalo * cxxtools/include/cxxtools/net.h: fixed typo in comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@270 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-05-14 maekitalo * cxxtools/configure.in: version 1.4.1 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@265 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-05-12 maekitalo * cxxtools/src/md5stream.cpp: use memcpy and memset either from namespace std or global namespace git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@264 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-05-09 maekitalo * cxxtools/ChangeLog: git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@262 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/netmsg.cpp, cxxtools/src/net.cpp, cxxtools/src/udp.cpp: fixed socket-creation for udp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@261 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-27 maekitalo * cxxtools/demo/Makefile.am, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: bind IPv4 or IPv6 depending on the adress git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@260 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-26 maekitalo * cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: make use of 0.0.0.0 working again git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@259 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-26 maekitalo * : fix properties git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@258 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-24 maekitalo * cxxtools/demo/Makefile.am, cxxtools/demo/log.properties, cxxtools/demo/netcat.cpp, cxxtools/demo/netecho.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/net.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/udp.h, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: IPv6 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@257 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-19 tommi * cxxtools/debian/changelog, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/src/log.cpp: fix logger-initialization (reinitialize at log_init) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@256 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-16 tommi * cxxtools/demo/log.cpp, cxxtools/demo/thread.cpp, cxxtools/src/thread.cpp: AIX-fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@255 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-16 tommi * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/demo/pool.cpp, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/m4/iconv.m4, cxxtools/src/hdstream.cpp: fixed for AIX-compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@254 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-09 tommi * cxxtools/src/streamcounter.cpp: moved to header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@253 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-07 tommi * cxxtools/include/cxxtools/streamcounter.h, cxxtools/src/Makefile.am: BasicStreamcounter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@252 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-07 tommi * cxxtools/demo/log.properties: [no log message] 2006-04-06 tommi * cxxtools/ChangeLog, cxxtools/src/log.cpp: optimzed formatting of log-messages git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@250 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-05 tommi * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: prevent deadlocks in logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@249 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-05 tommi * cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/include/cxxtools/base64stream.h: [no log message] 2006-04-05 tommi * cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/log.cpp: add locale-parameter to std::is... to improve ANSI-C++-compatibility git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@247 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-04-04 tommi * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/cxxtools.spec, cxxtools/demo/log.properties, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/streamcounter.h, cxxtools/src/Makefile.am, cxxtools/src/log.cpp, cxxtools/src/streamcounter.cpp: flushdelay works now with rolling-files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@246 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-03-21 tommi * cxxtools/include/cxxtools/log/cxxtools.h: remove obsolete call in logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@245 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-03-21 tommi * cxxtools/configure.in: [no log message] 2006-03-04 tommi * cxxtools/debian/changelog: [no log message] 2006-03-03 tommi * cxxtools/ChangeLog: [no log message] 2006-03-03 tommi * cxxtools/src/net.cpp: [no log message] 2006-03-03 tommi * cxxtools/cxxtools-config.in, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/src/log.cpp: new parameter flushdelay git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@239 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-03-01 tommi * cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: added some logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@238 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-23 tommi * cxxtools/include/cxxtools/net.h, cxxtools/src/net.cpp: set right blocking-mode when resetting fd in socket-class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@237 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-23 tommi * cxxtools/include/cxxtools/log/cxxtools.h: changed internal variable-names to prevent naming-conflicts git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@236 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-16 tommi * cxxtools/src/net.cpp: change blocking-state only when the it really changes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@235 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-10 tommi * cxxtools/autogen.sh, cxxtools/configure.in: version 1.4.0 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@234 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-10 tommi * cxxtools/include/cxxtools/thread.h: documentation-updates git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@233 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-02 tommi * cxxtools/src/tcpstream.cpp: don't throw an exception, when the peer closes the connection. This is better handled with eof-condition. git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@232 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-02 tommi * cxxtools/configure.in: version number 1.4.0pre6 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@231 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-02-01 tommi * cxxtools/src/tcpstream.cpp: don't throw exception on socket, which is closed by peer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@230 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-25 tommi * cxxtools/ChangeLog: [no log message] 2006-01-25 tommi * cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: improved error-reporting git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@228 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-25 tommi * cxxtools/configure.in: version 1.4.0pre5 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@227 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-21 tommi * cxxtools/include/cxxtools/pool.h: new method "unsigned pool::getCurrentSize() const" git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@226 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-20 tommi * cxxtools/demo/thread.cpp, cxxtools/include/cxxtools/thread.h: improved thread-interface git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@225 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-20 tommi * cxxtools/demo/log.properties, cxxtools/demo/logbench.cpp, cxxtools/src/log.cpp: optimized logging-output git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@224 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-20 tommi * cxxtools/debian/libcxxtools-dev.install: simplified specification git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@223 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-13 tommi * cxxtools/Makefile.am, cxxtools/cxxtools-config.in, cxxtools/demo/log.cpp, cxxtools/demo/log.properties, cxxtools/demo/netio.cpp, cxxtools/src/log.cpp: logging-categories can contain underscores now git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@222 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-04 tommi * cxxtools/demo/thread.cpp, cxxtools/include/cxxtools/thread.h: thread-interface updated git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@221 15ae5fad-cc11-0410-8fac-bce609e504b0 2006-01-04 tommi * cxxtools/debian/control, cxxtools/debian/libcxxtools-dev.install, cxxtools/debian/libcxxtools-log-dev.install, cxxtools/debian/libcxxtools-log.install: [no log message] 2005-12-31 tommi * cxxtools/include/cxxtools/dlloader.h, cxxtools/src/dlloader.cpp: fix error-reporting git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@219 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-31 tommi * cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: log only debug in network-classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@218 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-31 tommi * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: simplify thread-creation catch exceptions in threads git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@217 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-31 tommi * cxxtools/include/cxxtools/dynbuffer.h: bugfix in Dynbuffer::swap git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@216 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-14 tommi * cxxtools/ChangeLog: [no log message] 2005-12-14 tommi * cxxtools/configure.in, cxxtools/include/cxxtools/net.h, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp: improved error-checking in network-classes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@214 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-11 tommi * cxxtools/configure.in, cxxtools/cxxtools-config.in, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/hirestime.h, cxxtools/src/Makefile.am, cxxtools/src/hirestime.cpp: new class cxxtools::Hirestime removed extra-logging-library git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@213 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-11 tommi * cxxtools/src/tcpstream.cpp: pass timeout-exception git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@212 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-11 tommi * cxxtools/src/tcpstream.cpp: fixed bug when write is unavailable git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@211 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-12-09 tommi * cxxtools/cxxtools-config.in: [no log message] 2005-11-23 tommi * cxxtools/demo/httprequest.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/httpreply.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/Makefile.am, cxxtools/src/httpreply.cpp, cxxtools/src/httprequest.cpp: put HttpRequest and HttpReply into its own files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@209 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-11-13 tommi * cxxtools/configure.in: rename simple logging to cxxtools and make it default git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@207 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-11-08 tommi * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/thread.cpp, cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: cxxtools::Thread split into cxxtools::AttachedThread and cxxtools::DetachedThread git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@203 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-11-04 tommi * cxxtools/src/httprequest.cpp: added missing initializer git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@202 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-26 tommi * cxxtools/cxxtools-config.in: default loglevel changed from WARN to INFO git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@200 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-26 tommi * cxxtools/configure.in: default loglevel changed from WARN to INFO git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@199 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-14 tommi * cxxtools/ChangeLog: [no log message] 2005-10-14 tommi * cxxtools/autogen.sh: m4-macro-directory git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@197 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-14 tommi * cxxtools/m4/iconv.m4: iconv-detection included git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@196 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-14 tommi * cxxtools/src/config.h.in: removed generated file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@195 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-14 tommi * cxxtools/src/udp.cpp: added missing errno.h git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@194 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-10-07 tommi * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/httprequest.cpp: improved httprequest-class git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@193 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-22 tommi * cxxtools/ChangeLog: [no log message] 2005-09-22 tommi * cxxtools/ChangeLog: [no log message] 2005-09-19 tommi * cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/net.h, cxxtools/src/net.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/udp.cpp: timeout-handling in udp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@190 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-18 tommi * cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/udp.h, cxxtools/src/udp.cpp: udp-reply git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@189 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-15 tommi * cxxtools/debian/libcxxtools-dev.install: [no log message] 2005-09-15 tommi * cxxtools/demo/dir.cpp, cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/dir.h: namingconventions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@185 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-08 tommi * cxxtools/src/log.cpp: new feature: rolling file appender git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@184 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-08 tommi * cxxtools/include/cxxtools/arg.h: fixed typo in comment git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@183 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-08 tommi * cxxtools/demo/netio.cpp: -t (buffersize) did not work - fixed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@182 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-09-07 tommi * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: use pthread_detach git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@181 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-19 tommi * cxxtools/src/tcpstream.cpp: added missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@180 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-19 tommi * cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/debian/libcxxtools-dev.install: new Versionnumber 1.4.0pre1 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@179 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-19 tommi * cxxtools/include/cxxtools/log/cxxtools.h: clear errors after logmessage git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@178 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-19 tommi * cxxtools/src/dlloader.cpp: [no log message] 2005-07-19 tommi * cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/udp.h: no exceptions in log-statements git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@176 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-19 tommi * cxxtools/src/udpstream.cpp: missing return-statements git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@175 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-19 tommi * cxxtools/demo/netmsg.cpp, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/udpstream.h, cxxtools/src/Makefile.am, cxxtools/src/log.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/udpstream.cpp: UdpOStream sends at flush git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@174 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-18 tommi * cxxtools/demo/netmsg.cpp: fixed usage-message git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@173 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-18 tommi * cxxtools/demo/logsh.cpp: added missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@172 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-18 tommi * cxxtools/demo/Makefile.am, cxxtools/demo/log.cpp, cxxtools/demo/log.properties, cxxtools/demo/logbench.cpp, cxxtools/demo/logsh.cpp, cxxtools/demo/netmsg.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/udp.h, cxxtools/include/cxxtools/udpstream.h, cxxtools/src/Makefile.am, cxxtools/src/log.cpp, cxxtools/src/udp.cpp: support for udp simple logging through udp git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@171 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-16 tommi * cxxtools/include/cxxtools/net.h, cxxtools/src/net.cpp: [no log message] 2005-07-16 tommi * cxxtools/demo/arg-set.cpp, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/hd.cpp, cxxtools/demo/httprequest.cpp, cxxtools/demo/logbench.cpp, cxxtools/demo/md5sum.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netecho.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/pool.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/cgi.h, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/iniclass.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/stopwatch.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/timeclass.h, cxxtools/include/cxxtools/xmltag.h, cxxtools/src/Makefile.am, cxxtools/src/base64stream.cpp, cxxtools/src/cgi.cpp, cxxtools/src/dlloader.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/httprequest.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/log.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/multifstream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/query_params.cpp, cxxtools/src/sudo.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/timeclass.cpp, cxxtools/src/xmltag.cpp: new naming-conventions git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@169 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-15 tommi * cxxtools/configure.in, cxxtools/src/config.h.in, cxxtools/src/dlloader.cpp: make libtool optional git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@168 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-15 tommi * cxxtools/demo/README: [no log message] 2005-07-10 tommi * cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/{hdstream.cpp => hd.cpp}, cxxtools/include/cxxtools/hdstream.h, cxxtools/src/hdstream.cpp: new version-number 1.3.2pre1 minor fixes in hdstream demo hdstream renamed to hd for easier debugging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@166 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-05 tommi * cxxtools/demo/dlloader.cpp, cxxtools/demo/netcat.cpp, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/tee.h, cxxtools/src/dlloader.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/sudo.cpp: ANSI-fixes git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@165 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-05 tommi * cxxtools/demo/arg-set.cpp, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp, cxxtools/demo/dir.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/getini.cpp, cxxtools/demo/hdstream.cpp, cxxtools/demo/httprequest.cpp, cxxtools/demo/log.cpp, cxxtools/demo/logbench.cpp, cxxtools/demo/md5sum.cpp, cxxtools/demo/multifstream.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netecho.cpp, cxxtools/demo/netio.cpp, cxxtools/demo/pool.cpp: GPL-header added git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@164 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-07-04 tommi * cxxtools/demo/Makefile.am, cxxtools/demo/netcat.cpp, cxxtools/demo/netecho.cpp, cxxtools/demo/netio.cpp, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/src/base64stream.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/tee.cpp: [no log message] 2005-06-18 tommi * cxxtools/debian/changelog: new debian-version-number 1.3.1 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@162 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-06-17 tommi * cxxtools/include/cxxtools/query_params.h: fixed copy-semantic git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@160 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-06-17 tommi * cxxtools/configure.in, cxxtools/include/cxxtools/query_params.h: version 1.3.1 added missing copy-constructor in query_params git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@159 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-04-23 tommi * cxxtools/include/cxxtools/multifstream.h: iterator-Kategorie beim multi_ifstream::pattern_inserter erg��nzt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@158 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-03-06 tommi * cxxtools/include/cxxtools/dlloader.h, cxxtools/src/dlloader.cpp: new method "void* dl::library::getHandle() const" git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@157 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-18 tommi * cxxtools/cxxtools-config.in: new option "--filename" git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@156 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-18 tommi * cxxtools/cxxtools-config.in: print error-message to stderr git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@155 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-18 tommi * cxxtools/src/tcpstream.cpp: bugfix in timeout-handling in write git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@154 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-18 tommi * cxxtools/debian/control, cxxtools/debian/libcxxtools-dev.install, cxxtools/debian/libcxxtools-log-dev.install: [no log message] 2005-02-18 tommi * cxxtools/cxxtools-config.in: Version tagged as 1.3.0 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@152 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-14 tommi * cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: bugfix: errors in ::write were not handled correctly git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@151 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-14 tommi * cxxtools/cxxtools-config.in: added comments in example-propertyfile git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@150 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-12 tommi * cxxtools/configure.in, cxxtools/cxxtools-config.in: "cxxtools-config --property app" prints sample logging-properties-file git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@149 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-09 tommi * cxxtools/src/query_params.cpp: query_params::getUrl was buggy git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@148 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-09 tommi * cxxtools/include/cxxtools/query_params.h: bugfix in query_param::const_iterator::operator- (const_iterator&) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@147 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-03 tommi * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/cxxtools-config.in, cxxtools/data/Makefile.am, cxxtools/demo/Makefile.am, cxxtools/src/Makefile.am, cxxtools/src/tcpstream.cpp: bugfix in timeout-handling git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@146 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-02-03 tommi * cxxtools/include/cxxtools/log/cxxtools.h: bugfix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@145 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-31 tommi * cxxtools/README: [no log message] 2005-01-31 tommi * cxxtools/include/cxxtools/log/log4cplus.h: check, if library is initialized before outputting messages git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@143 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-31 tommi * cxxtools/debian/changelog: new changelog-entry git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@142 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-29 tommi * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: Condition not derived from Mutex git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@141 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-29 tommi * cxxtools/src/tcpstream.cpp: no exceptions in streambuf-methods git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@140 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-28 tommi * cxxtools/src/tcpstream.cpp: Bugfix git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@139 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-28 tommi * cxxtools/src/tcpstream.cpp: simplified Write-method git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@138 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-28 tommi * cxxtools/include/cxxtools/query_params.h: new method clear() git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@137 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-27 tommi * cxxtools/debian/changelog, cxxtools/src/tcpstream.cpp: tcpstream::Write works now with unblocked socket git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@136 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-25 tommi * cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: Timeout-Behandlung ueberarbeitet git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@135 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-23 tommi * cxxtools/configure.in, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/thread.h, cxxtools/src/tcpstream.cpp, cxxtools/src/thread.cpp: some bugfixing, better timeout-handling in tcpstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@134 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-19 tommi * cxxtools/demo/cgi.cpp, cxxtools/include/cxxtools/cgi.h, cxxtools/src/cgi.cpp: bugfixes in cxxtools::xmltag git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@133 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/httprequest.cpp: new class httpreply git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@132 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/demo/httprequest.cpp, cxxtools/include/cxxtools/httprequest.h, cxxtools/src/httprequest.cpp, cxxtools/src/tcpstream.cpp: [no log message] 2005-01-17 tommi * cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/query_params.h, cxxtools/src/httprequest.cpp: add licence-header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@130 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/demo/Makefile.am, cxxtools/demo/httprequest.cpp, cxxtools/demo/netecho.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/httprequest.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/httprequest.cpp: new class httprequest git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@129 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/ChangeLog, cxxtools/src/tcpstream.cpp: use gethostbyname to determine address to listen, so you can specify a hostname as a listener-parameter git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@128 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/include/cxxtools/pollclass.h: make destructor virtual git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@127 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/include/cxxtools/dynbuffer.h: new method swap git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@126 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-17 tommi * cxxtools/data/Makefile.am, cxxtools/debian/libcxxtools-dev.install: build-improvements git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@125 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-14 tommi * cxxtools/demo/Makefile.am, cxxtools/demo/README, cxxtools/demo/cgi.cpp, cxxtools/demo/netcat.cpp, cxxtools/demo/netecho.cpp, cxxtools/demo/run_log: [no log message] 2005-01-13 tommi * cxxtools/configure.in, cxxtools/src/config.h.in: fix for solaris git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@123 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-05 tommi * cxxtools/include/cxxtools/arg.h: [no log message] 2005-01-05 tommi * cxxtools/demo/Makefile.am, cxxtools/demo/arg-set.cpp: new demo-program git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@121 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-05 tommi * cxxtools/debian/changelog: new version-number 1.2.3 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@120 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-05 tommi * cxxtools/ChangeLog, cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/arg.cpp, cxxtools/include/cxxtools/arg.h: support in cxxtools::arg for multiple alternative switches in a single arg-variable (set-method) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@119 15ae5fad-cc11-0410-8fac-bce609e504b0 2005-01-05 tommi * cxxtools/demo/log.cpp: [no log message] 2005-01-05 tommi * cxxtools/src/iconvstream.cpp: added missing header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@117 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-29 tommi * : [no log message] 2004-12-28 tommi * cxxtools/include/cxxtools/log/log4cxx.h: make compatible with log4cxx-0.9.7 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@114 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-28 tommi * cxxtools/debian/changelog: [no log message] 2004-12-27 tommi * cxxtools/demo/Makefile.am: [no log message] 2004-12-27 tommi * cxxtools/demo/log4cplus.properties, cxxtools/demo/log4j.properties: example-files git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@111 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-27 tommi * cxxtools/configure.in, cxxtools/demo/log.cpp, cxxtools/demo/log.properties, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/log/disable.h, cxxtools/include/cxxtools/log/disable_init.h, cxxtools/include/cxxtools/log/log4cplus.h, cxxtools/include/cxxtools/log/log4cplus_init.h, cxxtools/include/cxxtools/log/log4cxx.h, cxxtools/include/cxxtools/log/log4cxx_init.h, cxxtools/src/config.h.in, cxxtools/src/log.cpp: log_trace, log_xxxx_enabled git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@110 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-26 tommi * cxxtools/debian/libcxxtools-log-dev.install, cxxtools/demo/logbench.cpp: [no log message] 2004-12-26 tommi * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/data/Makefile.am, cxxtools/debian/changelog, cxxtools/debian/control, cxxtools/demo/Makefile.am, cxxtools/src/config.h.in: automatic generation of file with linkerflags git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@108 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-26 tommi * cxxtools/include/cxxtools/loginit.h: [no log message] 2004-12-26 tommi * cxxtools/configure.in, cxxtools/demo/Makefile.am, cxxtools/demo/log.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/log/cxxtools.h, cxxtools/include/cxxtools/log/cxxtools_init.h, cxxtools/include/cxxtools/log/disable.h, cxxtools/include/cxxtools/log/disable_init.h, cxxtools/include/cxxtools/log/log4cplus.h, cxxtools/include/cxxtools/log/log4cplus_init.h, cxxtools/include/cxxtools/log/log4cxx.h, cxxtools/include/cxxtools/log/log4cxx_init.h, cxxtools/include/cxxtools/logfwd.h, cxxtools/src/Makefile.am, cxxtools/src/config.h.in, cxxtools/src/log.cpp: select loglibrary at compile-time git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@106 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-25 tommi * cxxtools/configure.in, cxxtools/demo/log.cpp, cxxtools/demo/logbench.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/log.h, cxxtools/src/config.h.in, cxxtools/src/log.cpp: support for log4cxx git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@105 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-20 tommi * cxxtools/configure.in, cxxtools/demo/log.cpp, cxxtools/demo/log.properties, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/logfwd.h, cxxtools/src/config.h.in, cxxtools/src/log.cpp: support for log4cxx git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@104 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-16 tommi * cxxtools/demo/arg.cpp, cxxtools/include/cxxtools/arg.h: specialization for std::string git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@103 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-16 tommi * cxxtools/configure.in, cxxtools/debian/changelog: new version-number 1.2.2 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@102 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-16 tommi * cxxtools/test/Makefile.am, cxxtools/test/inifile.cpp: missing files added git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@101 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-13 tommi * cxxtools/debian/control: [no log message] 2004-12-13 tommi * cxxtools/include/cxxtools/arg.h: comment translated from german to english git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@99 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-05 tommi * cxxtools/include/cxxtools/logfwd.h: added missing log_declare- and log_delcare_class-macros in cxxtools-logger git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@98 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-05 tommi * cxxtools/include/cxxtools/log.h: added missing include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@97 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-05 tommi * cxxtools/include/cxxtools/log.h, cxxtools/src/log.cpp: fixed log_trace for cxxtools-logger git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@96 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-05 tommi * cxxtools/src/log.cpp: fixed typeconversion git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@95 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-05 tommi * cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/demo/Makefile.am, cxxtools/demo/log.cpp, cxxtools/demo/log.properties, cxxtools/demo/logbench.cpp, cxxtools/demo/run_log, cxxtools/include/cxxtools/log.h, cxxtools/src/config.h.in, cxxtools/src/log.cpp: lightweight logging-library as a alternative for log4cplus git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@94 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-03 tommi * cxxtools/demo/log.cpp, cxxtools/include/cxxtools/log.h, cxxtools/src/log.cpp: bugfixes in stdout-logger git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@93 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-03 tommi * : [no log message] 2004-12-03 tommi * cxxtools/include/cxxtools/log.h, cxxtools/src/log.cpp: fixed logging to stdout git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@91 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-03 tommi * cxxtools/demo/Makefile.am: shell-script run_log added git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@90 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-03 tommi * cxxtools/demo/log.cpp, cxxtools/demo/log.properties, cxxtools/demo/run_log: demo-programm for logging git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@89 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-03 tommi * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/debian/control, cxxtools/debian/cxxtools-dev.install, cxxtools/debian/libcxxtools-dev.install, cxxtools/debian/libcxxtools-log-dev.install, cxxtools/debian/libcxxtools-log.install, cxxtools/debian/{cxxtools.install => libcxxtools.install}, cxxtools/demo/Makefile.am, cxxtools/doc/Doxyfile, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/config.h.in, cxxtools/include/cxxtools/log.h, cxxtools/include/cxxtools/logfwd.h, cxxtools/src/Makefile.am, cxxtools/src/config.h.in, cxxtools/src/log.cpp: added log4cplus/log4cxx-wrapper git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@88 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-03 tommi * cxxtools/include/cxxtools/config.h.in: configvars needed in headers git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@87 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-12-02 tommi * cxxtools/Makefile.am, cxxtools/autogen.sh, cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/demo/Makefile.am, cxxtools/demo/dlloader.cpp, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/Makefile.am, cxxtools/src/config.h.in, cxxtools/src/dlloader.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/tcpstream.cpp: * removed obsolete timeclass.cpp * ported to FreeBSD * use libtool for dynamic loading for improved portability git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@86 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-25 tommi * cxxtools/demo/Makefile.am, cxxtools/demo/README, cxxtools/include/cxxtools/cgi.h, cxxtools/src/cgi.cpp: [no log message] 2004-11-25 tommi * cxxtools/ChangeLog: [no log message] 2004-11-25 tommi * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/demo/arg.cpp, cxxtools/demo/cgi.cpp, cxxtools/demo/dir.cpp, cxxtools/demo/dlloader.cpp, cxxtools/demo/dynbuffer.cpp, cxxtools/demo/getini.cpp, cxxtools/demo/hdstream.cpp, cxxtools/demo/md5sum.cpp, cxxtools/{test => demo}/multifstream.cpp, cxxtools/demo/pool.cpp, cxxtools/include/Makefile.am, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/iniclass.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/trace.h, cxxtools/src/Makefile.am, cxxtools/src/base64stream.cpp, cxxtools/src/dlloader.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/multifstream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/query_params.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/test/Makefile, cxxtools/test/hdstreamtest.cpp, cxxtools/test/md5test.cpp: * all classes moved to namespace cxxtools * documentation-updates git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@82 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-25 tommi * cxxtools/configure.in: Versionsnummer 1.1.3 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@80 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-14 tommi * cxxtools/doc/Doxyfile, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/base64stream.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/query_params.h: Doxygen-Dokumentation git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@79 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-12 tommi * cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/debian/control: [no log message] 2004-11-12 tommi * cxxtools/include/cxxtools/base64stream.h, cxxtools/src/base64stream.cpp: bug in end-handling of decoder fixed git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@77 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-08 tommi * cxxtools/include/cxxtools/dynbuffer.h, cxxtools/src/Makefile.am, cxxtools/src/dynbuffer.cpp: dynbuffer hat jetzt einen template-Parameter DynBuffer ist nur noch ein typedef git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@75 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-08 tommi * cxxtools/include/cxxtools/base64stream.h, cxxtools/src/base64stream.cpp: end() wird jetzt vom Destruktor aufgerufen, wenn noch nicht geschehen git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@74 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-08 tommi * cxxtools/include/cxxtools/md5stream.h, cxxtools/src/md5stream.cpp: Auslesen der MD5-Summe ist jetzt mehrfach m�glich. Bisher hat ein Auslesen die Summe zerst�rt. git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@73 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-05 tommi * cxxtools/Makefile.am, cxxtools/debian/compat, cxxtools/debian/copyright, cxxtools/debian/cxxtools-dev.dirs, cxxtools/debian/cxxtools-dev.files, cxxtools/debian/cxxtools-dev.install, cxxtools/debian/cxxtools.dirs, cxxtools/debian/cxxtools.files, cxxtools/debian/cxxtools.install, cxxtools/debian/dirs, cxxtools/debian/docs, cxxtools/debian/rules: Fehler bei der Debian-packetierung korrigiert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@72 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/debian/changelog, cxxtools/debian/rules: Version 1.1.2 git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@71 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/src/base64stream.cpp: Fehler im include git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@70 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/configure.in, cxxtools/debian/changelog: new class base64stream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@69 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/debian/cxxtools.files: [no log message] 2004-11-03 tommi * cxxtools/Makefile.am: debian/compat entfernt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@67 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/include/cxxtools/base64stream.h, cxxtools/src/base64stream.cpp: added copyright-header git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@66 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/include/Makefile.am, cxxtools/include/cxxtools/base64stream.h, cxxtools/src/base64stream.cpp: new class base64stream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@65 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-11-03 tommi * cxxtools/autogen.sh, cxxtools/src/Makefile.am: helper-script git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@64 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-10-26 tommi * cxxtools/src/Makefile.am: fehlende Datei multifstream.cpp ergaenzt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@63 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-10-18 tommi * cxxtools/doc/html/annotated.html, cxxtools/doc/html/arg_8h-source.html, cxxtools/doc/html/classarg-members.html, cxxtools/doc/html/classarg.html, cxxtools/doc/html/classarg_3_01bool_01_4-members.html, cxxtools/doc/html/classarg_3_01bool_01_4.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_01_4-members.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_01_4.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_4-members.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_4.html, cxxtools/doc/html/classtcp_1_1Exception-members.html, cxxtools/doc/html/classtcp_1_1Exception.html, cxxtools/doc/html/classtcp_1_1Server-members.html, cxxtools/doc/html/classtcp_1_1Server.html, cxxtools/doc/html/classtcp_1_1Socket-members.html, cxxtools/doc/html/classtcp_1_1Socket.html, cxxtools/doc/html/classtcp_1_1Stream-members.html, cxxtools/doc/html/classtcp_1_1Stream.html, cxxtools/doc/html/classtcp_1_1eof-members.html, cxxtools/doc/html/classtcp_1_1eof.html, cxxtools/doc/html/classtcp_1_1iostream-members.html, cxxtools/doc/html/classtcp_1_1iostream.html, cxxtools/doc/html/classtcp_1_1streambuf-members.html, cxxtools/doc/html/classtcp_1_1streambuf.html, cxxtools/doc/html/doxygen.css, cxxtools/doc/html/files.html, cxxtools/doc/html/functions.html, cxxtools/doc/html/hierarchy.html, cxxtools/doc/html/index.html, cxxtools/doc/html/iniclass_8h-source.html, cxxtools/doc/html/tcpstream_8h-source.html, cxxtools/doc/html/timeclass_8h-source.html: generated files - remove from CVS git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@62 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-10-18 tommi * cxxtools/ChangeLog, cxxtools/NEWS: files required by automake git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@61 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-10-18 tommi * cxxtools/configure.in, cxxtools/include/Makefile.am, cxxtools/src/config.h.in: improved autoconfiguration git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@60 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-10-05 tommi * cxxtools/configure.in: Pr�fung auf gcc-3.0 und g++-3.0 f�r debian-woody git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@59 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-10-05 tommi * cxxtools/{COPYRIGHT => COPYING}, cxxtools/Makefile, cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/debian/README.Debian, cxxtools/debian/changelog, cxxtools/debian/control, cxxtools/debian/copyright, cxxtools/debian/cxxtools-dev.files, cxxtools/debian/cxxtools-dev.install, cxxtools/debian/cxxtools.install, cxxtools/debian/docs, cxxtools/debian/rules, cxxtools/include/Makefile, cxxtools/src/Makefile: Build jetzt mit libtool/autoconf/automake git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@58 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-09-30 tommi * cxxtools/debian/cxxtools-dev.install: [no log message] 2004-09-24 tommi * cxxtools/cxxtools.spec: [no log message] 2004-09-21 tommi * cxxtools/configure.in, cxxtools/debian/changelog, cxxtools/src/Makefile: Versionsnummer auf 1.1 geaendert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@55 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-09-16 tommi * cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: noch eine socklen_t-Variable entfernt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@54 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-09-16 tommi * cxxtools/include/cxxtools/tcpstream.h: unbenutzte Variable servaddr_len gel��scht git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@53 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-09-13 tommi * cxxtools/AUTHORS, cxxtools/COPYRIGHT, cxxtools/README, cxxtools/cxxtools.spec, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/dir.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/iconvstream.h, cxxtools/include/cxxtools/iniclass.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/multifstream.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/stopwatch.h, cxxtools/include/cxxtools/sudo.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/timeclass.h, cxxtools/include/cxxtools/trace.h, cxxtools/src/dlloader.cpp, cxxtools/src/dynbuffer.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/md5stream.cpp, cxxtools/src/multifstream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/query_params.cpp, cxxtools/src/sudo.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/timeclass.cpp: GNU Copyright erg��nzt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@52 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-08-30 tommi * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: start-Routine jetzt Statische Methode von Thread Run-Methode ist protected git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@51 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-08-19 tommi * cxxtools/src/tcpstream.cpp: Verbesserung in der Fehlerbehandlung beim lesen vom Stream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@50 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-08-06 tommi * cxxtools/include/cxxtools/sudo.h, cxxtools/src/Makefile, cxxtools/src/sudo.cpp: neue Funktion 'sudo' zum ausf�hren von Funktionen unter einer anderen Benutzerkennung (Aufruf nur f�r Benutzer 'root' erlaubt) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@49 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-07-12 tommi * cxxtools/include/cxxtools/thread.h: FunctionThread ist jetzt kompilierbar git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@48 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-07-12 tommi * cxxtools/include/cxxtools/arg.h: Templatedeklaration korrigiert (gcc 3.4.1 hat es korrekterweise bem��ngelt) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@47 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-07-11 tommi * cxxtools/include/cxxtools/arg.h: Der Wert wird in arg auf 0 initialisiert, wenn er nicht gesetzt ist git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@46 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-07-11 tommi * cxxtools/include/cxxtools/dlloader.h: Bibliotheken werden jetzt standardmaessig mit dem Flag RTLD_GLOBAL geladen git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@45 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-06-21 tommi * cxxtools/include/cxxtools/arg.h: Default-Parameterwert bei arg auf 0 gesetzt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@44 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-06-14 tommi * cxxtools/test/Makefile, cxxtools/test/multifstream.cpp: Testprogramm f�r neue Klasse multi_ifstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@43 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-06-14 tommi * cxxtools/test/pooltest.cpp: fehlendes #include erg�nzt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@42 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-06-14 tommi * cxxtools/src/multifstream.cpp: segfault, wenn keine Dateien gefunden wurden korrigiert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@41 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-06-14 tommi * cxxtools/debian/cxxtools-dev.files: Include-Dateien wurden nicht installiert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@40 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-06-14 tommi * cxxtools/include/cxxtools/multifstream.h, cxxtools/src/Makefile, cxxtools/src/multifstream.cpp: neue Klasse multi_ifstream git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@39 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-05-26 tommi * cxxtools/cxxtools.spec: Spec-file zur Generierung von RPM-Paketen (getestet mit SuSE-9.1/x86_64) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@38 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-05-25 tommi * cxxtools/Makefile, cxxtools/debian/rules, cxxtools/include/Makefile: [no log message] 2004-05-25 tommi * cxxtools/src/Makefile: vereinfachte Installation in alternatives Zielverzeichnis Standard ist /usr/local/... git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@36 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-05-24 tommi * cxxtools/Makefile, cxxtools/include/Makefile, cxxtools/make/cxxtools.mk, cxxtools/src/Makefile, cxxtools/src/dlloader.cpp, cxxtools/src/dynbuffer.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/iconvstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/md5.c, cxxtools/src/md5stream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/query_params.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/timeclass.cpp: vereinfachtes Buildsystem git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@35 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-05-24 tommi * cxxtools/include/cxxtools/arg.h: Nichtoptionsargumente k�nnen jetzt geparst werden git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@34 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-05-24 tommi * cxxtools/include/cxxtools/tcpstream.h: Server gibt jetzt Informationen zum Peer her Datentyp f�r port ist jetzt unsigned git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@33 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-05-24 tommi * cxxtools/include/cxxtools/query_params.h: neue Methode addret git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@32 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-04-14 tommi * cxxtools/Makefile.am, cxxtools/configure.in, cxxtools/src/Makefile.am: Autoconf/Automake Dateien git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@31 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-29 tommi * cxxtools/include/cxxtools/dir.h: neue Klasse: iterator-Interface zum Dateiverzeichnis git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@30 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-26 piotr * cxxtools/debian/README.Debian, cxxtools/debian/changelog, cxxtools/debian/control, cxxtools/debian/copyright, cxxtools/debian/cxxtools-dev.dirs, cxxtools/debian/cxxtools-dev.files, cxxtools/debian/cxxtools.dirs, cxxtools/debian/cxxtools.install, cxxtools/debian/dirs, cxxtools/debian/docs, cxxtools/debian/rules: Erste Version git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@29 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-26 piotr * cxxtools/Makefile: An Paketbildung angepa�t install um install_bin und install_sdk erg�nzt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@28 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-24 tommi * cxxtools/src/iconvstream.cpp: iconvstreambuf::sync ruft jetzt flush auf das Ziel auf git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@27 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-24 tommi * cxxtools/include/cxxtools/iconvstream.h, cxxtools/src/Makefile, cxxtools/src/iconvstream.cpp: neue Klasse: iconvstream ist ein std::ostream f�r den iconv(3)-Aufruf (Unix98) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@26 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-24 tommi * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: Condition ist jetzt von Mutex abgeleitet git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@25 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-23 istvan * cxxtools/Makefile: debian build git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@24 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-19 tommi * cxxtools/include/cxxtools/pool.h: �berfl�ssige Konvertieroperatoren entfernt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@23 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-18 tommi * cxxtools/include/cxxtools/pool.h: const hat beim Konvertieroperator gefehlt git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@22 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-18 tommi * cxxtools/src/Makefile: c++-Programme mit -O2 �bersetzen git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@21 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-18 tommi * cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/src/md5.c: Namenskonflikt mit openssl-Bibliothek umgangen git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@20 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-18 istvan * cxxtools/include/cxxtools/query_params.h, cxxtools/src/Makefile: fserv git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@19 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-17 tommi * cxxtools/include/cxxtools/thread.h, cxxtools/src/thread.cpp: neue Klasse Condition git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@18 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-11 tommi * cxxtools/src/Makefile: ben�tigte Bibliotheken libdl und libpthread werden jetzt mit der shared-library gebunden, so da� sie nicht mehr bei der Verwendung von cxxtools angegeben werden m�ssen git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@17 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-11 tommi * cxxtools/include/cxxtools/query_params.h: query_params::add und query_params::ret liefern jetzt *this zur�ck git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@16 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-03-03 tommi * cxxtools/include/cxxtools/query_params.h: Variablennamen korrigiert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@15 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-19 tommi * cxxtools/include/cxxtools/query_params.h, cxxtools/src/query_params.cpp, cxxtools/test/cgitest.cpp, cxxtools/test/hdstreamtest.cpp, cxxtools/test/md5test.cpp, cxxtools/test/pooltest.cpp, cxxtools/test/query_params_it.cpp, cxxtools/test/query_params_test.cpp: Parent-Objekt kann zum lesen unsichtbar sein git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@14 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-18 tommi * cxxtools/include/cxxtools/query_params.h: neue Methode "bool query_params::hasParent()" git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@13 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-16 tommi * cxxtools/include/cxxtools/tcpstream.h: Stream::Stream(int fd) implementiert (inline) git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@12 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-09 istvan * cxxtools/src/Makefile: libbuild git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@11 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-09 istvan * cxxtools/src/Makefile: libbuild git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@10 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-09 tommi * cxxtools/include/cxxtools/tcpstream.h, cxxtools/src/tcpstream.cpp: Konstruktor ohne Parameter der Klasse tcp::iostream ruft nicht mehr ::socket auf git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@9 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-06 istvan * cxxtools/src/Makefile: dependenies revisited git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@8 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-02-06 istvan * cxxtools/Makefile, cxxtools/make/cxxtools.mk, cxxtools/src/Makefile: depend revisited git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@7 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-01-30 tommi * cxxtools/include/cxxtools/query_params.h: operator[] nachgebessert git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@6 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-01-28 istvan * cxxtools/Makefile, cxxtools/doc/html/annotated.html, cxxtools/doc/html/arg_8h-source.html, cxxtools/doc/html/classarg-members.html, cxxtools/doc/html/classarg.html, cxxtools/doc/html/classarg_3_01bool_01_4-members.html, cxxtools/doc/html/classarg_3_01bool_01_4.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_01_4-members.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_01_4.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_4-members.html, cxxtools/doc/html/classarg_3_01const_01char_01_5_4.html, cxxtools/doc/html/classtcp_1_1Exception-members.html, cxxtools/doc/html/classtcp_1_1Exception.html, cxxtools/doc/html/classtcp_1_1Server-members.html, cxxtools/doc/html/classtcp_1_1Server.html, cxxtools/doc/html/classtcp_1_1Socket-members.html, cxxtools/doc/html/classtcp_1_1Socket.html, cxxtools/doc/html/classtcp_1_1Stream-members.html, cxxtools/doc/html/classtcp_1_1Stream.html, cxxtools/doc/html/classtcp_1_1eof-members.html, cxxtools/doc/html/classtcp_1_1eof.html, cxxtools/doc/html/classtcp_1_1iostream-members.html, cxxtools/doc/html/classtcp_1_1iostream.html, cxxtools/doc/html/classtcp_1_1streambuf-members.html, cxxtools/doc/html/classtcp_1_1streambuf.html, cxxtools/doc/html/doxygen.css, cxxtools/doc/html/files.html, cxxtools/doc/html/functions.html, cxxtools/doc/html/hierarchy.html, cxxtools/doc/html/index.html, cxxtools/doc/html/iniclass_8h-source.html, cxxtools/doc/html/tcpstream_8h-source.html, cxxtools/doc/html/timeclass_8h-source.html, cxxtools/include/cxxtools/arg.h, cxxtools/include/cxxtools/dlloader.h, cxxtools/include/cxxtools/doxygen.cfg, cxxtools/include/cxxtools/dynbuffer.h, cxxtools/include/cxxtools/hdstream.h, cxxtools/include/cxxtools/iniclass.h, cxxtools/include/cxxtools/md5.h, cxxtools/include/cxxtools/md5stream.h, cxxtools/include/cxxtools/pollclass.h, cxxtools/include/cxxtools/pool.h, cxxtools/include/cxxtools/query_params.h, cxxtools/include/cxxtools/stopwatch.h, cxxtools/include/cxxtools/tcpstream.h, cxxtools/include/cxxtools/tee.h, cxxtools/include/cxxtools/thread.h, cxxtools/include/cxxtools/timeclass.h, cxxtools/include/cxxtools/trace.h, cxxtools/make/cxxtools.mk, cxxtools/src/Makefile, cxxtools/src/dlloader.cpp, cxxtools/src/dynbuffer.cpp, cxxtools/src/hdstream.cpp, cxxtools/src/iniclass.cpp, cxxtools/src/md5.c, cxxtools/src/md5stream.cpp, cxxtools/src/pollclass.cpp, cxxtools/src/query_params.cpp, cxxtools/src/tcpstream.cpp, cxxtools/src/tee.cpp, cxxtools/src/thread.cpp, cxxtools/src/timeclass.cpp, cxxtools/test/Makefile, cxxtools/test/cgitest.cpp, cxxtools/test/hdstreamtest.cpp, cxxtools/test/md5test.cpp, cxxtools/test/pooltest.cpp, cxxtools/test/query_params_it.cpp, cxxtools/test/query_params_test.cpp: Initial revision git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@2 15ae5fad-cc11-0410-8fac-bce609e504b0 2004-01-28 (no author) <(no author)@15ae5fad-cc11-0410-8fac-bce609e504b0> * New repository initialized by cvs2svn. git-svn-id: svn://svn.code.sf.net/p/cxxtools/code/trunk@1 15ae5fad-cc11-0410-8fac-bce609e504b0 cxxtools-3.0/COPYING0000664000175000017500000005750613644433072011240 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS cxxtools-3.0/src/0000775000175000017500000000000013672344760011045 500000000000000cxxtools-3.0/src/fileimpl.cpp0000664000175000017500000001504113644433072013265 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fileimpl.h" #include "error.h" #include "cxxtools/ioerror.h" #include "cxxtools/systemerror.h" #include #include #include #include #include #include #include #include "config.h" #if defined(HAVE_SENDFILE) && defined(HAVE_SYS_SENDFILE_H) #include #endif namespace cxxtools { namespace { // EACCES Permission denied. // EMFILE Too many file descriptors in use by process. // ENOENT Directory does not exist, or name is an empty string. // ENOTDIR name is not a directory. // EBUSY pathname is currently in use by the system or some process that prevents its removal. // EFAULT pathname points outside your accessible address space. // EINVAL pathname has . as last component. // ELOOP Too many symbolic links were encountered in resolving pathname. // ENAMETOOLONG pathname was too long. // ENOMEM Insufficient kernel memory was available. // ENOTEMPTY pathname contains entries other than . and .. ; or, pathname has .. as its final component. // EPERM The directory containing pathname has the sticky bit (S_ISVTX) set // EPERM The filesystem containing pathname does not support the removal of directories. // EROFS pathname refers to a file on a read-only filesystem. void throwErrno(const char* fn, const std::string& path) { if(errno == EEXIST) throw AccessFailed(path); switch(errno) { case EIO: case EBADF: case EBUSY: case ENOSPC: case EMLINK: case ENOTEMPTY: case EXDEV: throw IOError(getErrnoString(errno)); case EACCES: case EPERM: case EROFS: case ENXIO: throw PermissionDenied(path); case ELOOP: case ENAMETOOLONG: case ENOENT: case ENOTDIR: case EISDIR: throw FileNotFound(path); case ENODEV: throw DeviceNotFound(path); case ENOMEM: throw std::bad_alloc(); default: // EFAULT EMFILE EOVERFLOW throw SystemError(fn); } } void throwFileErrno(const char* fn, const std::string& path) { switch(errno) { case ELOOP: case ENAMETOOLONG: case ENOENT: case ENOTDIR: case EISDIR: throw FileNotFound(path); default: throwErrno(fn, path); } } } std::size_t FileImpl::size(const std::string& path) { struct stat buff; if( 0 != stat(path.c_str(), &buff) ) { throwFileErrno("stat", path); } return buff.st_size; } void FileImpl::resize(const std::string& path, std::size_t newSize) { int ret = 0; do { ret = truncate(path.c_str(), newSize); } while ( ret == EINTR ); if(ret != 0) throwFileErrno("truncate", path); } void FileImpl::remove(const std::string& path) { if(0 != ::remove(path.c_str())) throwFileErrno("remove", path); } void FileImpl::move(const std::string& path, const std::string& to) { if( 0 != ::rename(path.c_str(), to.c_str()) ) throwFileErrno("rename", path); } void FileImpl::link(const std::string& path, const std::string& to) { if( 0 != ::link(path.c_str(), to.c_str()) ) throwFileErrno("link", path); } void FileImpl::symlink(const std::string& path, const std::string& to) { if( 0 != ::symlink(path.c_str(), to.c_str()) ) throwFileErrno("symlink", path); } void FileImpl::copy(const std::string& path, const std::string& to) { int srcFd = -1; int dstFd = -1; try { srcFd = ::open(path.c_str(), O_RDWR|O_EXCL, 0777); if( srcFd < 0 ) throwFileErrno("open", path); dstFd = ::open(to.c_str(), O_WRONLY|O_EXCL|O_CREAT, 0777); if( dstFd < 0 ) throwFileErrno("open", to); #if defined(HAVE_SENDFILE) && defined(HAVE_SYS_SENDFILE_H) struct stat buff; if( fstat(srcFd, &buff) != 0 ) throwFileErrno("stat", path); while (::sendfile(dstFd, srcFd, 0, buff.st_size) == -1) { if (errno != EINTR) throwFileErrno("sendfile", path); } #else char buffer[8192]; while (true) { ssize_t n = ::read(srcFd, buffer, sizeof(buffer)); if (n == 0) break; if (n < 0) { if (errno == EINTR) continue; throwFileErrno("read", path); } const char* p = buffer; do { ssize_t nn = ::write(dstFd, p, n); if (nn < 0) { if (errno == EINTR) continue; throwFileErrno("write", to); } p += nn; n -= nn; } while (n > 0); } #endif ::close(srcFd); ::close(dstFd); } catch (...) { if (srcFd != -1) ::close(srcFd); if (dstFd != -1) ::close(dstFd); throw; } } void FileImpl::create(const std::string& path) { int fd = ::open(path.c_str(), O_RDWR|O_EXCL|O_CREAT, 0777); if( fd < 0 ) throwFileErrno("open", path); ::close(fd); } } cxxtools-3.0/src/char.cpp0000664000175000017500000014070013644433072012402 00000000000000/* * Copyright (C) 2005-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/char.h" #include "cxxtools/string.h" #include "cxxtools/utf8codec.h" #include #ifdef CXXTOOLS_WITH_STD_LOCALE #include "facets.cpp" namespace std { std::locale::id ctype::id; #if (defined _MSC_VER || defined __QNX__ || defined __xlC__) ctype::ctype(size_t refs) : ctype_base(refs) { } #else ctype::ctype(size_t refs) : locale::facet(refs) { } #endif ctype::~ctype() { } bool ctype::do_is(mask m, cxxtools::Char c) const { return (m & ctypeMask(c)) != 0; } const cxxtools::Char* ctype::do_is(const cxxtools::Char* begin, const cxxtools::Char* end, mask* vec) const { for( ; begin < end; ++begin) { *vec = ctypeMask(*begin); ++vec; } return end; } const cxxtools::Char* ctype::do_scan_is(mask m, const cxxtools::Char* begin, const cxxtools::Char* end) const { while( begin != end && !is(m,*begin)) { ++begin; } return begin; } const cxxtools::Char* ctype::do_scan_not(mask m, const cxxtools::Char* begin, const cxxtools::Char* end) const { while( begin != end && is(m,*begin)) { ++begin; } return begin; } cxxtools::Char ctype::do_toupper(cxxtools::Char ch) const { return toupper(ch); } const cxxtools::Char* ctype::do_toupper(cxxtools::Char* begin, const cxxtools::Char* end) const { for(; begin < end; ++begin) { *begin = do_toupper(*begin); } return end; } cxxtools::Char ctype::do_tolower(cxxtools::Char ch) const { return tolower(ch); } const cxxtools::Char* ctype::do_tolower(cxxtools::Char* begin, const cxxtools::Char* end) const { for(; begin < end; ++begin) { *begin = do_tolower(*begin); } return end; } cxxtools::Char ctype::do_widen(char ch) const { return cxxtools::Char(ch); } const char* ctype::do_widen(const char* begin, const char* end, cxxtools::Char* dest) const { for(const char* cur = begin; cur < end; ++cur) { *dest = do_widen(*cur); ++dest; } return end; } char ctype::do_narrow(cxxtools::Char ch, char dfault) const { return ch.narrow(dfault); } const cxxtools::Char* ctype::do_narrow(const cxxtools::Char* begin, const cxxtools::Char* end, char dfault, char* dest) const { for(const cxxtools::Char* cur = begin; cur < end; ++cur) { *dest = do_narrow(*cur, dfault); ++dest; } return end; } } // namespace std #endif namespace cxxtools { std::ostream& operator<< (std::ostream& out, Char ch) { Utf8Codec codec; char to[16]; MBState state; Utf8Codec::result r; const Char* from_next; char* to_next = to; r = codec.out(state, &ch, &ch + 1, from_next, to, to + sizeof(to), to_next); if (r == Utf8Codec::error) { out.setstate(std::ios::failbit); } else { out.write(to, to_next - to); } return out; } const unsigned short ctype_lookup1[69] = { 0, 104, 169, 257, 385, 402, 402, 498, 626, 626, 677, 755, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 883, 402, 402, 402, 1011, 1011, 1011, 1012, 1011, 1011, 1011, 1012, 0 }; const unsigned short ctype_lookup2[1141] = { 0, 127, 255, 382, 502, 582, 710, 837, 965, 1091, 1219, 1339, 1467, 1580, 1708, 1836, 1886, 1886, 2013, 2140, 2267, 2394, 2521, 2647, 2774, 2900, 3026, 3152, 3279, 3406, 3534, 3662, 3790, 3886, 4014, 4069, 4197, 4318, 4431, 4556, 4683, 4684, 4684, 4684, 4703, 4831, 4959, 5087, 5215, 5343, 5471, 5588, 1886, 1886, 1886, 1886, 1886, 1886, 5716, 1886, 5844, 5950, 6078, 6206, 6334, 6462, 6590, 6714, 6830, 6830, 6958, 7083, 7211, 7311, 7439, 7512, 7640, 7768, 7895, 8013, 7439, 7439, 6830, 8138, 6830, 6830, 8266, 1886, 1886, 1886, 1886, 1886, 1886, 8394, 7439, 8424, 8552, 8657, 8785, 8898, 9026, 9154, 7439, 7439, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9282, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9410, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9538, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9666, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 4684, 4684, 10050, 1886, 10178, 10256, 4684, 4684, 10339, 10451, 10579, 10697, 10825, 10938, 11066, 11194, 11322, 1886, 1886, 1886, 11450, 11578, 11706, 11804, 1886, 1886, 1886, 1886, 1886, 1886, 11932, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 7439, 12060, 12188, 12313, 1886, 1886, 12441, 1886, 12569, 12695, 12819, 12941, 12965, 13083, 13153, 13223, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 13351, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 4684, 4684, 4684, 4684, 13408, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 13535, 1886, 13663, 13679, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 13807, 0 }; #include "unicode.h" const unsigned short upper_lookup1[69]= { 0, 74, 74, 76, 203, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 0 }; const unsigned short upper_lookup2[332]= { 0, 123, 251, 379, 499, 627, 686, 770, 894, 1020, 1147, 1268, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1402, 1508, 1636, 1764, 1275, 1275, 1880, 1275, 1275, 1275, 1275, 1275, 1275, 2008, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 32, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 2114, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275,0 }; const short upper_data[2243]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 0, -32, -32, -32, -32, -32, -32, -32, 121, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -232, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, -300, 0, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 97, 0, 0, 0, -1, 0, 0, 0, 0, 130, 0, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 56, 0, 0, 0, 0, 0, -1, -2, 0, -1, -2, 0, -1, -2, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -79, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, -2, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, -206, 0, -205, -205, 0, -202, 0, -203, 0, 0, 0, 0, -205, 0, 0, -207, 0, 0, 0, 0, -209, -211, 0, 0, 0, 0, 0, -211, 0, 0, -213, 0, 0, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -218, 0, 0, -218, 0, 0, 0, 0, -218, 0, -217, -217, 0, 0, 0, 0, 0, 0, -219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, -37, -37, -37, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -31, -32, -32, -32, -32, -32, -32, -32, -32, -32, -64, -63, -63, 0, -62, -57, 0, 0, 0, -47, -54, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -86, -80, 7, 0, 0, -96, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 8, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 74, 74, 86, 86, 86, 86, 100, 100, 128, 128, 112, 112, 126, 126, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7205, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; const unsigned short lower_lookup1[69]= { 0, 74, 74, 76, 203, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 7, 0 }; const unsigned short lower_lookup2[332]= { 0, 91, 219, 346, 466, 517, 517, 639, 767, 893, 1021, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 1149, 1255, 1376, 1496, 517, 517, 1621, 517, 517, 517, 517, 517, 517, 1733, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 1828, 517, 517, 517, 517, 517, 517, 517, 517, 1956, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 0 }; const short lower_data[2085]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -199, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -121, 1, 0, 1, 0, 1, 0, 0, 210, 1, 0, 1, 0, 206, 1, 0, 205, 205, 1, 0, 0, 79, 202, 203, 1, 0, 205, 207, 0, 211, 209, 1, 0, 0, 0, 211, 213, 0, 214, 1, 0, 1, 0, 1, 0, 218, 1, 0, 218, 0, 0, 1, 0, 218, 1, 0, 217, 217, 1, 0, 1, 0, 219, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 2, 1, 0, 1, 0, -97, -56, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -130, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 37, 37, 37, 0, 64, 0, 63, 63, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -60, 0, 0, 1, 0, -7, 1, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, -8, 0, -8, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -74, -74, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -86, -86, -86, -86, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -100, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -112, -112, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, -128, -126, -126, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7517, 0, 0, 0, -8383, -8262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Char tolower(const cxxtools::Char& ch) { const cxxtools::Char::value_type ucs = ch.value(); return Char(ucs + lower_data[lower_lookup2[lower_lookup1[ucs>>14]+((ucs>>7)&127)]+(ucs&127)]); } Char toupper(const Char& ch) { const cxxtools::Char::value_type ucs = ch.value(); return Char(ucs + upper_data[upper_lookup2[upper_lookup1[ucs>>14]+((ucs>>7)&127)]+(ucs&127)]); } std::ctype_base::mask ctypeMask(const Char& ch) { const cxxtools::Char::value_type c = ch.value(); return ctype_data[ ctype_lookup2[ ctype_lookup1[c>>14]+((c>>7)&127) ]+(c&127) ]; } } // namespace cxxtools cxxtools-3.0/src/datetime.cpp0000664000175000017500000003013613644433072013262 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/datetime.h" #include "cxxtools/clock.h" #include "cxxtools/serializationinfo.h" #include "dateutils.h" #include #include namespace cxxtools { static void throwInvalidDate(const std::string& str, std::string::const_iterator p, const std::string& fmt) { throw InvalidDate("string <" + std::string(str.begin(), p) + "(*)" + std::string(p, str.end()) + "> does not match datetime format <" + fmt + '>'); } DateTime::DateTime(const std::string& str, const std::string& fmt) { unsigned year = 0; unsigned month = 1; unsigned day = 1; unsigned hours = 0; unsigned minutes = 0; unsigned seconds = 0; unsigned useconds = 0; bool am = true; enum { state_0, state_fmt, state_two } state = state_0; std::string::const_iterator dit = str.begin(); try { std::string::const_iterator it; for (it = fmt.begin(); it != fmt.end(); ++it) { char ch = *it; switch (state) { case state_0: if (ch == '%') state = state_fmt; else { if (ch == '*') skipNonDigit(dit, str.end()); else if (ch == '#') skipWord(dit, str.end()); else if (dit == str.end() || (*dit != ch && ch != '?')) throwInvalidDate(str, dit, fmt); else ++dit; } break; case state_fmt: state = state_0; switch (ch) { case 'Y': year = getInt(dit, str.end(), 4); break; case 'y': year = getInt(dit, str.end(), 2); year += (year < 50 ? 2000 : 1900); break; case 'm': month = getUnsigned(dit, str.end(), 2); break; case 'O': month = getMonthFromName(dit, str.end()); break; case 'd': day = getUnsigned(dit, str.end(), 2); break; case 'H': case 'I': hours = getUnsigned(dit, str.end(), 2); break; case 'M': minutes = getUnsigned(dit, str.end(), 2); break; case 'S': seconds = getUnsigned(dit, str.end(), 2); break; case 'j': if (dit != str.end() && *dit == '.') ++dit; useconds = getMicroseconds(dit, str.end(), 6); break; case 'J': case 'U': if (dit != str.end() && *dit == '.') { ++dit; useconds = getMicroseconds(dit, str.end(), 6); } break; case 'K': if (dit != str.end() && *dit == '.') { ++dit; useconds = getMicroseconds(dit, str.end(), 3); } break; case 'k': useconds = getMicroseconds(dit, str.end(), 3); break; case 'u': useconds = getMicroseconds(dit, str.end(), 6); break; case 'p': if (dit == str.end() || dit + 1 == str.end() || ((*dit != 'A' && *dit != 'a' && *dit != 'P' && *dit != 'p') || (*(dit + 1) != 'M' && *(dit + 1) != 'm'))) { throwInvalidDate(str, dit, fmt); } am = (*dit == 'A' || *dit == 'a'); dit += 2; break; case '2': state = state_two; break; default: throw InvalidDate("invalid datetime format <" + fmt + '>'); } break; case state_two: state = state_0; switch (ch) { case 'm': month = getUnsignedF(dit, str.end(), 2); break; case 'd': day = getUnsignedF(dit, str.end(), 2); break; case 'H': case 'I': hours = getUnsignedF(dit, str.end(), 2); break; case 'M': minutes = getUnsignedF(dit, str.end(), 2); break; case 'S': seconds = getUnsignedF(dit, str.end(), 2); break; default: throw InvalidDate("invalid datetime format <" + fmt + '>'); } } } if (it != fmt.end() || dit != str.end()) throwInvalidDate(str, dit, fmt); set(year, month, day, am ? hours : hours + 12, minutes, seconds, 0, useconds); } catch (const std::invalid_argument&) { throwInvalidDate(str, dit, fmt); } } UtcDateTime DateTime::gmtime() { return Clock::getSystemTime(); } LocalDateTime DateTime::localtime() { return Clock::getLocalTime(); } Milliseconds DateTime::msecsSinceEpoch() const { static const DateTime dt(1970, 1, 1, 0, 0, 0); return *this - dt; } std::string DateTime::toString(const std::string& fmt) const { int year; unsigned month, day, hours, minutes, seconds, mseconds, useconds; get(year, month, day, hours, minutes, seconds, mseconds, useconds); std::string str; enum { state_0, state_fmt, state_one } state = state_0; for (std::string::const_iterator it = fmt.begin(); it != fmt.end(); ++it) { switch (state) { case state_0: if (*it == '%') state = state_fmt; else str += *it; break; case state_fmt: if (*it != '%') state = state_0; switch (*it) { case 'Y': appendDn(str, 4, year); break; case 'y': appendDn(str, 2, year % 100); break; case 'm': appendDn(str, 2, month); break; case 'O': str += monthnames[month-1]; break; case 'd': appendDn(str, 2, day); break; case 'w': appendDn(str, 1, dayOfWeek()); break; case 'W': { int dow = dayOfWeek(); appendDn(str, 1, dow == 0 ? 7 : dow); } break; case 'N': str += weekdaynames[dayOfWeek()]; break; case 'H': appendDn(str, 2, hours); break; case 'I': appendDn(str, 2, hours % 12); break; case 'M': appendDn(str, 2, minutes); break; case 'S': appendDn(str, 2, seconds); break; case 'j': if (useconds != 0) { str += '.'; str += (useconds / 100000 + '0'); useconds %= 100000; for (unsigned e = 10000; e > 0 && useconds > 0; e /= 10) { str += (useconds / e + '0'); useconds %= e; } } break; case 'J': str += '.'; str += (useconds / 100000 + '0'); useconds %= 100000; for (unsigned e = 10000; e > 0 && useconds > 0; e /= 10) { str += (useconds / e + '0'); useconds %= e; } break; case 'k': appendDn(str, 3, mseconds); break; case 'K': str += '.'; appendDn(str, 3, mseconds); break; case 'u': appendDn(str, 6, useconds); break; case 'U': str += '.'; appendDn(str, 6, useconds); break; case 'p': str += (hours < 12 ? "am" : "pm"); break; case 'P': str += (hours < 12 ? "AM" : "PM"); break; case '1': state = state_one; break; default: str += '%'; str += *it; } break; case state_one: state = state_0; switch (*it) { case 'd': appendDn(str, day < 10 ? 1 : 2, day); break; case 'm': appendDn(str, month < 10 ? 1 : 2, month); break; case 'H': appendDn(str, hours < 10 ? 1 : 2, hours); break; case 'I': appendDn(str, hours%12 < 10 ? 1 : 2, hours%12); break; case 'M': appendDn(str, minutes < 10 ? 1 : 2, minutes); break; case 'S': appendDn(str, seconds < 10 ? 1 : 2, seconds); break; default: str += "%1"; str += *it; if (*it == '%') state = state_fmt; break; } break; } } if (state == state_fmt) str += '%'; return str; } DateTime& DateTime::operator+=(const Timespan& ts) { int64_t totalUSecs = ts.totalUSecs(); int64_t days = totalUSecs / static_cast(Time::USecsPerDay); int64_t overrun = totalUSecs % static_cast(Time::USecsPerDay); if ((-overrun) > static_cast(_time.totalUSecs()) ) { days -= 1; overrun += Time::USecsPerDay; } else if (overrun + _time.totalUSecs() >= Time::USecsPerDay) { days += 1; overrun -= Time::USecsPerDay; } _date += static_cast(days); _time += Microseconds(overrun); return *this; } Timespan operator-(const DateTime& first, const DateTime& second) { int64_t dayDiff = int64_t( first.date().julian() ) - int64_t( second.date().julian() ); int64_t microSecDiff = int64_t( first.time().totalUSecs() ) - int64_t( second.time().totalUSecs() ); int64_t result = (dayDiff * Time::USecsPerDay + microSecDiff); return Timespan(result); } DateTime operator+(const DateTime& dt, const Timespan& ts) { DateTime tmp = dt; tmp += ts; return tmp; } DateTime operator-(const DateTime& dt, const Timespan& ts) { DateTime tmp = dt; tmp -= ts; return tmp; } void operator >>=(const SerializationInfo& si, DateTime& datetime) { if (si.category() == cxxtools::SerializationInfo::Object) { unsigned short year, month, day, hour, min, sec, msec; si.getMember("year") >>= year; si.getMember("month") >>= month; si.getMember("day") >>= day; si.getMember("hour") >>= hour; const cxxtools::SerializationInfo* p; if ((p = si.findMember("minute")) != 0) *p >>= min; else si.getMember("min") >>= min; if ((p = si.findMember("second")) != 0) *p >>= sec; else si.getMember("sec") >>= sec; if ((p = si.findMember("millisecond")) != 0 || (p = si.findMember("msec")) != 0) *p >>= msec; else msec = 0; datetime.set(year, month, day, hour, min, sec, msec); } else { std::string s; si.getValue(s); datetime = DateTime(s); } } void operator <<=(SerializationInfo& si, const DateTime& dt) { si.setValue(dt.toString()); si.setTypeName("DateTime"); } } cxxtools-3.0/src/query_params.cpp0000664000175000017500000002467113644433072014205 00000000000000/* * Copyright (C) 2003,2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/query_params.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/serializationerror.h" #include "cxxtools/utf8codec.h" #include "cxxtools/log.h" #include #include #include log_define("cxxtools.queryparams") namespace cxxtools { namespace { class UrlParser { QueryParams& _q; enum { state_0, state_key, state_value, state_keyesc, state_valueesc } _state; std::string _key; std::string _value; unsigned _cnt; unsigned _v; public: explicit UrlParser(QueryParams& q) : _q(q), _state(state_0), _cnt(0), _v(0) { } void parse(char ch); void finish(); }; void UrlParser::parse(char ch) { switch(_state) { case state_0: if (ch == '=') _state = state_value; else if (ch == '&') ; else if (ch == '%') _state = state_keyesc; else if (ch == '+') { _key = ' '; _state = state_key; } else { _key = ch; _state = state_key; } break; case state_key: if (ch == '=') _state = state_value; else if (ch == '&') { _q.add(_key); _key.clear(); _state = state_0; } else if (ch == '%') _state = state_keyesc; else if (ch == '+') _key += ' '; else _key += ch; break; case state_value: if (ch == '%') _state = state_valueesc; else if (ch == '&') { _q.add(_key, _value); _key.clear(); _value.clear(); _state = state_0; } else if (ch == '+') _value += ' '; else _value += ch; break; case state_keyesc: case state_valueesc: if (ch >= '0' && ch <= '9') { ++_cnt; _v = (_v << 4) + (ch - '0'); } else if (ch >= 'a' && ch <= 'f') { ++_cnt; _v = (_v << 4) + (ch - 'a' + 10); } else if (ch >= 'A' && ch <= 'F') { ++_cnt; _v = (_v << 4) + (ch - 'A' + 10); } else { if (_cnt == 0) { if (_state == state_keyesc) { _key += '%'; _state = state_key; } else { _value += '%'; _state = state_value; } } else { if (_state == state_keyesc) { _key += static_cast(_v); _state = state_key; } else { _value += static_cast(_v); _state = state_value; } _cnt = 0; _v = 0; } parse(ch); break; } if (_cnt >= 2) { if (_state == state_keyesc) { _key += static_cast(_v); _state = state_key; } else { _value += static_cast(_v); _state = state_value; } _cnt = 0; _v = 0; } break; } } void UrlParser::finish() { switch(_state) { case state_0: break; case state_key: if (!_key.empty()) { _q.add(_key); _key.clear(); } break; case state_value: _q.add(_key, _value); _key.clear(); _value.clear(); break; case state_keyesc: case state_valueesc: if (_cnt == 0) { if (_state == state_keyesc) { _key += '%'; _q.add(_key); } else { _value += '%'; _q.add(_key, _value); } } else { if (_state == state_keyesc) { _key += static_cast(_v); _q.add(_key); } else { _value += static_cast(_v); _q.add(_key, _value); } } _value.clear(); _key.clear(); _cnt = 0; _v = 0; break; } } void appendUrl(std::string& url, char ch) { static const char hex[] = "0123456789ABCDEF"; if (ch > 32 && ch < 127 && ch != '%' && ch != '+' && ch != '=' && ch != '&') url += ch; else if (ch == ' ') url += '+'; else { url += '%'; char hi = (ch >> 4) & 0x0f; char lo = ch & 0x0f; url += hex[static_cast(hi)]; url += hex[static_cast(lo)]; } } void appendUrl(std::string& url, const std::string& str) { for (std::string::const_iterator i = str.begin(); i != str.end(); ++i) appendUrl(url, *i); } } void QueryParams::parse_url(const std::string& url) { UrlParser p(*this); for (std::string::const_iterator it = url.begin(); it != url.end(); ++it) p.parse(*it); p.finish(); } void QueryParams::parse_url(const char* url) { UrlParser p(*this); while (*url) { p.parse(*url); ++url; } p.finish(); } void QueryParams::parse_url(std::istream& url_stream) { UrlParser p(*this); char ch; while (url_stream.get(ch)) p.parse(ch); p.finish(); } QueryParams& QueryParams::remove(const std::string& name) { for (size_type nn = 0; nn < _values.size(); ) { if (_values[nn].name == name) _values.erase(_values.begin() + nn); else ++nn; } return *this; } /// get nth named parameter. const std::string& QueryParams::param(const std::string& name, size_type n) const { for (size_type nn = 0; nn < _values.size(); ++nn) { if (_values[nn].name == name) { if (n == 0) return _values[nn].value; --n; } } static std::string emptyValue; return emptyValue; } /// get nth named parameter with default value. std::string QueryParams::param(const std::string& name, size_type n, const std::string& def) const { for (size_type nn = 0; nn < _values.size(); ++nn) { if (_values[nn].name == name) { if (n == 0) return _values[nn].value; --n; } } return def; } /// get number of parameters with the given name QueryParams::size_type QueryParams::paramcount(const std::string& name) const { size_type count = 0; for (size_type nn = 0; nn < _values.size(); ++nn) if (_values[nn].name == name) ++count; return count; } /// checks if the named parameter exists bool QueryParams::has(const std::string& name) const { for (size_type nn = 0; nn < _values.size(); ++nn) if (_values[nn].name == name) return true; return false; } /// get parameters as url std::string QueryParams::getUrl() const { std::string url; for (size_type nn = 0; nn < _values.size(); ++nn) { if (nn > 0) url += '&'; if (!_values[nn].name.empty()) { appendUrl(url, _values[nn].name); url += '='; } appendUrl(url, _values[nn].value); } return url; } void operator<<= (cxxtools::SerializationInfo& si, const QueryParams& q) { for (QueryParams::values_type::const_iterator it = q._values.begin(); it != q._values.end(); ++it) { enum { state_0, state_key, state_keyend } state = state_0; std::string nodename; cxxtools::SerializationInfo* current = &si; log_debug("parse query param name <" << it->name << '>'); for (unsigned n = 0; n < it->name.size(); ++n) { char ch = it->name[n]; switch (state) { case state_0: if (ch == '[') { cxxtools::SerializationInfo* p = current->findMember(nodename); current = p ? p : ¤t->addMember(nodename); nodename.clear(); state = state_key; } else nodename += ch; break; case state_key: if (ch == ']') state = state_keyend; else nodename += ch; break; case state_keyend: if (ch == '[') { cxxtools::SerializationInfo* p = current->findMember(nodename); current = p ? p : ¤t->addMember(nodename); nodename.clear(); state = state_key; } else { log_warn("invalid query param name <" << it->name.substr(0, n) << " *** " << it->name.substr(n) << "> (1)"); SerializationError::doThrow("'[' expected in query parameters"); } break; } } current->addMember(nodename) <<= Utf8Codec::decode(it->value); } } } cxxtools-3.0/src/settingswriter.h0000664000175000017500000000423113644433072014225 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SettingsWriter_h #define cxxtools_SettingsWriter_h #include "cxxtools/char.h" #include "cxxtools/serializationinfo.h" #include namespace cxxtools { class SettingsWriter { public: SettingsWriter( std::basic_ostream& os) : _os(&os) { } ~SettingsWriter() {} void write(const cxxtools::SerializationInfo& si); protected: void writeParent(const cxxtools::SerializationInfo& sd, const std::string& prefix); void writeChild(const cxxtools::SerializationInfo& node); void writeEntry(const std::string& name, const cxxtools::String& value, const std::string& type); void writeSection(const cxxtools::String& prefix); private: std::basic_ostream* _os; }; } #endif cxxtools-3.0/src/Makefile.in0000664000175000017500000016404113644433103013025 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @MAKE_ICONVSTREAM_TRUE@am__append_1 = \ @MAKE_ICONVSTREAM_TRUE@ iconvwrap.cpp \ @MAKE_ICONVSTREAM_TRUE@ iconvstream.cpp @MAKE_OPENSSL_TRUE@am__append_2 = -lssl @MAKE_OPENSSL_TRUE@am__append_3 = \ @MAKE_OPENSSL_TRUE@ sslcertificateimpl.cpp subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libcxxtools_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libcxxtools_la_SOURCES_DIST = addrinfo.cpp addrinfoimpl.cpp \ application.cpp applicationimpl.cpp base64codec.cpp \ csvdeserializer.cpp csvformatter.cpp csvparser.cpp char.cpp \ charmapcodec.cpp clock.cpp clockimpl.cpp condition.cpp \ conditionimpl.cpp connectable.cpp connection.cpp cgi.cpp \ conversionerror.cpp convert.cpp date.cpp datetime.cpp \ dateutils.cpp decomposer.cpp deserializer.cpp directory.cpp \ directoryimpl.cpp envsubst.cpp error.cpp eventloop.cpp \ eventsink.cpp eventsource.cpp fdstream.cpp file.cpp \ filedevice.cpp filedeviceimpl.cpp fileimpl.cpp fileinfo.cpp \ formatter.cpp hdstream.cpp inideserializer.cpp inifile.cpp \ iniparser.cpp iniserializer.cpp iodevice.cpp iodeviceimpl.cpp \ ioerror.cpp iostream.cpp iso8859_codec.cpp \ jsondeserializer.cpp jsonformatter.cpp jsonparser.cpp \ library.cpp libraryimpl.cpp log.cpp md5.c md5stream.cpp \ mime.cpp multifstream.cpp mutex.cpp muteximpl.cpp pipe.cpp \ pipeimpl.cpp posix/commandinput.cpp posix/commandoutput.cpp \ posix/daemonize.cpp posix/fork.cpp posix/pipestream.cpp \ posix/posixpipe.cpp propertiesfile.cpp propertiesparser.cpp \ propertiesdeserializer.cpp propertiesserializer.cpp \ query_params.cpp quotedprintablecodec.cpp regex.cpp \ remoteclient.cpp selectable.cpp selector.cpp selectorimpl.cpp \ semaphore.cpp semaphoreimpl.cpp serviceregistry.cpp \ settings.cpp settingsreader.cpp settingswriter.cpp \ serializationerror.cpp serializationinfo.cpp signal.cpp \ sslcertificate.cpp stddevice.cpp streambuffer.cpp string.cpp \ stringstream.cpp systemerror.cpp tee.cpp textbuffer.cpp \ textcodec.cpp textstream.cpp thread.cpp threadimpl.cpp \ threadpool.cpp threadpoolimpl.cpp time.cpp timer.cpp \ timespan.cpp uri.cpp utf8codec.cpp uuencode.cpp net.cpp \ tcpserverimpl.cpp tcpserver.cpp tcpsocket.cpp \ tcpsocketimpl.cpp tcpstream.cpp tz.cpp udp.cpp udpstream.cpp \ win1252codec.cpp xml/characters.cpp xml/endelement.cpp \ xml/entityresolver.cpp xml/namespacecontext.cpp \ xml/startelement.cpp xml/xmldeserializer.cpp xml/xmlerror.cpp \ xml/xmlformatter.cpp xml/xmlreader.cpp xml/xmlserializer.cpp \ xml/xmlwriter.cpp iconvwrap.cpp iconvstream.cpp \ sslcertificateimpl.cpp am__dirstamp = $(am__leading_dot)dirstamp @MAKE_ICONVSTREAM_TRUE@am__objects_1 = iconvwrap.lo iconvstream.lo @MAKE_OPENSSL_TRUE@am__objects_2 = sslcertificateimpl.lo am_libcxxtools_la_OBJECTS = addrinfo.lo addrinfoimpl.lo application.lo \ applicationimpl.lo base64codec.lo csvdeserializer.lo \ csvformatter.lo csvparser.lo char.lo charmapcodec.lo clock.lo \ clockimpl.lo condition.lo conditionimpl.lo connectable.lo \ connection.lo cgi.lo conversionerror.lo convert.lo date.lo \ datetime.lo dateutils.lo decomposer.lo deserializer.lo \ directory.lo directoryimpl.lo envsubst.lo error.lo \ eventloop.lo eventsink.lo eventsource.lo fdstream.lo file.lo \ filedevice.lo filedeviceimpl.lo fileimpl.lo fileinfo.lo \ formatter.lo hdstream.lo inideserializer.lo inifile.lo \ iniparser.lo iniserializer.lo iodevice.lo iodeviceimpl.lo \ ioerror.lo iostream.lo iso8859_codec.lo jsondeserializer.lo \ jsonformatter.lo jsonparser.lo library.lo libraryimpl.lo \ log.lo md5.lo md5stream.lo mime.lo multifstream.lo mutex.lo \ muteximpl.lo pipe.lo pipeimpl.lo posix/commandinput.lo \ posix/commandoutput.lo posix/daemonize.lo posix/fork.lo \ posix/pipestream.lo posix/posixpipe.lo propertiesfile.lo \ propertiesparser.lo propertiesdeserializer.lo \ propertiesserializer.lo query_params.lo \ quotedprintablecodec.lo regex.lo remoteclient.lo selectable.lo \ selector.lo selectorimpl.lo semaphore.lo semaphoreimpl.lo \ serviceregistry.lo settings.lo settingsreader.lo \ settingswriter.lo serializationerror.lo serializationinfo.lo \ signal.lo sslcertificate.lo stddevice.lo streambuffer.lo \ string.lo stringstream.lo systemerror.lo tee.lo textbuffer.lo \ textcodec.lo textstream.lo thread.lo threadimpl.lo \ threadpool.lo threadpoolimpl.lo time.lo timer.lo timespan.lo \ uri.lo utf8codec.lo uuencode.lo net.lo tcpserverimpl.lo \ tcpserver.lo tcpsocket.lo tcpsocketimpl.lo tcpstream.lo tz.lo \ udp.lo udpstream.lo win1252codec.lo xml/characters.lo \ xml/endelement.lo xml/entityresolver.lo \ xml/namespacecontext.lo xml/startelement.lo \ xml/xmldeserializer.lo xml/xmlerror.lo xml/xmlformatter.lo \ xml/xmlreader.lo xml/xmlserializer.lo xml/xmlwriter.lo \ $(am__objects_1) $(am__objects_2) libcxxtools_la_OBJECTS = $(am_libcxxtools_la_OBJECTS) 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 = libcxxtools_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcxxtools_la_LDFLAGS) \ $(LDFLAGS) -o $@ 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@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/addrinfo.Plo \ ./$(DEPDIR)/addrinfoimpl.Plo ./$(DEPDIR)/application.Plo \ ./$(DEPDIR)/applicationimpl.Plo ./$(DEPDIR)/base64codec.Plo \ ./$(DEPDIR)/cgi.Plo ./$(DEPDIR)/char.Plo \ ./$(DEPDIR)/charmapcodec.Plo ./$(DEPDIR)/clock.Plo \ ./$(DEPDIR)/clockimpl.Plo ./$(DEPDIR)/condition.Plo \ ./$(DEPDIR)/conditionimpl.Plo ./$(DEPDIR)/connectable.Plo \ ./$(DEPDIR)/connection.Plo ./$(DEPDIR)/conversionerror.Plo \ ./$(DEPDIR)/convert.Plo ./$(DEPDIR)/csvdeserializer.Plo \ ./$(DEPDIR)/csvformatter.Plo ./$(DEPDIR)/csvparser.Plo \ ./$(DEPDIR)/date.Plo ./$(DEPDIR)/datetime.Plo \ ./$(DEPDIR)/dateutils.Plo ./$(DEPDIR)/decomposer.Plo \ ./$(DEPDIR)/deserializer.Plo ./$(DEPDIR)/directory.Plo \ ./$(DEPDIR)/directoryimpl.Plo ./$(DEPDIR)/envsubst.Plo \ ./$(DEPDIR)/error.Plo ./$(DEPDIR)/eventloop.Plo \ ./$(DEPDIR)/eventsink.Plo ./$(DEPDIR)/eventsource.Plo \ ./$(DEPDIR)/fdstream.Plo ./$(DEPDIR)/file.Plo \ ./$(DEPDIR)/filedevice.Plo ./$(DEPDIR)/filedeviceimpl.Plo \ ./$(DEPDIR)/fileimpl.Plo ./$(DEPDIR)/fileinfo.Plo \ ./$(DEPDIR)/formatter.Plo ./$(DEPDIR)/hdstream.Plo \ ./$(DEPDIR)/iconvstream.Plo ./$(DEPDIR)/iconvwrap.Plo \ ./$(DEPDIR)/inideserializer.Plo ./$(DEPDIR)/inifile.Plo \ ./$(DEPDIR)/iniparser.Plo ./$(DEPDIR)/iniserializer.Plo \ ./$(DEPDIR)/iodevice.Plo ./$(DEPDIR)/iodeviceimpl.Plo \ ./$(DEPDIR)/ioerror.Plo ./$(DEPDIR)/iostream.Plo \ ./$(DEPDIR)/iso8859_codec.Plo ./$(DEPDIR)/jsondeserializer.Plo \ ./$(DEPDIR)/jsonformatter.Plo ./$(DEPDIR)/jsonparser.Plo \ ./$(DEPDIR)/library.Plo ./$(DEPDIR)/libraryimpl.Plo \ ./$(DEPDIR)/log.Plo ./$(DEPDIR)/md5.Plo \ ./$(DEPDIR)/md5stream.Plo ./$(DEPDIR)/mime.Plo \ ./$(DEPDIR)/multifstream.Plo ./$(DEPDIR)/mutex.Plo \ ./$(DEPDIR)/muteximpl.Plo ./$(DEPDIR)/net.Plo \ ./$(DEPDIR)/pipe.Plo ./$(DEPDIR)/pipeimpl.Plo \ ./$(DEPDIR)/propertiesdeserializer.Plo \ ./$(DEPDIR)/propertiesfile.Plo \ ./$(DEPDIR)/propertiesparser.Plo \ ./$(DEPDIR)/propertiesserializer.Plo \ ./$(DEPDIR)/query_params.Plo \ ./$(DEPDIR)/quotedprintablecodec.Plo ./$(DEPDIR)/regex.Plo \ ./$(DEPDIR)/remoteclient.Plo ./$(DEPDIR)/selectable.Plo \ ./$(DEPDIR)/selector.Plo ./$(DEPDIR)/selectorimpl.Plo \ ./$(DEPDIR)/semaphore.Plo ./$(DEPDIR)/semaphoreimpl.Plo \ ./$(DEPDIR)/serializationerror.Plo \ ./$(DEPDIR)/serializationinfo.Plo \ ./$(DEPDIR)/serviceregistry.Plo ./$(DEPDIR)/settings.Plo \ ./$(DEPDIR)/settingsreader.Plo ./$(DEPDIR)/settingswriter.Plo \ ./$(DEPDIR)/signal.Plo ./$(DEPDIR)/sslcertificate.Plo \ ./$(DEPDIR)/sslcertificateimpl.Plo ./$(DEPDIR)/stddevice.Plo \ ./$(DEPDIR)/streambuffer.Plo ./$(DEPDIR)/string.Plo \ ./$(DEPDIR)/stringstream.Plo ./$(DEPDIR)/systemerror.Plo \ ./$(DEPDIR)/tcpserver.Plo ./$(DEPDIR)/tcpserverimpl.Plo \ ./$(DEPDIR)/tcpsocket.Plo ./$(DEPDIR)/tcpsocketimpl.Plo \ ./$(DEPDIR)/tcpstream.Plo ./$(DEPDIR)/tee.Plo \ ./$(DEPDIR)/textbuffer.Plo ./$(DEPDIR)/textcodec.Plo \ ./$(DEPDIR)/textstream.Plo ./$(DEPDIR)/thread.Plo \ ./$(DEPDIR)/threadimpl.Plo ./$(DEPDIR)/threadpool.Plo \ ./$(DEPDIR)/threadpoolimpl.Plo ./$(DEPDIR)/time.Plo \ ./$(DEPDIR)/timer.Plo ./$(DEPDIR)/timespan.Plo \ ./$(DEPDIR)/tz.Plo ./$(DEPDIR)/udp.Plo \ ./$(DEPDIR)/udpstream.Plo ./$(DEPDIR)/uri.Plo \ ./$(DEPDIR)/utf8codec.Plo ./$(DEPDIR)/uuencode.Plo \ ./$(DEPDIR)/win1252codec.Plo posix/$(DEPDIR)/commandinput.Plo \ posix/$(DEPDIR)/commandoutput.Plo \ posix/$(DEPDIR)/daemonize.Plo posix/$(DEPDIR)/fork.Plo \ posix/$(DEPDIR)/pipestream.Plo posix/$(DEPDIR)/posixpipe.Plo \ xml/$(DEPDIR)/characters.Plo xml/$(DEPDIR)/endelement.Plo \ xml/$(DEPDIR)/entityresolver.Plo \ xml/$(DEPDIR)/namespacecontext.Plo \ xml/$(DEPDIR)/startelement.Plo \ xml/$(DEPDIR)/xmldeserializer.Plo xml/$(DEPDIR)/xmlerror.Plo \ xml/$(DEPDIR)/xmlformatter.Plo xml/$(DEPDIR)/xmlreader.Plo \ xml/$(DEPDIR)/xmlserializer.Plo xml/$(DEPDIR)/xmlwriter.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(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) $(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 = $(libcxxtools_la_SOURCES) DIST_SOURCES = $(am__libcxxtools_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools.la libcxxtools_la_SOURCES = addrinfo.cpp addrinfoimpl.cpp application.cpp \ applicationimpl.cpp base64codec.cpp csvdeserializer.cpp \ csvformatter.cpp csvparser.cpp char.cpp charmapcodec.cpp \ clock.cpp clockimpl.cpp condition.cpp conditionimpl.cpp \ connectable.cpp connection.cpp cgi.cpp conversionerror.cpp \ convert.cpp date.cpp datetime.cpp dateutils.cpp decomposer.cpp \ deserializer.cpp directory.cpp directoryimpl.cpp envsubst.cpp \ error.cpp eventloop.cpp eventsink.cpp eventsource.cpp \ fdstream.cpp file.cpp filedevice.cpp filedeviceimpl.cpp \ fileimpl.cpp fileinfo.cpp formatter.cpp hdstream.cpp \ inideserializer.cpp inifile.cpp iniparser.cpp \ iniserializer.cpp iodevice.cpp iodeviceimpl.cpp ioerror.cpp \ iostream.cpp iso8859_codec.cpp jsondeserializer.cpp \ jsonformatter.cpp jsonparser.cpp library.cpp libraryimpl.cpp \ log.cpp md5.c md5stream.cpp mime.cpp multifstream.cpp \ mutex.cpp muteximpl.cpp pipe.cpp pipeimpl.cpp \ posix/commandinput.cpp posix/commandoutput.cpp \ posix/daemonize.cpp posix/fork.cpp posix/pipestream.cpp \ posix/posixpipe.cpp propertiesfile.cpp propertiesparser.cpp \ propertiesdeserializer.cpp propertiesserializer.cpp \ query_params.cpp quotedprintablecodec.cpp regex.cpp \ remoteclient.cpp selectable.cpp selector.cpp selectorimpl.cpp \ semaphore.cpp semaphoreimpl.cpp serviceregistry.cpp \ settings.cpp settingsreader.cpp settingswriter.cpp \ serializationerror.cpp serializationinfo.cpp signal.cpp \ sslcertificate.cpp stddevice.cpp streambuffer.cpp string.cpp \ stringstream.cpp systemerror.cpp tee.cpp textbuffer.cpp \ textcodec.cpp textstream.cpp thread.cpp threadimpl.cpp \ threadpool.cpp threadpoolimpl.cpp time.cpp timer.cpp \ timespan.cpp uri.cpp utf8codec.cpp uuencode.cpp net.cpp \ tcpserverimpl.cpp tcpserver.cpp tcpsocket.cpp \ tcpsocketimpl.cpp tcpstream.cpp tz.cpp udp.cpp udpstream.cpp \ win1252codec.cpp xml/characters.cpp xml/endelement.cpp \ xml/entityresolver.cpp xml/namespacecontext.cpp \ xml/startelement.cpp xml/xmldeserializer.cpp xml/xmlerror.cpp \ xml/xmlformatter.cpp xml/xmlreader.cpp xml/xmlserializer.cpp \ xml/xmlwriter.cpp $(am__append_1) $(am__append_3) noinst_HEADERS = \ addrinfoimpl.h \ applicationimpl.h \ clockimpl.h \ conditionimpl.h \ dateutils.h \ directoryimpl.h \ error.h \ facets.cpp \ fileimpl.h \ filedeviceimpl.h \ fileinfoimpl.h \ iodeviceimpl.h \ libraryimpl.h \ md5.h \ muteximpl.h \ pipeimpl.h \ selectableimpl.h \ selectorimpl.h \ semaphoreimpl.h \ settingsreader.h \ settingswriter.h \ sslcertificateimpl.h \ tcpserverimpl.h \ tcpsocketimpl.h \ threadimpl.h \ threadpoolimpl.h \ unicode.h libcxxtools_la_LIBADD = $(LIBICONV) libcxxtools_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ \ $(am__append_2) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } posix/$(am__dirstamp): @$(MKDIR_P) posix @: > posix/$(am__dirstamp) posix/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) posix/$(DEPDIR) @: > posix/$(DEPDIR)/$(am__dirstamp) posix/commandinput.lo: posix/$(am__dirstamp) \ posix/$(DEPDIR)/$(am__dirstamp) posix/commandoutput.lo: posix/$(am__dirstamp) \ posix/$(DEPDIR)/$(am__dirstamp) posix/daemonize.lo: posix/$(am__dirstamp) \ posix/$(DEPDIR)/$(am__dirstamp) posix/fork.lo: posix/$(am__dirstamp) posix/$(DEPDIR)/$(am__dirstamp) posix/pipestream.lo: posix/$(am__dirstamp) \ posix/$(DEPDIR)/$(am__dirstamp) posix/posixpipe.lo: posix/$(am__dirstamp) \ posix/$(DEPDIR)/$(am__dirstamp) xml/$(am__dirstamp): @$(MKDIR_P) xml @: > xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xml/$(DEPDIR) @: > xml/$(DEPDIR)/$(am__dirstamp) xml/characters.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) xml/endelement.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) xml/entityresolver.lo: xml/$(am__dirstamp) \ xml/$(DEPDIR)/$(am__dirstamp) xml/namespacecontext.lo: xml/$(am__dirstamp) \ xml/$(DEPDIR)/$(am__dirstamp) xml/startelement.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) xml/xmldeserializer.lo: xml/$(am__dirstamp) \ xml/$(DEPDIR)/$(am__dirstamp) xml/xmlerror.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) xml/xmlformatter.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) xml/xmlreader.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) xml/xmlserializer.lo: xml/$(am__dirstamp) \ xml/$(DEPDIR)/$(am__dirstamp) xml/xmlwriter.lo: xml/$(am__dirstamp) xml/$(DEPDIR)/$(am__dirstamp) libcxxtools.la: $(libcxxtools_la_OBJECTS) $(libcxxtools_la_DEPENDENCIES) $(EXTRA_libcxxtools_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcxxtools_la_LINK) -rpath $(libdir) $(libcxxtools_la_OBJECTS) $(libcxxtools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f posix/*.$(OBJEXT) -rm -f posix/*.lo -rm -f xml/*.$(OBJEXT) -rm -f xml/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addrinfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addrinfoimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/application.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/applicationimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64codec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/char.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charmapcodec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clockimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/condition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditionimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connectable.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conversionerror.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvdeserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvformatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvparser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datetime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dateutils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decomposer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directoryimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/envsubst.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventloop.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventsink.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventsource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filedevice.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filedeviceimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileinfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvwrap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inideserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inifile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniparser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iodevice.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iodeviceimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioerror.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iostream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_codec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsondeserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonformatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonparser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libraryimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multifstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muteximpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipeimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propertiesdeserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propertiesfile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propertiesparser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propertiesserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query_params.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotedprintablecodec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remoteclient.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selectable.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selectorimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphoreimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializationerror.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializationinfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serviceregistry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settings.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settingsreader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settingswriter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sslcertificate.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sslcertificateimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stddevice.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streambuffer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systemerror.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpserver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpserverimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpsocket.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpsocketimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textbuffer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textcodec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadpool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadpoolimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tz.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udpstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8codec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuencode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win1252codec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/commandinput.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/commandoutput.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/daemonize.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/fork.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/pipestream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/posixpipe.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/characters.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/endelement.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/entityresolver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/namespacecontext.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/startelement.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/xmldeserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/xmlerror.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/xmlformatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/xmlreader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/xmlserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xml/$(DEPDIR)/xmlwriter.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf posix/.libs posix/_libs -rm -rf xml/.libs xml/_libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f posix/$(DEPDIR)/$(am__dirstamp) -rm -f posix/$(am__dirstamp) -rm -f xml/$(DEPDIR)/$(am__dirstamp) -rm -f xml/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/addrinfo.Plo -rm -f ./$(DEPDIR)/addrinfoimpl.Plo -rm -f ./$(DEPDIR)/application.Plo -rm -f ./$(DEPDIR)/applicationimpl.Plo -rm -f ./$(DEPDIR)/base64codec.Plo -rm -f ./$(DEPDIR)/cgi.Plo -rm -f ./$(DEPDIR)/char.Plo -rm -f ./$(DEPDIR)/charmapcodec.Plo -rm -f ./$(DEPDIR)/clock.Plo -rm -f ./$(DEPDIR)/clockimpl.Plo -rm -f ./$(DEPDIR)/condition.Plo -rm -f ./$(DEPDIR)/conditionimpl.Plo -rm -f ./$(DEPDIR)/connectable.Plo -rm -f ./$(DEPDIR)/connection.Plo -rm -f ./$(DEPDIR)/conversionerror.Plo -rm -f ./$(DEPDIR)/convert.Plo -rm -f ./$(DEPDIR)/csvdeserializer.Plo -rm -f ./$(DEPDIR)/csvformatter.Plo -rm -f ./$(DEPDIR)/csvparser.Plo -rm -f ./$(DEPDIR)/date.Plo -rm -f ./$(DEPDIR)/datetime.Plo -rm -f ./$(DEPDIR)/dateutils.Plo -rm -f ./$(DEPDIR)/decomposer.Plo -rm -f ./$(DEPDIR)/deserializer.Plo -rm -f ./$(DEPDIR)/directory.Plo -rm -f ./$(DEPDIR)/directoryimpl.Plo -rm -f ./$(DEPDIR)/envsubst.Plo -rm -f ./$(DEPDIR)/error.Plo -rm -f ./$(DEPDIR)/eventloop.Plo -rm -f ./$(DEPDIR)/eventsink.Plo -rm -f ./$(DEPDIR)/eventsource.Plo -rm -f ./$(DEPDIR)/fdstream.Plo -rm -f ./$(DEPDIR)/file.Plo -rm -f ./$(DEPDIR)/filedevice.Plo -rm -f ./$(DEPDIR)/filedeviceimpl.Plo -rm -f ./$(DEPDIR)/fileimpl.Plo -rm -f ./$(DEPDIR)/fileinfo.Plo -rm -f ./$(DEPDIR)/formatter.Plo -rm -f ./$(DEPDIR)/hdstream.Plo -rm -f ./$(DEPDIR)/iconvstream.Plo -rm -f ./$(DEPDIR)/iconvwrap.Plo -rm -f ./$(DEPDIR)/inideserializer.Plo -rm -f ./$(DEPDIR)/inifile.Plo -rm -f ./$(DEPDIR)/iniparser.Plo -rm -f ./$(DEPDIR)/iniserializer.Plo -rm -f ./$(DEPDIR)/iodevice.Plo -rm -f ./$(DEPDIR)/iodeviceimpl.Plo -rm -f ./$(DEPDIR)/ioerror.Plo -rm -f ./$(DEPDIR)/iostream.Plo -rm -f ./$(DEPDIR)/iso8859_codec.Plo -rm -f ./$(DEPDIR)/jsondeserializer.Plo -rm -f ./$(DEPDIR)/jsonformatter.Plo -rm -f ./$(DEPDIR)/jsonparser.Plo -rm -f ./$(DEPDIR)/library.Plo -rm -f ./$(DEPDIR)/libraryimpl.Plo -rm -f ./$(DEPDIR)/log.Plo -rm -f ./$(DEPDIR)/md5.Plo -rm -f ./$(DEPDIR)/md5stream.Plo -rm -f ./$(DEPDIR)/mime.Plo -rm -f ./$(DEPDIR)/multifstream.Plo -rm -f ./$(DEPDIR)/mutex.Plo -rm -f ./$(DEPDIR)/muteximpl.Plo -rm -f ./$(DEPDIR)/net.Plo -rm -f ./$(DEPDIR)/pipe.Plo -rm -f ./$(DEPDIR)/pipeimpl.Plo -rm -f ./$(DEPDIR)/propertiesdeserializer.Plo -rm -f ./$(DEPDIR)/propertiesfile.Plo -rm -f ./$(DEPDIR)/propertiesparser.Plo -rm -f ./$(DEPDIR)/propertiesserializer.Plo -rm -f ./$(DEPDIR)/query_params.Plo -rm -f ./$(DEPDIR)/quotedprintablecodec.Plo -rm -f ./$(DEPDIR)/regex.Plo -rm -f ./$(DEPDIR)/remoteclient.Plo -rm -f ./$(DEPDIR)/selectable.Plo -rm -f ./$(DEPDIR)/selector.Plo -rm -f ./$(DEPDIR)/selectorimpl.Plo -rm -f ./$(DEPDIR)/semaphore.Plo -rm -f ./$(DEPDIR)/semaphoreimpl.Plo -rm -f ./$(DEPDIR)/serializationerror.Plo -rm -f ./$(DEPDIR)/serializationinfo.Plo -rm -f ./$(DEPDIR)/serviceregistry.Plo -rm -f ./$(DEPDIR)/settings.Plo -rm -f ./$(DEPDIR)/settingsreader.Plo -rm -f ./$(DEPDIR)/settingswriter.Plo -rm -f ./$(DEPDIR)/signal.Plo -rm -f ./$(DEPDIR)/sslcertificate.Plo -rm -f ./$(DEPDIR)/sslcertificateimpl.Plo -rm -f ./$(DEPDIR)/stddevice.Plo -rm -f ./$(DEPDIR)/streambuffer.Plo -rm -f ./$(DEPDIR)/string.Plo -rm -f ./$(DEPDIR)/stringstream.Plo -rm -f ./$(DEPDIR)/systemerror.Plo -rm -f ./$(DEPDIR)/tcpserver.Plo -rm -f ./$(DEPDIR)/tcpserverimpl.Plo -rm -f ./$(DEPDIR)/tcpsocket.Plo -rm -f ./$(DEPDIR)/tcpsocketimpl.Plo -rm -f ./$(DEPDIR)/tcpstream.Plo -rm -f ./$(DEPDIR)/tee.Plo -rm -f ./$(DEPDIR)/textbuffer.Plo -rm -f ./$(DEPDIR)/textcodec.Plo -rm -f ./$(DEPDIR)/textstream.Plo -rm -f ./$(DEPDIR)/thread.Plo -rm -f ./$(DEPDIR)/threadimpl.Plo -rm -f ./$(DEPDIR)/threadpool.Plo -rm -f ./$(DEPDIR)/threadpoolimpl.Plo -rm -f ./$(DEPDIR)/time.Plo -rm -f ./$(DEPDIR)/timer.Plo -rm -f ./$(DEPDIR)/timespan.Plo -rm -f ./$(DEPDIR)/tz.Plo -rm -f ./$(DEPDIR)/udp.Plo -rm -f ./$(DEPDIR)/udpstream.Plo -rm -f ./$(DEPDIR)/uri.Plo -rm -f ./$(DEPDIR)/utf8codec.Plo -rm -f ./$(DEPDIR)/uuencode.Plo -rm -f ./$(DEPDIR)/win1252codec.Plo -rm -f posix/$(DEPDIR)/commandinput.Plo -rm -f posix/$(DEPDIR)/commandoutput.Plo -rm -f posix/$(DEPDIR)/daemonize.Plo -rm -f posix/$(DEPDIR)/fork.Plo -rm -f posix/$(DEPDIR)/pipestream.Plo -rm -f posix/$(DEPDIR)/posixpipe.Plo -rm -f xml/$(DEPDIR)/characters.Plo -rm -f xml/$(DEPDIR)/endelement.Plo -rm -f xml/$(DEPDIR)/entityresolver.Plo -rm -f xml/$(DEPDIR)/namespacecontext.Plo -rm -f xml/$(DEPDIR)/startelement.Plo -rm -f xml/$(DEPDIR)/xmldeserializer.Plo -rm -f xml/$(DEPDIR)/xmlerror.Plo -rm -f xml/$(DEPDIR)/xmlformatter.Plo -rm -f xml/$(DEPDIR)/xmlreader.Plo -rm -f xml/$(DEPDIR)/xmlserializer.Plo -rm -f xml/$(DEPDIR)/xmlwriter.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/addrinfo.Plo -rm -f ./$(DEPDIR)/addrinfoimpl.Plo -rm -f ./$(DEPDIR)/application.Plo -rm -f ./$(DEPDIR)/applicationimpl.Plo -rm -f ./$(DEPDIR)/base64codec.Plo -rm -f ./$(DEPDIR)/cgi.Plo -rm -f ./$(DEPDIR)/char.Plo -rm -f ./$(DEPDIR)/charmapcodec.Plo -rm -f ./$(DEPDIR)/clock.Plo -rm -f ./$(DEPDIR)/clockimpl.Plo -rm -f ./$(DEPDIR)/condition.Plo -rm -f ./$(DEPDIR)/conditionimpl.Plo -rm -f ./$(DEPDIR)/connectable.Plo -rm -f ./$(DEPDIR)/connection.Plo -rm -f ./$(DEPDIR)/conversionerror.Plo -rm -f ./$(DEPDIR)/convert.Plo -rm -f ./$(DEPDIR)/csvdeserializer.Plo -rm -f ./$(DEPDIR)/csvformatter.Plo -rm -f ./$(DEPDIR)/csvparser.Plo -rm -f ./$(DEPDIR)/date.Plo -rm -f ./$(DEPDIR)/datetime.Plo -rm -f ./$(DEPDIR)/dateutils.Plo -rm -f ./$(DEPDIR)/decomposer.Plo -rm -f ./$(DEPDIR)/deserializer.Plo -rm -f ./$(DEPDIR)/directory.Plo -rm -f ./$(DEPDIR)/directoryimpl.Plo -rm -f ./$(DEPDIR)/envsubst.Plo -rm -f ./$(DEPDIR)/error.Plo -rm -f ./$(DEPDIR)/eventloop.Plo -rm -f ./$(DEPDIR)/eventsink.Plo -rm -f ./$(DEPDIR)/eventsource.Plo -rm -f ./$(DEPDIR)/fdstream.Plo -rm -f ./$(DEPDIR)/file.Plo -rm -f ./$(DEPDIR)/filedevice.Plo -rm -f ./$(DEPDIR)/filedeviceimpl.Plo -rm -f ./$(DEPDIR)/fileimpl.Plo -rm -f ./$(DEPDIR)/fileinfo.Plo -rm -f ./$(DEPDIR)/formatter.Plo -rm -f ./$(DEPDIR)/hdstream.Plo -rm -f ./$(DEPDIR)/iconvstream.Plo -rm -f ./$(DEPDIR)/iconvwrap.Plo -rm -f ./$(DEPDIR)/inideserializer.Plo -rm -f ./$(DEPDIR)/inifile.Plo -rm -f ./$(DEPDIR)/iniparser.Plo -rm -f ./$(DEPDIR)/iniserializer.Plo -rm -f ./$(DEPDIR)/iodevice.Plo -rm -f ./$(DEPDIR)/iodeviceimpl.Plo -rm -f ./$(DEPDIR)/ioerror.Plo -rm -f ./$(DEPDIR)/iostream.Plo -rm -f ./$(DEPDIR)/iso8859_codec.Plo -rm -f ./$(DEPDIR)/jsondeserializer.Plo -rm -f ./$(DEPDIR)/jsonformatter.Plo -rm -f ./$(DEPDIR)/jsonparser.Plo -rm -f ./$(DEPDIR)/library.Plo -rm -f ./$(DEPDIR)/libraryimpl.Plo -rm -f ./$(DEPDIR)/log.Plo -rm -f ./$(DEPDIR)/md5.Plo -rm -f ./$(DEPDIR)/md5stream.Plo -rm -f ./$(DEPDIR)/mime.Plo -rm -f ./$(DEPDIR)/multifstream.Plo -rm -f ./$(DEPDIR)/mutex.Plo -rm -f ./$(DEPDIR)/muteximpl.Plo -rm -f ./$(DEPDIR)/net.Plo -rm -f ./$(DEPDIR)/pipe.Plo -rm -f ./$(DEPDIR)/pipeimpl.Plo -rm -f ./$(DEPDIR)/propertiesdeserializer.Plo -rm -f ./$(DEPDIR)/propertiesfile.Plo -rm -f ./$(DEPDIR)/propertiesparser.Plo -rm -f ./$(DEPDIR)/propertiesserializer.Plo -rm -f ./$(DEPDIR)/query_params.Plo -rm -f ./$(DEPDIR)/quotedprintablecodec.Plo -rm -f ./$(DEPDIR)/regex.Plo -rm -f ./$(DEPDIR)/remoteclient.Plo -rm -f ./$(DEPDIR)/selectable.Plo -rm -f ./$(DEPDIR)/selector.Plo -rm -f ./$(DEPDIR)/selectorimpl.Plo -rm -f ./$(DEPDIR)/semaphore.Plo -rm -f ./$(DEPDIR)/semaphoreimpl.Plo -rm -f ./$(DEPDIR)/serializationerror.Plo -rm -f ./$(DEPDIR)/serializationinfo.Plo -rm -f ./$(DEPDIR)/serviceregistry.Plo -rm -f ./$(DEPDIR)/settings.Plo -rm -f ./$(DEPDIR)/settingsreader.Plo -rm -f ./$(DEPDIR)/settingswriter.Plo -rm -f ./$(DEPDIR)/signal.Plo -rm -f ./$(DEPDIR)/sslcertificate.Plo -rm -f ./$(DEPDIR)/sslcertificateimpl.Plo -rm -f ./$(DEPDIR)/stddevice.Plo -rm -f ./$(DEPDIR)/streambuffer.Plo -rm -f ./$(DEPDIR)/string.Plo -rm -f ./$(DEPDIR)/stringstream.Plo -rm -f ./$(DEPDIR)/systemerror.Plo -rm -f ./$(DEPDIR)/tcpserver.Plo -rm -f ./$(DEPDIR)/tcpserverimpl.Plo -rm -f ./$(DEPDIR)/tcpsocket.Plo -rm -f ./$(DEPDIR)/tcpsocketimpl.Plo -rm -f ./$(DEPDIR)/tcpstream.Plo -rm -f ./$(DEPDIR)/tee.Plo -rm -f ./$(DEPDIR)/textbuffer.Plo -rm -f ./$(DEPDIR)/textcodec.Plo -rm -f ./$(DEPDIR)/textstream.Plo -rm -f ./$(DEPDIR)/thread.Plo -rm -f ./$(DEPDIR)/threadimpl.Plo -rm -f ./$(DEPDIR)/threadpool.Plo -rm -f ./$(DEPDIR)/threadpoolimpl.Plo -rm -f ./$(DEPDIR)/time.Plo -rm -f ./$(DEPDIR)/timer.Plo -rm -f ./$(DEPDIR)/timespan.Plo -rm -f ./$(DEPDIR)/tz.Plo -rm -f ./$(DEPDIR)/udp.Plo -rm -f ./$(DEPDIR)/udpstream.Plo -rm -f ./$(DEPDIR)/uri.Plo -rm -f ./$(DEPDIR)/utf8codec.Plo -rm -f ./$(DEPDIR)/uuencode.Plo -rm -f ./$(DEPDIR)/win1252codec.Plo -rm -f posix/$(DEPDIR)/commandinput.Plo -rm -f posix/$(DEPDIR)/commandoutput.Plo -rm -f posix/$(DEPDIR)/daemonize.Plo -rm -f posix/$(DEPDIR)/fork.Plo -rm -f posix/$(DEPDIR)/pipestream.Plo -rm -f posix/$(DEPDIR)/posixpipe.Plo -rm -f xml/$(DEPDIR)/characters.Plo -rm -f xml/$(DEPDIR)/endelement.Plo -rm -f xml/$(DEPDIR)/entityresolver.Plo -rm -f xml/$(DEPDIR)/namespacecontext.Plo -rm -f xml/$(DEPDIR)/startelement.Plo -rm -f xml/$(DEPDIR)/xmldeserializer.Plo -rm -f xml/$(DEPDIR)/xmlerror.Plo -rm -f xml/$(DEPDIR)/xmlformatter.Plo -rm -f xml/$(DEPDIR)/xmlreader.Plo -rm -f xml/$(DEPDIR)/xmlserializer.Plo -rm -f xml/$(DEPDIR)/xmlwriter.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-hdr 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-libLTLIBRARIES \ 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 uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/src/md5stream.cpp0000664000175000017500000000754613644433072013400 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/md5stream.h" #include "cxxtools/log.h" #include "md5.h" #include log_define("cxxtools.md5stream") namespace cxxtools { //////////////////////////////////////////////////////////////////////// // Md5streambuf // Md5streambuf::Md5streambuf() : context(new cxxtools_MD5_CTX()) { log_debug("initialize MD5"); cxxtools_MD5Init(context); } Md5streambuf::~Md5streambuf() { delete context; } std::streambuf::int_type Md5streambuf::overflow( std::streambuf::int_type ch) { if (pptr() == 0) { // Ausgabepuffer ist leer - initialisieren log_debug("initialize MD5"); cxxtools_MD5Init(context); } else { // konsumiere Zeichen aus dem Puffer log_debug("process " << (pptr() - pbase()) << " bytes of data"); cxxtools_MD5Update(context, (const unsigned char*)pbase(), pptr() - pbase()); } // setze Ausgabepuffer setp(buffer, buffer + bufsize); if (ch != traits_type::eof()) { // das Zeichen, welches den overflow ausgelöst hat, stecken // wir in den Puffer. *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type Md5streambuf::underflow() { // nur Ausgabestrom return traits_type::eof(); } int Md5streambuf::sync() { if (pptr() != pbase()) { // konsumiere Zeichen aus dem Puffer log_debug("process " << (pptr() - pbase()) << " bytes of data"); cxxtools_MD5Update(context, (const unsigned char*)pbase(), pptr() - pbase()); // leere Ausgabepuffer setp(buffer, buffer + bufsize); } return 0; } void Md5streambuf::getDigest(unsigned char digest_[16]) { if (pptr()) { if (pptr() != pbase()) { // konsumiere Zeichen aus dem Puffer log_debug("process " << (pptr() - pbase()) << " bytes of data"); cxxtools_MD5Update(context, (const unsigned char*)pbase(), pptr() - pbase()); } // deinitialisiere Ausgabepuffer setp(0, 0); } else { log_debug("initialize MD5"); cxxtools_MD5Init(context); } log_debug("finalize MD5"); cxxtools_MD5Final(digest, context); std::memcpy(digest_, digest, 16); } //////////////////////////////////////////////////////////////////////// // Md5stream // const char* Md5stream::getHexDigest() { static const char hexDigits[] = "0123456789abcdef"; unsigned char md5[16]; getDigest(md5); int i; char* p = hexdigest; for (i = 0; i < 16; ++i) { *p++ = hexDigits[md5[i] >> 4]; *p++ = hexDigits[md5[i] & 0xf]; } *p = '\0'; log_debug("md5: " << hexdigest); return hexdigest; } } cxxtools-3.0/src/addrinfo.cpp0000664000175000017500000000506213644433072013254 00000000000000/* * Copyright (C) 2005,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "addrinfoimpl.h" log_define("cxxtools.net.addrinfo") namespace cxxtools { namespace net { AddrInfo::AddrInfo(AddrInfoImpl* impl) : _impl(impl) { if (_impl) _impl->addRef(); } AddrInfo::AddrInfo(const std::string& host, unsigned short port, bool listen) : _impl(0) { log_debug("host=" << host << " port=" << port); struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; if (listen) hints.ai_flags |= AI_PASSIVE; _impl = new AddrInfoImpl(host, port, hints); _impl->addRef(); } AddrInfo::AddrInfo(const AddrInfo& src) : _impl(src._impl) { if (_impl) _impl->addRef(); } AddrInfo::~AddrInfo() { if (_impl && _impl->release() == 0) delete _impl; } AddrInfo& AddrInfo::operator= (const AddrInfo& src) { if (src._impl != _impl) { if (_impl) _impl->release(); _impl = src._impl; if (_impl) _impl->addRef(); } return *this; } const std::string& AddrInfo::host() const { return _impl->host(); } unsigned short AddrInfo::port() const { return _impl->port(); } } } cxxtools-3.0/src/timespan.cpp0000664000175000017500000002535613644433072013316 00000000000000/* * Copyright (C) 2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include namespace cxxtools { Timespan Timespan::gettimeofday() { timeval tv; ::gettimeofday(&tv, 0); return Timespan(tv.tv_sec, tv.tv_usec); } std::ostream& operator<< (std::ostream& out, const Timespan& ts) { out << static_cast(ts.totalSeconds()) << 's'; return out; } std::ostream& operator<< (std::ostream& out, const Microseconds& ts) { out << ts.totalUSecs() << "us"; return out; } std::ostream& operator<< (std::ostream& out, const Milliseconds& ts) { out << static_cast(ts.totalMSecs()) << "ms"; return out; } std::ostream& operator<< (std::ostream& out, const Seconds& ts) { out << static_cast(ts.totalSeconds()) << 's'; return out; } std::ostream& operator<< (std::ostream& out, const Minutes& ts) { out << static_cast(ts.totalMinutes()) << "min"; return out; } std::ostream& operator<< (std::ostream& out, const Hours& ts) { out << static_cast(ts.totalHours()) << 'h'; return out; } std::ostream& operator<< (std::ostream& out, const Days& ts) { out << static_cast(ts.totalDays()) << 'd'; return out; } namespace tshelper { void get(std::istream& in, Timespan& ts, uint64_t res) { double value; in >> value; if (in) { int ch = in.peek(); if (in) { switch (std::istream::traits_type::to_char_type(ch)) { case 'u': in.get(); ts = Microseconds(value); return; case 'm': { in.get(); ch = in.peek(); if (in) { switch (std::istream::traits_type::to_char_type(ch)) { case 's': in.get(); ts = Milliseconds(value); return; case 'i': in.get(); ts = Minutes(value); return; } } in.clear(); ts = Minutes(value); return; } case 's': in.get(); ts = Seconds(value); return; case 'h': in.get(); ts = Hours(value); return; case 'd': in.get(); ts = Days(value); return; } } in.clear(); ts = Timespan(value * res); } } uint64_t factor(const cxxtools::SerializationInfo& si, uint64_t res) { if (si.typeName() == "microseconds") return 1; else if (si.typeName() == "milliseconds") return 1000l; else if (si.typeName() == "seconds") return 1000l*1000l; else if (si.typeName() == "minutes") return 1000l*1000l*60l; else if (si.typeName() == "hours") return static_cast(1000)*1000l*60l*60l; else if (si.typeName() == "days") return static_cast(1000)*1000l*60l*60l*24l; else return res; } void get(const SerializationInfo& si, Timespan& timespan, uint64_t res) { if (si.isInt()) { int64_t value; si >>= value; timespan = Timespan(value); } else if (si.isFloat()) { float value; si >>= value; timespan = Timespan(value * factor(si, res)); } else if (si.isDouble()) { double value; si >>= value; timespan = Timespan(value * factor(si, res)); } else if (si.isLongDouble()) { long double value; si >>= value; timespan = Timespan(value * factor(si, res)); } else { std::string stringValue; si >>= stringValue; bool ok; double floatValue; std::string::const_iterator end = getFloat(stringValue.begin(), stringValue.end(), ok, floatValue); if (!ok) { std::string msg = "failed to get timespan from value \""; msg += stringValue; msg += '"'; throw SerializationError(msg); } if (end != stringValue.end()) { std::string::size_type pos = end - stringValue.begin(); if (stringValue.compare(pos, 1, "u") == 0) timespan = Microseconds(floatValue); else if (stringValue.compare(pos, 2, "ms") == 0 || stringValue.compare(pos, 3, "mil") == 0) timespan = Milliseconds(floatValue); else if (stringValue.compare(pos, 1, "s") == 0) timespan = Seconds(floatValue); else if (stringValue.compare(pos, 1, "m") == 0) timespan = Minutes(floatValue); else if (stringValue.compare(pos, 1, "h") == 0) timespan = Hours(floatValue); else if (stringValue.compare(pos, 1, "d") == 0) timespan = Days(floatValue); else timespan = Timespan(floatValue * res); } else if (si.typeName() == "microseconds") timespan = Microseconds(floatValue); else if (si.typeName() == "milliseconds") timespan = Milliseconds(floatValue); else if (si.typeName() == "seconds") timespan = Seconds(floatValue); else if (si.typeName() == "minutes") timespan = Minutes(floatValue); else if (si.typeName() == "hours") timespan = Hours(floatValue); else if (si.typeName() == "days") timespan = Days(floatValue); else timespan = Timespan(floatValue * res); } } } void operator <<=(SerializationInfo& si, const Timespan& timespan) { si <<= timespan.totalUSecs(); si.setTypeName("microseconds"); } void operator <<=(SerializationInfo& si, const Microseconds& timespan) { si <<= timespan.totalUSecs(); si.setTypeName("microseconds"); } static std::string toString(int64_t number, unsigned short r) { unsigned divisor = 1; for (unsigned short rr = 0; rr < r; ++rr) divisor *= 10; uint64_t absnum = static_cast(number >= 0 ? number : -number); unsigned reminder = absnum % divisor; char buffer[24]; if (reminder == 0) { snprintf(buffer, 24, "%lld", (long long)(number / divisor)); return buffer; } snprintf(buffer, 24, "%lld", (long long)(absnum / divisor)); char bb[24]; snprintf(bb, 24, "%u", reminder); std::string ret(bb); ret.insert(0, r - ret.size(), '0'); ret.insert(0, 1, '.'); ret.insert(0, buffer); if (number < 0) ret.insert(0, 1, '-'); while (ret[ret.size()-1] == '0') ret.erase(ret.size()-1); if (ret[ret.size()-1] == '.') ret.erase(ret.size()-1); return ret; } void operator <<=(SerializationInfo& si, const Milliseconds& timespan) { si <<= toString(timespan.totalUSecs(), 3); si.setTypeName("milliseconds"); } void operator <<=(SerializationInfo& si, const Seconds& timespan) { si <<= timespan.totalSeconds(); si <<= toString(timespan.totalUSecs(), 6); si.setTypeName("seconds"); } void operator <<=(SerializationInfo& si, const Minutes& timespan) { si <<= timespan.totalMinutes(); si.setTypeName("minutes"); } void operator <<=(SerializationInfo& si, const Hours& timespan) { si <<= timespan.totalHours(); si.setTypeName("hours"); } void operator <<=(SerializationInfo& si, const Days& timespan) { si <<= timespan.totalDays(); si.setTypeName("days"); } } cxxtools-3.0/src/config.h.in0000664000175000017500000001160013644433103012773 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* defined if exception abi::__forced_unwind exists */ #undef HAVE_ABI_FORCED_UNWIND /* Define to 1 if you have the `accept4' function. */ #undef HAVE_ACCEPT4 /* Defined when openssl supports ASN1_TIME_diff (openssl 1.0.2) */ #undef HAVE_ASN1_TIME_diff /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_CSIGNAL /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* defined if IPV6 is supported */ #undef HAVE_IPV6 /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* defined if MSG_NOSIGNAL is defined */ #undef HAVE_MSG_NOSIGNAL /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `ppoll' function. */ #undef HAVE_PPOLL /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the `sendfile' function. */ #undef HAVE_SENDFILE /* defined if socket option SO_NOSIGPIPE is supported */ #undef HAVE_SO_NOSIGPIPE /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SENDFILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* defined if TCP_DEFER_ACCEPT is defined */ #undef HAVE_TCP_DEFER_ACCEPT /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* defined if int64_t is one of the base types */ #undef INT64_IS_BASETYPE /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to build with openssl */ #undef WITH_SSL /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE cxxtools-3.0/src/muteximpl.cpp0000664000175000017500000000737513644433072013523 00000000000000/* * Copyright (C) 2005 - 2007 by Marc Boris Duerner * Copyright (C) 2005 - 2007 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "muteximpl.h" #include "cxxtools/systemerror.h" #include namespace cxxtools { MutexImpl::MutexImpl() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); int rc = pthread_mutex_init(&_handle, &attr); if (rc != 0) throw SystemError(rc, "pthread_mutex_init"); } MutexImpl::MutexImpl(bool recursive) { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); if (recursive) pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); int rc = pthread_mutex_init(&_handle, &attr); if (rc != 0) throw SystemError(rc, "pthread_mutex_init"); } MutexImpl::~MutexImpl() { pthread_mutex_destroy(&_handle); } void MutexImpl::lock() { int rc = pthread_mutex_lock(&_handle); if( rc != 0 ) throw SystemError(rc, "pthread_mutex_lock failed"); } bool MutexImpl::tryLock() { int rc = pthread_mutex_trylock(&_handle); if( rc != 0 && rc != EBUSY ) throw SystemError(rc, "pthread_mutex_trylock"); return rc != EBUSY; } void MutexImpl::unlock() { int rc = pthread_mutex_unlock(&_handle); if( rc != 0 ) throw SystemError(rc, "pthread_mutex_unlock"); } ReadWriteMutexImpl::ReadWriteMutexImpl() { int rc = pthread_rwlock_init(&_rwl, NULL); if( rc != 0 ) throw SystemError(rc, "pthread_rwlock_init"); } ReadWriteMutexImpl::~ReadWriteMutexImpl() { pthread_rwlock_destroy(&_rwl); } void ReadWriteMutexImpl::readLock() { int rc = pthread_rwlock_rdlock(&_rwl); if( rc != 0 ) throw SystemError(rc, "pthread_rwlock_rdlock"); } bool ReadWriteMutexImpl::tryReadLock() { int rc = pthread_rwlock_tryrdlock(&_rwl); if( rc != 0 && rc != EBUSY ) throw SystemError(rc, "pthread_rwlock_tryrdlock"); return rc != EBUSY; } void ReadWriteMutexImpl::writeLock() { int rc = pthread_rwlock_wrlock(&_rwl); if( rc != 0) throw SystemError(rc, "pthread_rwlock_wrlock"); } bool ReadWriteMutexImpl::tryWriteLock() { int rc = pthread_rwlock_trywrlock(&_rwl); if( rc != 0 && rc != EBUSY) throw SystemError(rc, "pthread_rwlock_trywrlock"); return rc != EBUSY; } void ReadWriteMutexImpl::unlock() { int rc = pthread_rwlock_unlock(&_rwl); if( rc != 0 ) throw SystemError(rc, "pthread_rwlock_unlock"); } } // !namespace cxxtools cxxtools-3.0/src/application.cpp0000664000175000017500000000572513644433072013777 00000000000000/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "applicationimpl.h" #include "cxxtools/application.h" #include "cxxtools/event.h" #include #include #include namespace { cxxtools::Application*& getSystemAppPtr() { static cxxtools::Application* _app = 0; return _app; } } namespace cxxtools { void Application::construct() { if( getSystemAppPtr() ) throw std::logic_error("application already initialized"); // base class already throws if constructed twice ::getSystemAppPtr() = this; _impl = new ApplicationImpl; _owner = new EventLoop(); init(*_owner); } Application::Application() : _argc(0) , _argv(0) , _loop(0) , _owner(0) { construct(); } Application::Application(int argc, char** argv) : _argc(argc) , _argv(argv) , _loop(0) , _owner(0) { construct(); } Application::Application(EventLoopBase* loop) : _argc(0) , _argv(0) , _loop(loop) , _owner(0) { construct(); } Application::Application(EventLoopBase* loop, int argc, char** argv) : _argc(argc) , _argv(argv) , _loop(loop) , _owner(0) { construct(); } Application::~Application() { delete _owner; ::getSystemAppPtr() = 0; delete _impl; } Application& Application::instance() { Application* app = ::getSystemAppPtr(); if( ! app ) throw std::logic_error("application not initialized"); return *app; } bool Application::catchSystemSignal(int sig) { return _impl->catchSystemSignal(sig); } bool Application::raiseSystemSignal(int sig) { return _impl->raiseSystemSignal(sig); } void Application::init(EventLoopBase& loop) { _loop = &loop; _impl->init(*_loop); } } // namespace cxxtools cxxtools-3.0/src/connectable.cpp0000664000175000017500000000430113644433072013736 00000000000000/* * Copyright (C) 2004-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/connectable.h" #include "cxxtools/connection.h" #include "cxxtools/log.h" log_define("cxxtools.connectable") namespace cxxtools { Connectable::~Connectable() { this->clear(); } void Connectable::clear() { while( !_connections.empty() ) { Connection* c = &_connections.front(); c->close(); if (&_connections.front() == c) { // this should not really happen but just in case we do not want to loop endlessly log_fatal("connection " << static_cast(c) << " was not removed from " << static_cast(this)); _connections.pop_front(); } } } void Connectable::onConnectionOpen(const Connection& c) { _connections.push_back(c); } void Connectable::onConnectionClose(const Connection& c) { _connections.remove(c); } } // namespace cxxtools cxxtools-3.0/src/facets.cpp0000664000175000017500000000505513644433072012735 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace std { locale::id numpunct::id; numpunct::numpunct(size_t refs) : locale::facet(refs) { } numpunct::~numpunct() { } cxxtools::Char numpunct::decimal_point() const { return this->do_decimal_point(); } cxxtools::Char numpunct::thousands_sep() const { return this->do_thousands_sep(); } string numpunct::grouping() const { return this->do_grouping(); } cxxtools::String numpunct::truename() const { return this->do_truename(); } cxxtools::String numpunct::falsename() const { return this->do_falsename(); } cxxtools::Char numpunct::do_decimal_point() const { return '.'; } cxxtools::Char numpunct::do_thousands_sep() const { return ','; } std::string numpunct::do_grouping() const { return ""; } cxxtools::String numpunct::do_truename() const { static const cxxtools::Char truename[] = {'t', 'r', 'u', 'e', '\0'}; return truename; } cxxtools::String numpunct::do_falsename() const { static const cxxtools::Char falsename[] = {'f', 'a', 'l', 's', 'e', '\0'}; return falsename; } } cxxtools-3.0/src/condition.cpp0000664000175000017500000000355613644433072013462 00000000000000/* * Copyright (C) 2005-2006 by Dr Marc Boris Duerner * Copyright (C) 2005-2006 by Sebastian Pieck * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "conditionimpl.h" #include "cxxtools/condition.h" namespace cxxtools { Condition::Condition() { _impl = new ConditionImpl(); } Condition::~Condition() { delete _impl; } void Condition::wait(Mutex& mtx) { _impl->wait(mtx); } bool Condition::wait(Mutex& mtx, const Milliseconds& ts) { return _impl->wait(mtx, ts); } void Condition::signal() { _impl->signal(); } void Condition::broadcast() { _impl->broadcast(); } } // !namespace cxxtools cxxtools-3.0/src/systemerror.cpp0000664000175000017500000000725013644433072014065 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2005-2007 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/systemerror.h" #include "cxxtools/mutex.h" #include "cxxtools/log.h" #include "config.h" #ifdef WITH_SSL #include #include #endif #include #include "error.h" log_define("cxxtools.systemerror") namespace cxxtools { SystemError::SystemError(const std::string& msg) : std::runtime_error(msg), m_errno(0) { log_finer("system error: " << what()); } SystemError::SystemError(int err, const char* fn) : std::runtime_error(getErrnoString(err, fn)), m_errno(err) { log_finer("system error: " << what()); } SystemError::SystemError(const char* fn) : std::runtime_error(getErrnoString(fn)), m_errno(errno) { log_finer("system error: " << what()); } SystemError::SystemError(const char* fn, const std::string& what) : std::runtime_error(fn && fn[0] ? (std::string("function ") + fn + " failed: " + what) : what), m_errno(0) { log_finer("system error: " << std::exception::what()); } SystemError::~SystemError() throw() { } void throwSystemError(const char* fn) { throw SystemError(fn); } void throwSystemError(int errnum, const char* fn) { throw SystemError(errnum, fn); } OpenLibraryFailed::OpenLibraryFailed(const std::string& msg) : SystemError(msg) { log_finer("open library failed: " << what()); } SymbolNotFound::SymbolNotFound(const std::string& sym) : SystemError(0, "symbol not found: " + sym), _symbol(sym) { log_finer("symbol " << sym << " not found; " << what()); } void SslError::checkSslError() { #ifdef WITH_SSL static Mutex mutex; static bool errorStringsLoaded = false; unsigned long code = ERR_get_error(); if (code != 0) { if (!errorStringsLoaded) { MutexLock lock(mutex); if (!errorStringsLoaded) { log_debug("SSL_load_error_strings"); SSL_load_error_strings(); errorStringsLoaded = true; } } char buffer[120]; if (ERR_error_string(code, buffer)) { log_debug("SSL-Error " << code << ": \"" << buffer << '"'); throw SslError(buffer, code); } else { log_debug("unknown SSL-Error " << code); throw SslError("unknown SSL-Error", code); } } #endif } } // namespace cxxtools cxxtools-3.0/src/iniparser.cpp0000664000175000017500000002135513644433072013465 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include log_define("cxxtools.iniparser") namespace cxxtools { bool IniParser::Event::onSection(const String& section) { return onSection(Utf8Codec::encode(section)); } bool IniParser::Event::onKey(const String& key) { return onKey(Utf8Codec::encode(key)); } bool IniParser::Event::onValue(const String& value) { return onValue(Utf8Codec::encode(value)); } bool IniParser::Event::onComment(const String& /*comment*/) { return false; } bool IniParser::Event::onError() { throw std::runtime_error("parse error in ini-file"); return true; } bool IniParser::Event::onKey(const std::string& key) { return false; } bool IniParser::Event::onSection(const std::string& section) { return false; } bool IniParser::Event::onValue(const std::string& value) { return false; } void IniParser::parse(std::istream& in, TextCodec* codec) { TextIStream tin(in, codec); parse(tin); } void IniParser::parse(std::basic_istream& in) { Char ch; int ret; while (in.get(ch)) { ret = parse(ch); if (ret == -1) in.putback(ch); if (ret != 0) break; } if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("parsing ini file failed"); end(); } bool IniParser::parse(Char ch) { bool ret = false; switch (state) { case state_0: if (ch == L'[') state = state_section; else if (std::isalnum(ch)) { data = ch; state = state_key; } else if (ch == L'#' || ch == L';') { state = state_comment; } else if (std::isspace(ch)) ; else { log_debug("onError"); ret = event.onError(); } break; case state_section: if (ch == L']') { log_debug("onSection(" << data << ')'); ret = event.onSection(data); data.clear(); state = state_0; } else data += ch; break; case state_key: if (ch == L'=') { log_debug("onKey(" << data << ')'); ret = event.onKey(data); data.clear(); state = state_value0; } else if (std::isspace(ch)) { log_debug("onKey(" << data << ')'); ret = event.onKey(data); data.clear(); state = state_key_sp; } else data += ch; break; case state_key_sp: if (ch == L'=') state = state_value0; else if (!std::isspace(ch)) { log_debug("onError"); ret = event.onError(); } break; case state_value0: if (ch == '\n') { log_debug("onValue(\"\")"); ret = event.onValue(String()); state = state_0; } else if (ch == '\'') { data.clear(); state = state_valuesq; } else if (ch == '"') { data.clear(); state = state_valuedq; } else if (ch == '\\') state = state_valueesc; else if (!std::isspace(ch)) { data = ch; state = state_value; } break; case state_value: if (ch == '\n') { log_debug("onValue(" << data << ')'); rtrimi(data); ret = event.onValue(data); data.clear(); state = state_0; } else if (ch == '\\') state = state_valueesc; else data += ch; break; case state_valueesc: if (ch == 'b') data += '\b'; else if (ch == 'f') data += '\f'; else if (ch == 'n') data += '\n'; else if (ch == 'r') data += '\r'; else if (ch == 't') data += '\t'; else data += ch; state = state_value; break; case state_valuesq: if (ch == '\'') { log_debug("onValue(" << data << ')'); ret = event.onValue(data); data.clear(); state = state_valueqend; } else if (ch == '\\') state = state_valuesqesc; else data += ch; break; case state_valuesqesc: if (ch == 'b') data += '\b'; else if (ch == 'f') data += '\f'; else if (ch == 'n') data += '\n'; else if (ch == 'r') data += '\r'; else if (ch == 't') data += '\t'; else data += ch; state = state_valuesq; break; case state_valuedq: if (ch == '"') { log_debug("onValue(" << data << ')'); ret = event.onValue(data); data.clear(); state = state_valueqend; } else if (ch == '\\') state = state_valuedqesc; else data += ch; break; case state_valuedqesc: if (ch == 'b') data += '\b'; else if (ch == 'f') data += '\f'; else if (ch == 'n') data += '\n'; else if (ch == 'r') data += '\r'; else if (ch == 't') data += '\t'; else data += ch; state = state_valuedq; break; case state_valueqend: if (ch == '\n') state = state_0; else if (ch == L'#' || ch == L';') state = state_comment; else if (!std::isspace(ch)) ret = event.onError(); break; case state_comment: if (ch == '\n') state = state_0; break; } return ret; } void IniParser::end() { switch (state) { case state_0: case state_valueqend: case state_comment: break; case state_section: case state_key: case state_key_sp: case state_valueesc: case state_valuesq: case state_valuesqesc: case state_valuedq: case state_valuedqesc: log_debug("onError"); event.onError(); break; case state_value0: log_debug("onValue(\"\")"); event.onValue(String()); data.clear(); break; case state_value: log_debug("onValue(" << data << ')'); event.onValue(data); data.clear(); break; } } } cxxtools-3.0/src/iconvstream.cpp0000664000175000017500000001556713644433072014033 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iconvstream.h" #include "cxxtools/log.h" #include #include "config.h" #include #include #include log_define("cxxtools.iconvstream") namespace cxxtools { iconv_error::iconv_error(size_t pos) : std::runtime_error(std::string()), pos(pos) { } size_t iconv_error::position() const throw() { return pos; } const char *iconv_error::what() const throw() { if (msg.empty()) { std::ostringstream ss; ss << "iconv failed to convert character at position: " << pos; msg = ss.str(); } return msg.c_str(); } iconv_error::~iconv_error() throw() { } iconvstreambuf* iconvstreambuf::open(std::ostream& sink_, const char* tocode, const char* fromcode) { open(sink_, tocode, fromcode, iconvstreambuf::mode_default); return this; } iconvstreambuf* iconvstreambuf::open(std::ostream& sink_, const char* tocode, const char* fromcode, mode_t mode_) { log_debug("iconv_open(\"" << tocode << "\", \"" << fromcode << "\", " << mode_ << ")"); mode = mode_; sink = &sink_; pos = 0; if (!conv.open(tocode, fromcode)) { if (errno == EINVAL) { std::string msg = "conversion not supported; from=\""; msg += fromcode; msg += "\" to \""; msg += tocode; log_warn(msg); throw std::runtime_error(msg); } return 0; } log_debug("iconv-opened"); return this; } iconvstreambuf* iconvstreambuf::close() throw() { if (conv.is_open()) { sync(); log_debug("iconv.close(...)"); if (conv.close()) { return this; } else return 0; } else return this; } iconvstreambuf::int_type iconvstreambuf::overflow(int_type c) { log_debug("overflow(" << c << ')'); if (sink == 0) { log_error("no sink"); return traits_type::eof(); } else if (pptr() == 0 || pptr() == buffer) { log_debug("empty put-area"); if (c != traits_type::eof()) { if (pptr() == 0) { log_debug("initialize buffer"); setp(buffer, buffer + (sizeof(buffer) - 1)); } *pptr() = (char_type)c; pbump(1); } return 0; } else { char outbuf[sizeof(buffer)*2];; size_t inbytesleft = pptr() - buffer; if (c != traits_type::eof()) { *pptr() = (char_type)c; ++inbytesleft; } size_t outbytesleft = sizeof(outbuf); ICONV_CONST char* inbufptr = buffer; char* outbufptr = outbuf; // convert as many charachters as possible log_debug("iconv(...) " << inbytesleft << " bytes"); bool iconv_ret = conv.convert(&inbufptr, &inbytesleft, &outbufptr, &outbytesleft); pos += inbufptr - buffer; iconv_ret = iconv_ret || errno == EINVAL || errno == E2BIG; log_debug("pass " << outbufptr - outbuf << " bytes to sink"); sink->write(outbuf, outbufptr - outbuf); if (sink->fail()) { log_warn("sink failed"); return traits_type::eof(); } log_debug("reinitialize put area"); setp(buffer, buffer + (sizeof(buffer) - 1)); if (!iconv_ret) { switch (mode) { case iconvstreambuf::mode_skip: log_warn("convert failed, skipping byte"); --inbytesleft; ++inbufptr; break; case iconvstreambuf::mode_throw: log_warn("convert failed, throwing exception"); throw iconv_error(pos); default: return traits_type::eof(); } } // move left bytes to the start of buffer and reinitialize buffer if (inbytesleft > 0) { log_debug("move " << inbytesleft << " bytes to the start"); sputn(inbufptr, inbytesleft); } return 0; } } iconvstream::int_type iconvstreambuf::underflow() { log_warn("underflow not supported in iconvstreambuf"); return traits_type::eof(); } int iconvstreambuf::sync() { log_debug("sync"); if (pptr() == 0 || pptr() == buffer) return 0; else if (sink) { size_t ob, ob2; int_type ret; do { ob = pptr() - buffer; ret = overflow(traits_type::eof()); ob2 = pptr() - buffer; } while (ob2 > 0 && ob2 < ob); log_debug("flush sink"); sink->flush(); return ret == traits_type::eof() || sink->fail() ? -1 : 0; } else { log_warn("no sink"); return 0; } } std::streampos iconvstreambuf::seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which) { // modify off to by relative position from current position switch (way) { case std::ios_base::beg: off -= pos; case std::ios_base::cur: break; default: return std::streampos(-1); } if (which == std::ios_base::in) { char *buf_p = gptr() + off; // alow seek only on valid data if (buf_p < eback() || buf_p > pptr()) return std::streampos(-1); gbump(off); pos += off; return pos; } if (which == std::ios_base::out) { char *buf_p = pptr() + off; // alow seek only on valid data if (buf_p < pbase() || buf_p > pptr()) return std::streampos(-1); pbump(off); return pos + off; } return std::streampos(-1); } std::streampos iconvstreambuf::seekpos(std::streampos sp, std::ios_base::openmode which) { return seekoff(sp, std::ios_base::beg, which); } void iconvstream::open(std::ostream& sink_, const char* tocode, const char* fromcode) { open(sink_, tocode, fromcode, iconvstreambuf::mode_default); } void iconvstream::open(std::ostream& sink_, const char* tocode, const char* fromcode, iconvstreambuf::mode_t mode) { if (!fail() && streambuf.open(sink_, tocode, fromcode, mode) == 0) setstate(std::ios::failbit); } } cxxtools-3.0/src/tcpserverimpl.h0000664000175000017500000000572113644433072014034 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TCPSERVERIMPL_H #define CXXTOOLS_NET_TCPSERVERIMPL_H #include "selectableimpl.h" #include #include #include #include #include #include "config.h" namespace cxxtools { class SelectorBase; namespace net { class TcpServer; class TcpServerImpl : public SelectableImpl { private: TcpServer& _server; struct Listener { int _fd; struct sockaddr_storage _servaddr; }; typedef std::vector Listeners; Listeners _listeners; int _pendingAccept; pollfd* _pfd; int _wakePipe[2]; #ifdef HAVE_TCP_DEFER_ACCEPT bool _deferAccept; #endif int create(int domain, int type, int protocol); public: TcpServerImpl(TcpServer& server); ~TcpServerImpl(); void close(); void listen(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags); void terminateAccept(); #ifdef HAVE_TCP_DEFER_ACCEPT void deferAccept(bool sw); #endif bool wait(Timespan timeout); void attach(SelectorBase& s); void detach(SelectorBase& s); // implementation using poll std::size_t pollSize() const; // implementation using poll std::size_t initializePoll(pollfd* pfd, std::size_t pollSize); // implementation using poll bool checkPollEvent(); int accept(int flags, struct sockaddr* sa, socklen_t& sa_len); }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_TCPSERVERIMPL_H cxxtools-3.0/src/csvformatter.cpp0000664000175000017500000001520113644433072014201 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include log_define("cxxtools.csv.formatter") namespace cxxtools { CsvFormatter::CsvFormatter(std::ostream& os, TextCodec* codec) : _firstline(true), _collectTitles(true), _level(0), _delimiter(L","), _quote('"'), _lineEnding(L"\n"), _ts(new TextOStream(os, codec)), _os(*_ts) { } CsvFormatter::CsvFormatter(TextOStream& os) : _firstline(true), _collectTitles(true), _level(0), _delimiter(L","), _quote('"'), _lineEnding(L"\n"), _ts(0), _os(os) { } CsvFormatter::~CsvFormatter() { delete _ts; } void CsvFormatter::selectColumn(const std::string& title) { _titles.resize(_titles.size() + 1); _titles.back()._memberName = title; _titles.back()._title = title; _collectTitles = false; } void CsvFormatter::selectColumn(const std::string& memberName, const std::string& title) { _titles.resize(_titles.size() + 1); _titles.back()._memberName = memberName; _titles.back()._title = title; _collectTitles = false; } void CsvFormatter::toCsvData(String& ret, const std::string& /*type*/, const String& value) { if (value.find(Char(_quote)) == String::npos && value.find(_delimiter) == String::npos && value.find(_lineEnding) == String::npos) { ret = value; } else { ret.clear(); ret += _quote; for (String::const_iterator it = value.begin(); it != value.end(); ++it) { if (*it == _quote) { ret += _quote; ret += _quote; } else ret += *it; } ret += _quote; } } void CsvFormatter::dataOut() { if (_firstline) { if (!_titles.empty()) { log_debug("print " << _titles.size() << " titles"); for (unsigned n = 0; n < _titles.size(); ++n) { if (n > 0) _os << _delimiter; _os << String(_titles[n]._title); } _os << _lineEnding; } _firstline = false; _collectTitles = false; } log_debug("output " << _data.size() << " columns"); for (unsigned n = 0; n < _data.size(); ++n) { if (n > 0) _os << _delimiter; _os << _data[n]; } _os << _lineEnding; _data.clear(); } void CsvFormatter::addValueString(const std::string& /*name*/, const std::string& type, const String& value) { if (_memberName.empty()) { log_debug("addValue plain value \"" << value << '"'); _data.push_back(String()); toCsvData(_data.back(), type, value); } else { log_debug("addValue member \"" << _memberName << "\" value \"" << value << '"'); for (unsigned n = 0; n < _titles.size(); ++n) { if (_titles[n]._memberName == _memberName) { log_debug("column " << n); if (_data.size() <= n) _data.resize(n + 1); toCsvData(_data[n], type, value); _memberName.clear(); break; } } } } void CsvFormatter::beginArray(const std::string& /*name*/, const std::string& /*type*/) { ++_level; log_debug("beginArray, level=" << _level); } void CsvFormatter::finishArray() { --_level; log_debug("finishArray, level=" << _level); if (_level == 1) dataOut(); } void CsvFormatter::beginObject(const std::string& /*name*/, const std::string& /*type*/) { ++_level; log_debug("beginObject, level=" << _level); } void CsvFormatter::beginMember(const std::string& name) { log_debug("beginMember " << name); if (_collectTitles && _firstline && _level == 2) { log_debug("add title " << name); _titles.resize(_titles.size() + 1); _titles.back()._title = name; _titles.back()._memberName = name; } _memberName = name; } void CsvFormatter::finishMember() { log_debug("finishMember"); _memberName.clear(); } void CsvFormatter::finishObject() { --_level; log_debug("finishObject, level=" << _level); if (_level == 1) dataOut(); } void CsvFormatter::finish() { log_debug("finish"); if (_firstline && !_titles.empty()) { log_debug("print " << _titles.size() << " titles"); for (unsigned n = 0; n < _titles.size(); ++n) { if (n > 0) _os << _delimiter; _os << String(_titles[n]._title); } _os << _lineEnding; } _os.flush(); } } cxxtools-3.0/src/Makefile.am0000664000175000017500000000642613644433072013023 00000000000000AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools.la libcxxtools_la_SOURCES = \ addrinfo.cpp \ addrinfoimpl.cpp \ application.cpp \ applicationimpl.cpp \ base64codec.cpp \ csvdeserializer.cpp \ csvformatter.cpp \ csvparser.cpp \ char.cpp \ charmapcodec.cpp \ clock.cpp \ clockimpl.cpp \ condition.cpp \ conditionimpl.cpp \ connectable.cpp \ connection.cpp \ cgi.cpp \ conversionerror.cpp \ convert.cpp \ date.cpp \ datetime.cpp \ dateutils.cpp \ decomposer.cpp \ deserializer.cpp \ directory.cpp \ directoryimpl.cpp \ envsubst.cpp \ error.cpp \ eventloop.cpp \ eventsink.cpp \ eventsource.cpp \ fdstream.cpp \ file.cpp \ filedevice.cpp \ filedeviceimpl.cpp \ fileimpl.cpp \ fileinfo.cpp \ formatter.cpp \ hdstream.cpp \ inideserializer.cpp \ inifile.cpp \ iniparser.cpp \ iniserializer.cpp \ iodevice.cpp \ iodeviceimpl.cpp \ ioerror.cpp \ iostream.cpp \ iso8859_codec.cpp \ jsondeserializer.cpp \ jsonformatter.cpp \ jsonparser.cpp \ library.cpp \ libraryimpl.cpp \ log.cpp \ md5.c \ md5stream.cpp \ mime.cpp \ multifstream.cpp \ mutex.cpp \ muteximpl.cpp \ pipe.cpp \ pipeimpl.cpp \ posix/commandinput.cpp \ posix/commandoutput.cpp \ posix/daemonize.cpp \ posix/fork.cpp \ posix/pipestream.cpp \ posix/posixpipe.cpp \ propertiesfile.cpp \ propertiesparser.cpp \ propertiesdeserializer.cpp \ propertiesserializer.cpp \ query_params.cpp \ quotedprintablecodec.cpp \ regex.cpp \ remoteclient.cpp \ selectable.cpp \ selector.cpp \ selectorimpl.cpp \ semaphore.cpp \ semaphoreimpl.cpp \ serviceregistry.cpp \ settings.cpp \ settingsreader.cpp \ settingswriter.cpp \ serializationerror.cpp \ serializationinfo.cpp \ signal.cpp \ sslcertificate.cpp \ stddevice.cpp \ streambuffer.cpp \ string.cpp \ stringstream.cpp \ systemerror.cpp \ tee.cpp \ textbuffer.cpp \ textcodec.cpp \ textstream.cpp \ thread.cpp \ threadimpl.cpp \ threadpool.cpp \ threadpoolimpl.cpp \ time.cpp \ timer.cpp \ timespan.cpp \ uri.cpp \ utf8codec.cpp \ uuencode.cpp \ net.cpp \ tcpserverimpl.cpp \ tcpserver.cpp \ tcpsocket.cpp \ tcpsocketimpl.cpp \ tcpstream.cpp \ tz.cpp \ udp.cpp \ udpstream.cpp \ win1252codec.cpp \ xml/characters.cpp \ xml/endelement.cpp \ xml/entityresolver.cpp \ xml/namespacecontext.cpp \ xml/startelement.cpp \ xml/xmldeserializer.cpp \ xml/xmlerror.cpp \ xml/xmlformatter.cpp \ xml/xmlreader.cpp \ xml/xmlserializer.cpp \ xml/xmlwriter.cpp noinst_HEADERS = \ addrinfoimpl.h \ applicationimpl.h \ clockimpl.h \ conditionimpl.h \ dateutils.h \ directoryimpl.h \ error.h \ facets.cpp \ fileimpl.h \ filedeviceimpl.h \ fileinfoimpl.h \ iodeviceimpl.h \ libraryimpl.h \ md5.h \ muteximpl.h \ pipeimpl.h \ selectableimpl.h \ selectorimpl.h \ semaphoreimpl.h \ settingsreader.h \ settingswriter.h \ sslcertificateimpl.h \ tcpserverimpl.h \ tcpsocketimpl.h \ threadimpl.h \ threadpoolimpl.h \ unicode.h if MAKE_ICONVSTREAM libcxxtools_la_SOURCES += \ iconvwrap.cpp \ iconvstream.cpp endif libcxxtools_la_LIBADD = $(LIBICONV) libcxxtools_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ if MAKE_OPENSSL libcxxtools_la_LDFLAGS += -lssl libcxxtools_la_SOURCES += \ sslcertificateimpl.cpp endif cxxtools-3.0/src/mime.cpp0000664000175000017500000005201513644433072012415 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include log_define("cxxtools.mime") namespace cxxtools { namespace { int compareIgnoreCase(const std::string& s1, const std::string& s2) { std::string::const_iterator it1 = s1.begin(); std::string::const_iterator it2 = s2.begin(); while (it1 != s1.end() && it2 != s2.end()) { if (*it1 != *it2) { char c1 = std::toupper(*it1); char c2 = std::toupper(*it2); if (c1 < c2) return -1; else if (c2 < c1) return 1; } ++it1; ++it2; } return it1 != s1.end() ? 1 : it2 != s2.end() ? -1 : 0; } std::string chartoprint(char ch) { const static char hex[] = "0123456789abcdef"; if (std::isprint(ch)) return std::string(1, '\'') + ch + '\''; else return std::string("'\\x") + hex[(ch >> 4) & 0xf] + hex[ch & 0xf] + '\''; } class HeaderParser { private: typedef void (HeaderParser::*state_type)(char); void state_h0(char ch); void state_hcr(char ch); void state_hfieldname(char ch); void state_hfieldnamespace(char ch); void state_hfieldbody0(char ch); void state_hfieldbody(char ch); void state_hfieldbody_cr(char ch); void state_hfieldbody_crlf(char ch); void state_hend_cr(char ch); void state_end(char ch); state_type state; MimeHeader& mm; std::string key; std::string value; public: explicit HeaderParser(MimeHeader& mm_) : state(&HeaderParser::state_h0), mm(mm_) { } /// parses a single character and returns true, if message is finished bool parse(char ch) { (this->*state)(ch); return state == &HeaderParser::state_end; } }; void HeaderParser::state_h0(char ch) { if (ch == ' ' || ch == '\t') { } else if (ch > 32 && ch < 127) { key.reserve(32); key = ch; state = &HeaderParser::state_hfieldname; } else if (ch == '\r') { state = &HeaderParser::state_hcr; } else if (ch == '\n') { state = &HeaderParser::state_end; } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in mime header"); } } void HeaderParser::state_hcr(char ch) { if (ch == '\n') { state = &HeaderParser::state_end; } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in mime header"); } } void HeaderParser::state_hfieldname(char ch) { if (ch == ':') { state = &HeaderParser::state_hfieldbody0; } else if (ch == ' ' || ch == '\t') { state = &HeaderParser::state_hfieldnamespace; } else if (ch > 32 && ch < 127) { key += ch; } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in fieldname"); } } void HeaderParser::state_hfieldnamespace(char ch) { if (ch == ':') { state = &HeaderParser::state_hfieldbody0; } else if (ch == ' ' || ch == '\t') { } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in fieldname"); } } void HeaderParser::state_hfieldbody0(char ch) { if (ch == '\r') { value.clear(); state = &HeaderParser::state_hfieldbody_cr; } else if (ch == '\n') { value.clear(); state = &HeaderParser::state_hfieldbody_crlf; } else if (!std::isspace(ch)) { value.reserve(32); value = ch; state = &HeaderParser::state_hfieldbody; } } void HeaderParser::state_hfieldbody(char ch) { if (ch == '\r') { state = &HeaderParser::state_hfieldbody_cr; } else if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; } else { value += ch; } } void HeaderParser::state_hfieldbody_cr(char ch) { if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in field body"); } } void HeaderParser::state_hfieldbody_crlf(char ch) { if (ch == ' ' || ch == '\t') { // continuation line value += ch; state = &HeaderParser::state_hfieldbody; } else { log_debug("header key=\"" << key << "\" value=\"" << value << '"'); mm.setHeader(key, value); if (ch == '\r') { state = &HeaderParser::state_hend_cr; } else if (ch == '\n') { state = &HeaderParser::state_end; } else if (ch > 32 && ch < 127) { key.reserve(32); key = ch; state = &HeaderParser::state_hfieldname; } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in field body"); } } } void HeaderParser::state_hend_cr(char ch) { if (ch == '\n') { state = &HeaderParser::state_end; } else { throw std::runtime_error("invalid character " + chartoprint(ch) + " in field body"); } } void HeaderParser::state_end(char /*ch*/) { } struct TypeBoundary { std::string type; std::string boundary; }; TypeBoundary getTypeBoundary(const std::string& ct) { static Regex mpr("^multipart/([^;]+).*;[[:space:]]*boundary=(\"([^\"]+)\"|([^][ ()<>@,;:\\\"/?=]+))"); RegexSMatch sm; TypeBoundary ret; if (mpr.match(ct, sm)) { ret.type = sm[1]; ret.boundary = sm[sm.offsetEnd(3) > sm.offsetBegin(3) ? 3 : 4]; } return ret; } } //////////////////////////////////////////////////////////////////////// // MimeHeader // std::string MimeHeader::getHeader(const std::string& key, const std::string& def) const { for (HeadersType::const_iterator it = headers.begin(); it != headers.end(); ++it) if (compareIgnoreCase(key, it->first) == 0) return it->second; return def; } void MimeHeader::setHeader(const std::string& key, const std::string& value, bool replace) { if (replace) unsetHeader(key); addHeader(key, value); } void MimeHeader::unsetHeader(const std::string& key) { for (HeadersType::size_type n = 0; n < headers.size(); ) { if (compareIgnoreCase(key, headers[n].first) == 0) headers.erase(headers.begin() + n); else ++n; } } bool MimeHeader::isMultipart() const { return !getTypeBoundary(getHeader("Content-Type")).boundary.empty(); } void operator<<= (SerializationInfo& si, const MimeHeader& mh) { si.setTypeName("mimeHeader"); for (MimeHeader::HeadersType::const_iterator it = mh.headers.begin(); it != mh.headers.end(); ++it) si.addMember(it->first) <<= it->second; } void operator>>= (const SerializationInfo& si, MimeHeader& mh) { std::string value; for (cxxtools::SerializationInfo::const_iterator it = si.begin(); it != si.end(); ++it) { it->getValue(value); mh.addHeader(it->name(), value); } } //////////////////////////////////////////////////////////////////////// // MimeEntity // MimeEntity::MimeEntity(const std::string& data) { HeaderParser headerParser(*this); std::string::size_type pos; for (pos = 0; pos < data.size(); ++pos) { if (headerParser.parse(data[pos])) { ++pos; break; } } // decode data std::string contentTransferEncoding = getHeader("Content-Transfer-Encoding"); if (contentTransferEncoding == "quoted-printable") { body = QuotedPrintableCodec::decode(data.c_str() + pos, data.size() - pos); } else if (contentTransferEncoding == "base64") { body = Base64Codec::decode(data.c_str() + pos, data.size() - pos); } else { body.assign(data, pos, std::string::npos); } } MimeEntity::MimeEntity(std::istream& in) { HeaderParser headerParser(*this); // parse mime headers char ch; while (in.get(ch)) { if (headerParser.parse(ch)) break; } // copy rest of data to body readBody(in); } MimeEntity& MimeEntity::readBody(std::istream& in) { char buffer[512]; while (in) { in.read(buffer, 512); body.append(buffer, in.gcount()); } // decode data std::string contentTransferEncoding = getHeader("Content-Transfer-Encoding"); if (contentTransferEncoding == "quoted-printable") { body = QuotedPrintableCodec::decode(body); } else if (contentTransferEncoding == "base64") { body = Base64Codec::decode(body); } return *this; } MimeEntity& MimeEntity::setContentTransferEncoding(ContentTransferEncoding cte) { if (cte == MimeEntity::quotedPrintable) setHeader("Content-Transfer-Encoding", "quoted-printable"); else if (cte == MimeEntity::base64) setHeader("Content-Transfer-Encoding", "base64"); else unsetHeader("Content-Transfer-Encoding"); return *this; } MimeEntity::ContentTransferEncoding MimeEntity::getContentTransferEncoding() const { std::string contentTransferEncoding = getHeader("Content-Transfer-Encoding"); return contentTransferEncoding == "base64" ? MimeEntity::base64 : contentTransferEncoding == "quoted-printable" ? MimeEntity::quotedPrintable : MimeEntity::none; } void operator<<= (SerializationInfo& si, const MimeEntity& mo) { si.setTypeName("mimeEntity"); if (mo.isMultipart()) { si <<= MimeMultipart(mo); } else { si.addMember("header") <<= static_cast(mo); si.addMember("body") <<= mo.body; } } void operator>>= (const SerializationInfo& si, MimeEntity& mo) { si.getMember("header") >>= static_cast(mo); if (!si.getMember("body", mo.body)) { std::vector parts; si.getMember("parts") >>= parts; std::ostringstream out; typedef std::vector SpartsType; SpartsType sparts; std::string boundary = MimeMultipart::stringParts(parts, sparts); // print parts for (SpartsType::const_iterator it = sparts.begin(); it != sparts.end(); ++it) out << "--" << boundary << "\r\n" << *it; out << "--" << boundary << "--\r\n"; mo.body = out.str(); std::string type; si.getMember("type") >>= type; std::string contentType = type; contentType += ";boundary=\""; contentType += boundary; contentType += '"'; mo.setHeader("Content-Type", contentType); } } //////////////////////////////////////////////////////////////////////// // MimeMultipart // void MimeMultipart::setType(Type type_) { switch (type_) { case typeMixed: type = "mixed"; break; case typeAlternative: type = "alternative"; break; case typeDigest: type = "digest"; break; case typeParallel: type = "parallel"; break; case typeRelated: type = "related"; break; } } void MimeMultipart::partsFromBody(const std::string& body, std::string::size_type pos) { TypeBoundary tb = getTypeBoundary(getHeader("Content-Type")); if (tb.boundary.empty()) throw std::runtime_error("data is no mime multipart"); // multipart type = tb.type; std::string boundary = "--"; boundary += tb.boundary; pos = body.find(boundary, pos); if (pos != std::string::npos && body.size() > pos + boundary.size() + 2) { if (body[pos + boundary.size()] == '\n') pos += boundary.size() + 1; else if (body[pos + boundary.size()] == '\r' && body[pos + boundary.size() + 1] == '\n') pos += boundary.size() + 2; else return; std::string::size_type posEnd; while ((posEnd = body.find(boundary, pos)) != std::string::npos) { parts.resize(parts.size() + 1); MimeEntity& part = parts.back(); HeaderParser headerParser(part); for (; pos < posEnd; ++pos) { if (headerParser.parse(body[pos])) { ++pos; break; } } std::string contentTransferEncoding = part.getHeader("Content-Transfer-Encoding"); if (contentTransferEncoding == "base64") part.setBody(Base64Codec::decode(body.c_str() + pos, posEnd - pos)); else if (contentTransferEncoding == "quoted-printable") part.setBody(QuotedPrintableCodec::decode(body.c_str() + pos, posEnd - pos)); else part.getBody().assign(body, pos, posEnd - pos); pos = posEnd + boundary.size() + 2; if (body[posEnd + boundary.size()] == '\n') pos = posEnd + boundary.size() + 1; else if (body[posEnd + boundary.size()] == '\r' && body[posEnd + boundary.size() + 1] == '\n') pos = posEnd + boundary.size() + 2; else { log_debug("boundary not delimited by CRLF or LF"); return; } if (body[posEnd + boundary.size()] == '-' && body[posEnd + boundary.size() + 1] == '-') { log_debug("end boundary found"); break; } } } } std::string MimeMultipart::stringParts(const std::vector& parts, std::vector& sparts) { for (MimeMultipart::PartsType::const_iterator pit = parts.begin(); pit != parts.end(); ++pit) { std::ostringstream out; out << *pit; sparts.push_back(out.str()); } std::string boundary(10, '-'); while (true) { unsigned r = static_cast(std::rand()); while (r > 0) { boundary += '0' + r%10; r /= 10; } for (std::vector::const_iterator it = sparts.begin(); it != sparts.end(); ++it) if (it->find(boundary) != std::string::npos) continue; break; } return boundary; } MimeMultipart::MimeMultipart(const std::string& data) { HeaderParser headerParser(*this); std::string::size_type pos; for (pos = 0; pos < data.size(); ++pos) { if (headerParser.parse(data[pos])) { ++pos; break; } } partsFromBody(data, pos); } MimeMultipart::MimeMultipart(const MimeEntity& mimeEntity) : MimeHeader(mimeEntity) { partsFromBody(mimeEntity.getBody()); } MimeEntity& MimeMultipart::addObject(const std::string& data, const std::string& contentType, ContentTransferEncoding contentTransferEncoding) { log_debug("add part " << data.size() << " bytes, contentType \"" << contentType << "\" content transfer encoding " << contentTransferEncoding); MimeEntity& mimeEntity = addObject(); mimeEntity.setContentType(contentType); mimeEntity.setContentTransferEncoding(contentTransferEncoding); mimeEntity.getBody() = data; return mimeEntity; } MimeEntity& MimeMultipart::addObject(std::istream& in, const std::string& contentType, ContentTransferEncoding contentTransferEncoding) { log_debug("add part from stream, contentType \"" << contentType << "\" content transfer encoding " << contentTransferEncoding); MimeEntity& mimeEntity = addObject(); mimeEntity.setContentType(contentType); mimeEntity.setContentTransferEncoding(contentTransferEncoding); std::ostringstream body; body << in.rdbuf(); mimeEntity.getBody() = body.str(); return mimeEntity; } MimeEntity& MimeMultipart::addObject(const MimeMultipart& mimeMultipart) { // build string parts typedef std::vector SpartsType; SpartsType sparts; std::string boundary = stringParts(mimeMultipart.parts, sparts); // build content type header std::string contentType = "multipart/"; contentType += mimeMultipart.type; contentType += "; boundary=\""; contentType += boundary; contentType += '"'; MimeEntity& mimeEntity = addObject(); mimeEntity.setContentType(contentType); // build body for (SpartsType::const_iterator it = sparts.begin(); it != sparts.end(); ++it) mimeEntity << "--" << boundary << "\r\n" << *it; mimeEntity << "--" << boundary << "--\r\n"; return mimeEntity; } std::ostream& operator<< (std::ostream& out, const MimeHeader& mimeHeaders) { out << "MIME-Version: 1.0\r\n"; for (MimeEntity::HeadersType::const_iterator it = mimeHeaders.headers.begin(); it != mimeHeaders.headers.end(); ++it) { out << it->first << ": "; for (std::string::const_iterator c = it->second.begin(); c != it->second.end(); ++c) { out << *c; if (*c == '\n') out << ' '; } out << "\r\n"; } out << "\r\n"; return out; } std::ostream& operator<< (std::ostream& out, const MimeEntity& mimePart) { // print headers out << static_cast(mimePart); // encode data std::string contentTransferEncoding = mimePart.getHeader("Content-Transfer-Encoding"); if (contentTransferEncoding == "quoted-printable") { QuotedPrintable_ostream enc(out); enc << mimePart.getBody(); enc.flush(); } else if (contentTransferEncoding == "base64") { Base64ostream enc(out); enc << mimePart.getBody(); enc.terminate(); out << "\r\n"; } else { log_warn_if(!contentTransferEncoding.empty(), "unknown content transfer encoding \"" << contentTransferEncoding << '"'); out << mimePart.getBody(); } return out; } std::ostream& operator<< (std::ostream& out, const MimeMultipart& mime) { log_debug("output " << mime.parts.size() << " parts"); // build string parts typedef std::vector SpartsType; SpartsType sparts; std::string boundary = MimeMultipart::stringParts(mime.parts, sparts); // print headers out << "MIME-Version: 1.0\r\n" "Content-Type: multipart/" << mime.type << "; boundary=\"" << boundary << "\"\r\n"; MimeHeader mh = mime; mh.unsetHeader("MIME-Version"); mh.unsetHeader("Content-Type"); out << mh; out << "\r\n"; // print parts for (SpartsType::const_iterator it = sparts.begin(); it != sparts.end(); ++it) out << "--" << boundary << "\r\n" << *it; out << "--" << boundary << "--\r\n"; return out; } void operator<<= (SerializationInfo& si, const MimeMultipart& mm) { si.setTypeName("mimeMultipart"); si.addMember("header") <<= static_cast(mm); si.addMember("type") <<= ("multipart/" + mm.type); si.addMember("parts") <<= mm.parts; } void operator>>= (const SerializationInfo& si, MimeMultipart& mm) { si.getMember("header") >>= static_cast(mm); std::string type; if (si.getMember("type", type)) { if (type.compare(0, 10, "multipart/") != 0) throw std::runtime_error("object is no mime multipart"); mm.type.assign(type, 11, std::string::npos); } else { static Regex mpr("multipart/([^;]+)"); RegexSMatch sm; std::string contentType = mm.getHeader("Content-Type"); if (!mpr.match(contentType, sm)) throw std::runtime_error("object is no mime multipart"); mm.type = sm[1]; } si.getMember("parts") >>= mm.parts; } } cxxtools-3.0/src/semaphore.cpp0000664000175000017500000000342513644433072013452 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "semaphoreimpl.h" #include "cxxtools/semaphore.h" namespace cxxtools { Semaphore::Semaphore(unsigned int initial) { _impl = new SemaphoreImpl(initial); } Semaphore::~Semaphore() { delete _impl; } Semaphore& Semaphore::wait() { _impl->wait(); return *this; } bool Semaphore::tryWait() { return _impl->tryWait(); } Semaphore& Semaphore::post() { _impl->post(); return *this; } } // namespace cxxtools cxxtools-3.0/src/addrinfoimpl.h0000664000175000017500000000654313644433072013610 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ADDRINFO_H #define CXXTOOLS_ADDRINFO_H #include #include #include #include #include #include namespace cxxtools { namespace net { class AddrInfoImpl : public cxxtools::RefCounted { std::string _host; unsigned short _port; struct addrinfo* _ai; public: void init(const std::string& host, unsigned short port); void init(const std::string& host, unsigned short port, const addrinfo& hints); AddrInfoImpl() : _ai(0) { } AddrInfoImpl(const std::string& host, unsigned short port) : _ai(0) { init(host, port); } AddrInfoImpl(const std::string& host, unsigned short port, const addrinfo& hints) : _ai(0) { init(host, port, hints); } ~AddrInfoImpl(); class const_iterator : public std::iterator { struct addrinfo* current; public: explicit const_iterator(struct addrinfo* ai = 0) : current(ai) { } bool operator== (const const_iterator& it) const { return current == it.current; } bool operator!= (const const_iterator& it) const { return current != it.current; } const_iterator& operator++ () { current = current->ai_next; return *this; } const_iterator operator++ (int) { const_iterator ret(current); current = current->ai_next; return ret; } reference operator* () const { return *current; } pointer operator-> () const { return current; } }; const std::string& host() const; unsigned short port() const; const_iterator begin() const { return const_iterator(_ai); } const_iterator end() const { return const_iterator(); } }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_H cxxtools-3.0/src/propertiesparser.cpp0000664000175000017500000002275313644433072015105 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include namespace cxxtools { namespace { std::string mkErrorMessage(const std::string& msg, unsigned lineNo) { std::ostringstream s; s << "parsing properties failed in line " << lineNo << ": " << msg; return s.str(); } } PropertiesParserError::PropertiesParserError(const std::string& msg, unsigned lineNo) : SerializationError(mkErrorMessage(msg, lineNo)) { } void PropertiesParser::parse(std::istream& in, TextCodec* codec) { TextIStream ts(in, codec ? codec : new Utf8Codec()); parse(ts); } void PropertiesParser::parse(std::basic_istream& in) { Char ch; while (in.get(ch) && !advance(ch)) ; end(); } bool PropertiesParser::advance(Char ch) { bool ret = false; if (ch == '\n') ++_lineNo; switch (_state) { case state_0: if (ch == '#' || ch == '!') _state = state_comment; else if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n') ; else if (ch == '\\') { _key.clear(); _keypart.clear(); _state = state_key_esc; } else { _key = ch; _keypart = ch; _state = state_key; } break; case state_key: if (ch == '.') { _event.onKeyPart(_keypart); _keypart.clear(); _key += ch; } else if (ch == '\r' || ch == '\n') { ret = _event.onKeyPart(_keypart) || _event.onKey(_key) || _event.onValue(String()); _keypart.clear(); _key.clear(); } else if (std::isspace(ch.value())) { ret = _event.onKeyPart(_keypart) || _event.onKey(_key); _state = state_key_sp; } else if (ch == '=' || ch == ':') { ret = _event.onKeyPart(_keypart) || _event.onKey(_key); _state = state_value0; } else if (ch == '\\') { _state = state_key_esc; } else { _keypart += ch; _key += ch; } break; case state_key_esc: if (ch == 'u') { _unicode = 0; _unicodeCount = 0; _state = state_key_unicode; } else if (ch == 'n') { _keypart += '\n'; _key += '\n'; _state = state_key; } else if (ch == 'r') { _keypart += '\r'; _key += '\r'; _state = state_key; } else if (ch == 't') { _keypart += '\t'; _key += '\t'; _state = state_key; } else { _keypart += ch; _key += ch; _state = state_key; } break; case state_key_sp: if (ch == '=' || ch == ':') { _state = state_value0; } else if (ch == '\r' || ch == '\n') { ret = _event.onValue(String()); _keypart.clear(); _key.clear(); _state = state_key; } else if (ch == '\\') { _value.clear(); _state = state_value_esc; } else if (!std::isspace(ch.value())) { _value = ch; _state = state_value; } break; case state_value0: if (ch == '\n') { ret = _event.onValue(_value); _value.clear(); _state = state_0; } else if (ch == '\\') _state = state_value_esc; else if (!std::isspace(ch.value())) { _value = ch; _state = state_value; } break; case state_value: if (ch == '\n') { ret = _event.onValue(_value); _value.clear(); _state = state_0; } else if (ch == '\\') _state = state_value_esc; else if (_trim && std::isspace(ch.value())) { _space = ch; _state = state_value_space; } else _value += ch; break; case state_value_esc: if (ch == 'u') { _unicode = 0; _unicodeCount = 0; _state = state_unicode; } else if (ch == 'n') { _value += '\n'; _state = state_value; } else if (ch == 'r') { _value += '\r'; _state = state_value; } else if (ch == 't') { _value += '\t'; _state = state_value; } else if (ch == '\r' || ch == '\n') { _state = state_value_cont; } else { _value += ch; _state = state_value; } break; case state_value_cont: if (ch == '\n') { ret = _event.onValue(_value); _value.clear(); _state = state_0; } else if (ch == '\\') _state = state_value_esc; else if (!std::isspace(ch.value())) { _value += ch; _state = state_value; } break; case state_value_space: if (ch == '\n') { ret = _event.onValue(_value); _value.clear(); _state = state_0; } else if (ch == '\\') { _value += _space; _state = state_value_esc; } else if (std::isspace(ch.value())) { _space += ch; } else { _value += _space; _value += ch; _state = state_value; } break; case state_unicode: case state_key_unicode: if (ch >= '0' && ch <= '9') { _unicode = (_unicode << 4) | (ch - '0'); ++_unicodeCount; } else if (ch >= 'a' && ch <= 'f') { _unicode = (_unicode << 4) | (ch - 'a' + 10); ++_unicodeCount; } else if (ch >= 'A' && ch <= 'F') { _unicode = (_unicode << 4) | (ch - 'A' + 10); ++_unicodeCount; } else if (_unicodeCount == 0) throw PropertiesParserError(std::string("invalid unicode sequence \\u") + ch.narrow() + " in properties", _lineNo); else { if (_state == state_unicode) { _state = state_value; _value += Char(_unicode); } else { _state = state_key; _key += Char(_unicode); _keypart += Char(_unicode); } return advance(ch); } if (_unicodeCount >= 8) { if (_state == state_unicode) { _state = state_value; _value += Char(_unicode); } else { _state = state_key; _key += Char(_unicode); } return false; } break; case state_comment: if (ch == '\n') _state = state_0; break; } return ret; } void PropertiesParser::end() { switch (_state) { case state_value0: case state_value: case state_value_cont: case state_value_esc: case state_key_sp: _event.onValue(_value); _value.clear(); break; case state_value_space: _event.onValue(_value + _space); _value.clear(); break; case state_key: _event.onKeyPart(_keypart) || _event.onKey(_key) || _event.onValue(String()); break; case state_unicode: if (_unicodeCount == 0) throw PropertiesParserError("invalid unicode sequence at end of json", _lineNo); _value += Char(_unicode); _event.onValue(_value); _value.clear(); break; case state_0: case state_comment: break; case state_key_esc: case state_key_unicode: throw PropertiesParserError("parse error while reading key " + Utf8Codec::encode(_key) + " in properties", _lineNo); } } } cxxtools-3.0/src/bin/0000775000175000017500000000000013672344760011615 500000000000000cxxtools-3.0/src/bin/Makefile.in0000664000175000017500000005706513644433103013604 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_bin_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_libcxxtools_bin_la_OBJECTS = deserializer.lo formatter.lo \ responder.lo socket.lo rpcclient.lo rpcclientimpl.lo \ rpcserver.lo rpcserverimpl.lo scanner.lo parser.lo worker.lo libcxxtools_bin_la_OBJECTS = $(am_libcxxtools_bin_la_OBJECTS) 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 = libcxxtools_bin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcxxtools_bin_la_LDFLAGS) \ $(LDFLAGS) -o $@ 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/deserializer.Plo \ ./$(DEPDIR)/formatter.Plo ./$(DEPDIR)/parser.Plo \ ./$(DEPDIR)/responder.Plo ./$(DEPDIR)/rpcclient.Plo \ ./$(DEPDIR)/rpcclientimpl.Plo ./$(DEPDIR)/rpcserver.Plo \ ./$(DEPDIR)/rpcserverimpl.Plo ./$(DEPDIR)/scanner.Plo \ ./$(DEPDIR)/socket.Plo ./$(DEPDIR)/worker.Plo am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(libcxxtools_bin_la_SOURCES) DIST_SOURCES = $(libcxxtools_bin_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-bin.la noinst_HEADERS = \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_bin_la_SOURCES = \ deserializer.cpp \ formatter.cpp \ responder.cpp \ socket.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ parser.cpp \ worker.cpp libcxxtools_bin_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_bin_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/bin/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-bin.la: $(libcxxtools_bin_la_OBJECTS) $(libcxxtools_bin_la_DEPENDENCIES) $(EXTRA_libcxxtools_bin_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcxxtools_bin_la_LINK) -rpath $(libdir) $(libcxxtools_bin_la_OBJECTS) $(libcxxtools_bin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deserializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclient.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclientimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserverimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/deserializer.Plo -rm -f ./$(DEPDIR)/formatter.Plo -rm -f ./$(DEPDIR)/parser.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/rpcclient.Plo -rm -f ./$(DEPDIR)/rpcclientimpl.Plo -rm -f ./$(DEPDIR)/rpcserver.Plo -rm -f ./$(DEPDIR)/rpcserverimpl.Plo -rm -f ./$(DEPDIR)/scanner.Plo -rm -f ./$(DEPDIR)/socket.Plo -rm -f ./$(DEPDIR)/worker.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/deserializer.Plo -rm -f ./$(DEPDIR)/formatter.Plo -rm -f ./$(DEPDIR)/parser.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/rpcclient.Plo -rm -f ./$(DEPDIR)/rpcclientimpl.Plo -rm -f ./$(DEPDIR)/rpcserver.Plo -rm -f ./$(DEPDIR)/rpcserverimpl.Plo -rm -f ./$(DEPDIR)/scanner.Plo -rm -f ./$(DEPDIR)/socket.Plo -rm -f ./$(DEPDIR)/worker.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES 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 uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/src/bin/scanner.cpp0000664000175000017500000000734313644433072013673 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "scanner.h" #include #include #include #include log_define("cxxtools.bin.scanner") namespace cxxtools { namespace bin { void Scanner::begin(Deserializer& handler, IComposer& composer) { _vp.begin(handler); _deserializer = &handler; _composer = &composer; _deserializer->begin(); _state = state_0; _failed = false; _errorCode = 0; _errorMessage.clear(); } bool Scanner::advance(std::streambuf& in) { while (in.in_avail()) { char ch = std::streambuf::traits_type::to_char_type(in.sgetc()); switch (_state) { case state_0: if (ch == '\xc1') { _failed = false; _state = state_value; } else if (ch == '\xc2') { _failed = true; _state = state_errorcode; _count = 4; } else throw std::runtime_error("response expected"); in.sbumpc(); break; case state_value: if (_vp.advance(in)) { log_debug(_deserializer->si()); _composer->fixup(_deserializer->si()); _deserializer->clear(); _state = state_end; } break; case state_errorcode: _errorCode = (_errorCode << 8) | ch; if (--_count == 0) _state = state_errormessage; in.sbumpc(); break; case state_errormessage: if (ch == '\0') _state = state_end; else _errorMessage += ch; in.sbumpc(); break; case state_end: if (ch == '\xff') { log_debug("reply finished"); in.sbumpc(); return true; } else throw std::runtime_error("end of response marker expected"); break; } } return false; } void Scanner::finish() { _vp.finish(); if (_failed) throw RemoteException(_errorMessage, _errorCode); } } } cxxtools-3.0/src/bin/rpcserverimpl.cpp0000664000175000017500000002164113644433072015134 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcserverimpl.h" #include "socket.h" #include "worker.h" #include #include #include log_define("cxxtools.bin.rpcserver.impl") namespace cxxtools { namespace bin { // Sent from the worker thread when a socket is idle. // The server will take that socket to the event loop. class IdleSocketEvent : public BasicEvent { Socket* _socket; public: explicit IdleSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; // Sent from the server when constructed, so that the server // knows, when the event loop is running. class ServerStartEvent : public BasicEvent { const RpcServerImpl* _server; public: explicit ServerStartEvent(const RpcServerImpl* server) : _server(server) { } const RpcServerImpl* server() const { return _server; } }; // Sent from a worker, when a job was fetched from the queue and // no further threads are left for subsequent jobs. class NoWaitingThreadsEvent : public BasicEvent { }; // Sent from the worker, when he decidid to stop, because there are // enough idle threads waiting on the queue already. class ThreadTerminatedEvent : public BasicEvent { Worker* _worker; public: explicit ThreadTerminatedEvent(Worker* worker) : _worker(worker) { } Worker* worker() const { return _worker; } }; RpcServerImpl::RpcServerImpl(EventLoopBase& eventLoop, Signal& runmodeChanged, ServiceRegistry& serviceRegistry) : _runmode(RpcServer::Stopped), _runmodeChanged(runmodeChanged), _eventLoop(eventLoop), inputSlot(slot(*this, &RpcServerImpl::onInput)), _serviceRegistry(serviceRegistry), _minThreads(5), _maxThreads(200) { _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onIdleSocket)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onNoWaitingThreads)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onThreadTerminated)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onServerStart)); connect(_eventLoop.exited, *this, &RpcServerImpl::terminate); _eventLoop.commitEvent(ServerStartEvent(this)); } RpcServerImpl::~RpcServerImpl() { if (runmode() == RpcServer::Running) { try { terminate(); } catch (const std::exception& e) { log_fatal("failed to terminate rpc server: " << e.what()); } } } void RpcServerImpl::listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) { log_info("listen on " << ip << " port " << port); net::TcpServer* listener = new net::TcpServer(ip, port, 64, net::TcpServer::DEFER_ACCEPT|net::TcpServer::REUSEADDR); try { _listener.push_back(listener); _queue.put(new Socket(*this, *listener, certificateFile, privateKeyFile, sslVerifyLevel, sslCa)); } catch (...) { delete listener; throw; } } void RpcServerImpl::start() { log_trace("start server"); runmode(RpcServer::Starting); MutexLock lock(_threadMutex); while (_threads.size() < minThreads()) { Worker* worker = new Worker(*this); _threads.insert(worker); worker->start(); } runmode(RpcServer::Running); } void RpcServerImpl::terminate() { _eventLoop.processEvents(); MutexLock lock(_threadMutex); runmode(RpcServer::Terminating); try { for (unsigned n = 0; n < _listener.size(); ++n) _listener[n]->terminateAccept(); _queue.put(0); while (!_threads.empty() || !_terminatedThreads.empty()) { if (!_threads.empty()) { _threadTerminated.wait(lock); } for (Threads::iterator it = _terminatedThreads.begin(); it != _terminatedThreads.end(); ++it) delete *it; _terminatedThreads.clear(); } for (unsigned n = 0; n < _listener.size(); ++n) delete _listener[n]; _listener.clear(); while (!_queue.empty()) delete _queue.get(); for (IdleSocket::iterator it = _idleSocket.begin(); it != _idleSocket.end(); ++it) delete *it; _idleSocket.clear(); runmode(RpcServer::Stopped); } catch (const std::exception& e) { runmode(RpcServer::Failed); } } void RpcServerImpl::noWaitingThreads() { if (runmode() == RpcServer::Running) _eventLoop.commitEvent(NoWaitingThreadsEvent()); } void RpcServerImpl::threadTerminated(Worker* worker) { MutexLock lock(_threadMutex); _threads.erase(worker); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(ThreadTerminatedEvent(worker)); } else { _terminatedThreads.insert(worker); _threadTerminated.signal(); } } void RpcServerImpl::addIdleSocket(Socket* socket) { log_debug("add idle socket " << static_cast(socket)); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(IdleSocketEvent(socket)); } else { log_debug("server not running; delete " << static_cast(socket)); delete socket; } } void RpcServerImpl::onIdleSocket(const IdleSocketEvent& event) { Socket* socket = event.socket(); log_debug("add idle socket " << static_cast(socket) << " to selector"); _idleSocket.insert(socket); socket->setSelector(&_eventLoop); socket->inputConnection = connect(socket->inputReady, inputSlot); } void RpcServerImpl::onNoWaitingThreads(const NoWaitingThreadsEvent& /*event*/) { MutexLock lock(_threadMutex); if (_threads.size() >= maxThreads()) { log_warn("thread limit " << maxThreads() << " reached"); return; } try { Worker* worker = new Worker(*this); try { log_debug("create thread " << static_cast(worker) << "; running threads=" << _threads.size()); worker->start(); _threads.insert(worker); log_debug(_threads.size() << " threads running"); } catch (const std::exception&) { delete worker; throw; } } catch (const std::exception& e) { log_warn("failed to create thread: " << e.what()); } } void RpcServerImpl::onThreadTerminated(const ThreadTerminatedEvent& event) { MutexLock lock(_threadMutex); log_debug("thread terminated (" << static_cast(event.worker()) << ") " << _threads.size() << " threads left"); try { event.worker()->join(); } catch (const std::exception& e) { log_error("failed to join thread: " << e.what()); } delete event.worker(); } void RpcServerImpl::onServerStart(const ServerStartEvent& event) { if (event.server() == this) { start(); } } void RpcServerImpl::onInput(Socket& socket) { socket.removeSelector(); log_debug("search socket " << static_cast(&socket) << " in idle socket"); _idleSocket.erase(&socket); if (socket.isConnected()) { socket.inputConnection.close(); _queue.put(&socket); } else { log_debug("onInput; delete " << static_cast(&socket)); log_info("client " << socket.getPeerAddr() << " closed connection"); delete &socket; } } } } cxxtools-3.0/src/bin/Makefile.am0000664000175000017500000000111113644433072013555 00000000000000AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-bin.la noinst_HEADERS = \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_bin_la_SOURCES = \ deserializer.cpp \ formatter.cpp \ responder.cpp \ socket.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ parser.cpp \ worker.cpp libcxxtools_bin_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_bin_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ cxxtools-3.0/src/bin/socket.h0000664000175000017500000000556213644433072013200 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_SOCKET_H #define CXXTOOLS_BIN_SOCKET_H #include #include #include #include #include #include "responder.h" namespace cxxtools { namespace bin { class RpcServerImpl; class Socket : public net::TcpSocket, public Connectable { public: Socket(RpcServerImpl& rpcServerImpl, net::TcpServer& tcpServer, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa); explicit Socket(Socket& socket); void accept(); void postAccept(); bool hasAccepted() const { return _accepted; } void setSelector(SelectorBase* s); void removeSelector(); void onIODeviceInput(IODevice& iodevice); void onInput(StreamBuffer& sb); bool onOutput(StreamBuffer& sb); bool onAcceptSslCertificate(const SslCertificate& cert); Signal inputReady; StreamBuffer& buffer() { return _stream.buffer(); } MethodSlot inputSlot; Connection inputConnection; Connection timeoutConnection; private: RpcServerImpl& _rpcServerImpl; net::TcpServer& _tcpServer; std::string _certificateFile; std::string _privateKeyFile; Responder _responder; IOStream _stream; int _sslVerifyLevel; std::string _sslCa; bool _accepted; }; } } #endif // CXXTOOLS_BIN_SOCKET_H cxxtools-3.0/src/bin/rpcclient.cpp0000664000175000017500000001244113644433072014220 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "rpcclientimpl.h" #include "config.h" namespace cxxtools { namespace bin { RpcClientImpl* RpcClient::getImpl() { if (_impl == 0) { _impl = new RpcClientImpl(); _impl->addRef(); } return _impl; } RpcClient::RpcClient(const RpcClient& other) : _impl(other._impl) { if (_impl) _impl->addRef(); } RpcClient& RpcClient::operator= (const RpcClient& other) { if (_impl == other._impl) return *this; if (_impl && _impl->release() <= 0) delete _impl; _impl = other._impl; if (_impl) _impl->addRef(); return *this; } RpcClient::~RpcClient() { if (_impl && _impl->release() <= 0) delete _impl; } void RpcClient::prepareConnect(const net::AddrInfo& addrinfo, bool ssl) { getImpl()->prepareConnect(addrinfo, std::string()); getImpl()->ssl(ssl); } void RpcClient::prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { getImpl()->prepareConnect(addrinfo, sslCertificate); } void RpcClient::prepareConnect(const std::string& host, unsigned short int port, bool ssl) { prepareConnect(net::AddrInfo(host, port), ssl); } void RpcClient::prepareConnect(const std::string& host, unsigned short int port, const std::string& sslCertificate) { prepareConnect(net::AddrInfo(host, port), sslCertificate); } void RpcClient::prepareConnect(const net::Uri& uri) { #ifdef WITH_SSL if (uri.protocol() != "bin" && uri.protocol() != "bins") throw std::runtime_error("only protocols \"bin\" and \"bins\" is supported by binary rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.protocol() == "bins"); #else if (uri.protocol() != "bin") throw std::runtime_error("only protocol \"bin\" is supported by binary rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port())); #endif } void RpcClient::prepareConnect(const net::Uri& uri, const std::string& sslCertificate) { #ifdef WITH_SSL if (uri.protocol() != "bins") throw std::runtime_error("only protocol \"bins\" is supported when ssl certificate is set"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), sslCertificate); #else if (uri.protocol() != "bin") throw std::runtime_error("only protocol \"bin\" is supported by binary rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port())); #endif } void RpcClient::connect() { getImpl()->connect(); } void RpcClient::close() { if (_impl) _impl->close(); } void RpcClient::setSelector(SelectorBase* selector) { getImpl()->setSelector(selector); } void RpcClient::setSslVerify(int level, const std::string& ca) { getImpl()->setSslVerify(level, ca); } void RpcClient::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void RpcClient::endCall() { _impl->endCall(); } void RpcClient::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } Milliseconds RpcClient::timeout() const { return getImpl()->timeout(); } void RpcClient::timeout(Milliseconds t) { getImpl()->timeout(t); } Milliseconds RpcClient::connectTimeout() const { return getImpl()->connectTimeout(); } void RpcClient::connectTimeout(Milliseconds t) { getImpl()->connectTimeout(t); } const IRemoteProcedure* RpcClient::activeProcedure() const { return _impl == 0 ? 0 : _impl->activeProcedure(); } void RpcClient::cancel() { if (_impl) _impl->cancel(); } void RpcClient::wait(Milliseconds msecs) { _impl->wait(msecs); } const std::string& RpcClient::domain() const { return getImpl()->domain(); } void RpcClient::domain(const std::string& p) { getImpl()->domain(p); } Delegate& RpcClient::acceptSslCertificate() { return getImpl()->socket().acceptSslCertificate; } } } cxxtools-3.0/src/bin/parser.cpp0000664000175000017500000011440713644433072013536 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include log_define("cxxtools.bin.parser") namespace cxxtools { namespace bin { namespace { const char* typeName(unsigned char typeCode) { switch (typeCode) { case Serializer::TypeEmpty: case Serializer::TypePlainEmpty: return ""; case Serializer::TypeBool: case Serializer::TypePlainBool: return "bool"; case Serializer::TypeChar: case Serializer::TypePlainChar: return "char"; case Serializer::TypeString: case Serializer::TypePlainString: return "string"; case Serializer::TypeInt: case Serializer::TypePlainInt: case Serializer::TypeInt8: case Serializer::TypePlainInt8: case Serializer::TypeInt16: case Serializer::TypePlainInt16: case Serializer::TypeInt32: case Serializer::TypePlainInt32: case Serializer::TypeInt64: case Serializer::TypePlainInt64: case Serializer::TypeUInt8: case Serializer::TypePlainUInt8: case Serializer::TypeUInt16: case Serializer::TypePlainUInt16: case Serializer::TypeUInt32: case Serializer::TypePlainUInt32: case Serializer::TypeUInt64: case Serializer::TypePlainUInt64: return "int"; case Serializer::TypeBinary2: case Serializer::TypePlainBinary2: case Serializer::TypeBinary4: case Serializer::TypePlainBinary4: return "binary"; case Serializer::TypeShortFloat: case Serializer::TypePlainShortFloat: case Serializer::TypeMediumFloat: case Serializer::TypePlainMediumFloat: case Serializer::TypeLongFloat: case Serializer::TypePlainLongFloat: case Serializer::TypeBcdFloat: case Serializer::TypePlainBcdFloat: return "double"; case Serializer::TypePair: case Serializer::TypePlainPair: return "pair"; case Serializer::TypeArray: case Serializer::TypePlainArray: return "array"; case Serializer::TypeList: case Serializer::TypePlainList: return "list"; case Serializer::TypeDeque: case Serializer::TypePlainDeque: return "deque"; case Serializer::TypeSet: case Serializer::TypePlainSet: return "set"; case Serializer::TypeMultiset: case Serializer::TypePlainMultiset: return "multiset"; case Serializer::TypeMap: case Serializer::TypePlainMap: return "map"; case Serializer::TypeMultimap: case Serializer::TypePlainMultimap: return "multimap"; default: { std::ostringstream msg; msg << "unknown serialization type code <" << std::hex << static_cast(static_cast(typeCode)) << '>'; SerializationError::doThrow(msg.str()); } } return 0; // never reached } static const char bcdDigits[16] = "0123456789+-.: "; } void Parser::begin(Deserializer& handler, bool resetDictionary) { _deserializer = &handler; _state = state_type; _nextstate = state_type; _int = 0; _exp = 0; _token.clear(); delete _next; _next = 0; if (resetDictionary) _mydictionary.clear(); } void Parser::finish() { _deserializer = 0; _token.clear(); delete _next; _next = 0; } void Parser::skip() { _state = state_type; _deserializer = 0; _int = 0; _exp = 0; _token.clear(); } bool Parser::advance(std::streambuf& in, bool atLeastOne) { while (in.in_avail() || atLeastOne) { char ch = std::streambuf::traits_type::to_char_type(in.sgetc()); log_finest(static_cast(this) << " advance " << std::hex << static_cast(static_cast(ch)) << std::dec << " state " << _state << " nextstate " << _nextstate); switch (_state) { case state_type: { Serializer::TypeCode tc = static_cast(static_cast(ch)); if (tc == Serializer::CategoryObject) { _nextstate = state_object_type; _state = state_name; if (_deserializer) _deserializer->setCategory(SerializationInfo::Object); } else if (tc == Serializer::CategoryArray) { _nextstate = state_array_type; _state = state_name; if (_deserializer) _deserializer->setCategory(SerializationInfo::Array); } else if (tc == Serializer::TypeOther) { log_debug("type other"); _nextstate = state_name; _state = state_value_type_other; } else if (tc == Serializer::TypePlainOther) { log_debug("type plain other"); _nextstate = state_value_value; _state = state_value_type_other; } else if (tc == Serializer::TypeBcd) { log_debug("type bcd"); _nextstate = state_name; _state = state_value_type_bcd; } else if (tc == Serializer::TypePlainBcd) { log_debug("type plain bcd"); _nextstate = state_value_bcd0; _state = state_value_type_bcd; } else { log_debug("type code " << std::hex << tc << " => type " << typeName(ch)); if (_deserializer) { _deserializer->setTypeName(typeName(ch)); _deserializer->setCategory(SerializationInfo::Value); } switch (tc) { case Serializer::TypeEmpty: if (_deserializer) _deserializer->setNull(); _nextstate = state_end; _state = state_name; break; case Serializer::TypeChar: _nextstate = state_value_char; _state = state_name; break; case Serializer::TypeString: case Serializer::TypeInt: _nextstate = state_value_value; _state = state_name; break; case Serializer::TypeBool: _nextstate = state_value_bool; _state = state_name; break; case Serializer::TypeBinary2: _count = 2; _nextstate = state_value_binary_length; _state = state_name; break; case Serializer::TypeBinary4: _count = 4; _nextstate = state_value_binary_length; _state = state_name; break; case Serializer::TypeInt8: _count = 1; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeInt16: _count = 2; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeInt32: _count = 4; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeInt64: _count = 8; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeUInt8: _count = 1; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeUInt16: _count = 2; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeUInt32: _count = 4; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeUInt64: _count = 8; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeShortFloat: _nextstate = state_sfloat_exp; _count = 1; _state = state_name; break; case Serializer::TypeMediumFloat: _nextstate = state_mfloat_exp; _count = 1; _state = state_name; break; case Serializer::TypeLongFloat: _nextstate = state_lfloat_exp; _count = 2; _state = state_name; break; case Serializer::TypeBcdFloat: _nextstate = state_value_bcd0; _state = state_name; break; case Serializer::TypeArray: case Serializer::TypeVector: case Serializer::TypeList: case Serializer::TypeDeque: case Serializer::TypeSet: case Serializer::TypeMultiset: _state = state_name; _nextstate = state_array_member; if (_deserializer) _deserializer->setCategory(SerializationInfo::Array); break; case Serializer::TypePair: case Serializer::TypeMap: case Serializer::TypeMultimap: _nextstate = state_object_member; _state = state_name; if (_deserializer) _deserializer->setCategory(SerializationInfo::Object); break; case Serializer::TypePlainEmpty: if (_deserializer) _deserializer->setNull(); _state = state_end; break; case Serializer::TypePlainChar: _state = state_value_char; break; case Serializer::TypePlainString: case Serializer::TypePlainInt: _state = state_value_value; break; case Serializer::TypePlainBool: _state = state_value_bool; break; case Serializer::TypePlainBcdFloat: _state = state_value_bcd0; break; case Serializer::TypePlainBinary2: _count = 2; _state = state_value_binary_length; break; case Serializer::TypePlainBinary4: _count = 4; _state = state_value_binary_length; break; case Serializer::TypePlainInt8: _count = 1; _state = state_value_intsign; break; case Serializer::TypePlainInt16: _count = 2; _state = state_value_intsign; break; case Serializer::TypePlainInt32: _count = 4; _state = state_value_intsign; break; case Serializer::TypePlainInt64: _count = 8; _state = state_value_intsign; break; case Serializer::TypePlainUInt8: _count = 1; _state = state_value_uint; break; case Serializer::TypePlainUInt16: _count = 2; _state = state_value_uint; break; case Serializer::TypePlainUInt32: _count = 4; _state = state_value_uint; break; case Serializer::TypePlainUInt64: _count = 8; _state = state_value_uint; break; case Serializer::TypePlainShortFloat: _state = state_sfloat_exp; _count = 1; break; case Serializer::TypePlainMediumFloat: _state = state_mfloat_exp; _count = 1; break; case Serializer::TypePlainLongFloat: _state = state_lfloat_exp; _count = 2; break; case Serializer::TypePlainArray: case Serializer::TypePlainVector: case Serializer::TypePlainList: case Serializer::TypePlainDeque: case Serializer::TypePlainSet: case Serializer::TypePlainMultiset: _state = state_array_type; if (_deserializer) _deserializer->setCategory(SerializationInfo::Array); break; case Serializer::TypePlainPair: case Serializer::TypePlainMap: case Serializer::TypePlainMultimap: _state = state_object_type; if (_deserializer) _deserializer->setCategory(SerializationInfo::Object); break; default: { std::ostringstream msg; msg << "invalid type code <0x" << std::hex << tc << '>'; SerializationError::doThrow(msg.str()); } } } in.sbumpc(); } break; case state_name: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (ch == '\0') { log_debug("name=" << _token); if (_deserializer) _deserializer->setName(_token); dict(_token); _token.clear(); _state = _nextstate; break; } else if (_token.empty() && ch == '\1') { _state = state_name_idx0; break; } else _token += ch; } break; case state_name_idx0: _dictidx = static_cast(ch) << 8; _state = state_name_idx1; in.sbumpc(); break; case state_name_idx1: _dictidx |= static_cast(ch); if (_dictidx >= _dictionary->size()) { log_error("invalid dictionary index " << _dictidx); SerializationError::doThrow("invalid dictionary index"); } log_debug("dictidx=" << _dictidx << " name=" << (*_dictionary)[_dictidx]); if (_deserializer) _deserializer->setName((*_dictionary)[_dictidx]); _state = _nextstate; in.sbumpc(); break; case state_value_type_other: case state_value_type_bcd: if (ch == '\0') { log_debug("typename=" << _token); if (_deserializer) _deserializer->setTypeName(_token); dict(_token); _token.clear(); State nextstate = (_state == state_value_type_bcd ? state_value_bcd : state_value_value); _state = _nextstate; _nextstate = nextstate; } else if (_token.empty() && ch == '\1') { _state = (_state == state_value_type_bcd ? state_value_type_bcd_idx0 : state_value_type_other_idx0); } else _token += ch; in.sbumpc(); break; case state_value_type_other_idx0: case state_value_type_bcd_idx0: _dictidx = static_cast(ch) << 8; _state = (_state == state_value_type_bcd_idx0 ? state_value_type_bcd_idx1 : state_value_type_other_idx1); in.sbumpc(); break; case state_value_type_other_idx1: case state_value_type_bcd_idx1: _dictidx |= static_cast(ch); if (_dictidx >= _dictionary->size()) { log_error("invalid dictionary index " << _dictidx); SerializationError::doThrow("invalid dictionary index"); } log_debug("dictidx=" << _dictidx << " typename=" << (*_dictionary)[_dictidx]); if (_deserializer) _deserializer->setTypeName((*_dictionary)[_dictidx]); { State nextstate = (_state == state_value_type_bcd_idx1 ? state_value_bcd : state_value_value); _state = _nextstate; _nextstate = nextstate; } in.sbumpc(); break; case state_value_intsign: if (static_cast(ch) < 0) _int = static_cast(-1); // set all bits else _int = 0; _state = state_value_int; // no break case state_value_int: case state_value_uint: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); _int = (_int << 8) | static_cast(ch); if (--_count == 0) { if (_deserializer) { if (_state == state_value_int) { Deserializer::int_type value = Deserializer::int_type(_int); _deserializer->setValue(value); } else { Deserializer::unsigned_type value = Deserializer::unsigned_type(_int); _deserializer->setValue(value); } } _int = 0; return true; } } break; case state_value_bool: if (_deserializer) _deserializer->setValue(ch != '\0'); in.sbumpc(); return true; case state_value_bcd0: if (ch == '\xf0') { if (_deserializer) _deserializer->setValue("nan"); _state = state_end; in.sbumpc(); break; } else if (ch == '\xf1') { if (_deserializer) _deserializer->setValue("inf"); _state = state_end; in.sbumpc(); break; } else if (ch == '\xf2') { if (_deserializer) _deserializer->setValue("-inf"); _state = state_end; in.sbumpc(); break; } _state = state_value_bcd; // no break case state_value_bcd: if (ch == '\xff') { if (_deserializer) _deserializer->setValue(_token); _token.clear(); in.sbumpc(); return true; } else { _token += bcdDigits[static_cast(ch) >> 4]; if ((ch & '\xf') == '\xf') { if (_deserializer) _deserializer->setValue(_token); _token.clear(); _state = state_end; } else { _token += bcdDigits[static_cast(ch) & '\xf']; } in.sbumpc(); } break; case state_value_binary_length: _int = (_int << 8) | static_cast(ch); if (--_count == 0) { _count = static_cast(_int); _int = 0; if (_count == 0) { if (_deserializer) _deserializer->setValue(std::string()); _state = state_end; } else { _state = state_value_binary; } } in.sbumpc(); break; case state_value_binary: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (_deserializer) _token += ch; if (--_count == 0) { if (_deserializer) _deserializer->setValue(_token); return true; } } break; case state_value_value: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (ch == '\0') { if (_deserializer) _deserializer->setValue(Utf8Codec::decode(_token)); _token.clear(); _state = state_end; break; } else _token += ch; } break; case state_value_char: ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (_deserializer) _deserializer->setValue(ch); return true; case state_sfloat_exp: _isNeg = (ch & '\x80') != 0; _exp = ch & '\x7f'; _state = state_sfloat_base; _count = 2; in.sbumpc(); break; case state_mfloat_exp: _isNeg = (ch & '\x80') != 0; _exp = ch & '\x7f'; _state = state_mfloat_base; _count = 4; in.sbumpc(); break; case state_lfloat_exp: if (--_count == 1) { _isNeg = (ch & '\x80') != 0; _exp = ch & '\x7f'; } else { _exp = (_exp << 8) | static_cast(ch); _count = 8; _state = state_lfloat_base; } in.sbumpc(); break; case state_sfloat_base: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (processFloatBase(ch, 48, 63)) return true; } break; case state_mfloat_base: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (processFloatBase(ch, 32, 63)) return true; } break; case state_lfloat_base: while (in.in_avail() || atLeastOne) { atLeastOne = false; ch = std::streambuf::traits_type::to_char_type(in.sbumpc()); if (processFloatBase(ch, 0, 16383)) return true; } break; case state_object_type: if (static_cast(ch) == Serializer::TypePlainOther || static_cast(ch) == Serializer::TypeOther) _state = state_object_type_other; else { if (_deserializer) _deserializer->setTypeName(typeName(ch)); _state = state_object_member; } in.sbumpc(); break; case state_object_type_other: if (ch == '\0') { if (_deserializer) _deserializer->setTypeName(_token); dict(_token); _token.clear(); _state = state_object_member; } else if (_token.empty() && ch == '\1') _state = state_object_type_other_idx0; else _token += ch; in.sbumpc(); break; case state_object_type_other_idx0: _dictidx = static_cast(ch) << 8; _state = state_object_type_other_idx1; in.sbumpc(); break; case state_object_type_other_idx1: _dictidx |= static_cast(ch); if (_dictidx >= _dictionary->size()) { log_error("invalid dictionary index " << _dictidx); SerializationError::doThrow("invalid dictionary index"); } log_debug("dictidx=" << _dictidx << " typename=" << (*_dictionary)[_dictidx]); if (_deserializer) _deserializer->setTypeName((*_dictionary)[_dictidx]); _token.clear(); _state = state_object_member; in.sbumpc(); break; case state_object_member: if (ch == '\xff') { in.sbumpc(); return true; } if (_next == 0) _next = new Parser(_dictionary); if (_deserializer) { _deserializer->beginMember(_token, "", SerializationInfo::Void); _next->begin(*_deserializer); } else _next->skip(); _state = state_object_member_value; break; case state_object_member_value: if (_next->advance(in, atLeastOne)) { if (_deserializer) _deserializer->leaveMember(); _state = state_object_member; } break; case state_array_type: { Serializer::TypeCode tc = static_cast(static_cast(ch)); if (tc == Serializer::TypeOther) { _state = state_name; _nextstate = state_array_type_other; } else if (tc == Serializer::TypePlainOther) { _state = state_array_type_other; } else { if (_deserializer) _deserializer->setTypeName(typeName(ch)); _state = state_array_member; } in.sbumpc(); } break; case state_array_type_other: if (ch == '\0') { if (_deserializer) _deserializer->setTypeName(_token); dict(_token); _token.clear(); _state = state_array_member; } else if (_token.empty() && ch == '\1') _state = state_array_type_other_idx0; else _token += ch; in.sbumpc(); break; case state_array_type_other_idx0: _dictidx = static_cast(ch) << 8; _state = state_array_type_other_idx1; in.sbumpc(); break; case state_array_type_other_idx1: _dictidx |= static_cast(ch); if (_dictidx >= _dictionary->size()) { log_error("invalid dictionary index " << _dictidx); SerializationError::doThrow("invalid dictionary index"); } log_debug("dictidx=" << _dictidx << " typename=" << (*_dictionary)[_dictidx]); if (_deserializer) _deserializer->setTypeName((*_dictionary)[_dictidx]); _state = state_array_member; in.sbumpc(); break; case state_array_member: if (ch == '\xff') { in.sbumpc(); return true; } if (_next == 0) _next = new Parser(_dictionary); if (_deserializer) { _deserializer->beginMember("", "", SerializationInfo::Void); _next->begin(*_deserializer); } else { _next->skip(); } _state = state_array_member_value; // no break case state_array_member_value: if (_next->advance(in, atLeastOne)) { if (_deserializer) _deserializer->leaveMember(); _state = state_array_member_value_next; } break; case state_array_member_value_next: if (ch == '\xff') { in.sbumpc(); return true; } else { if (_deserializer) { _deserializer->beginMember("", "", SerializationInfo::Void); _next->begin(*_deserializer); } else { _next->skip(); } _state = state_array_member_value; } break; case state_end: if (ch != '\xff') { std::ostringstream msg; msg << "end of value marker expected; got <0x" << std::hex << static_cast(static_cast(ch)) << '>'; SerializationError::doThrow(msg.str()); } in.sbumpc(); log_debug("end of value"); return true; } atLeastOne = false; } return false; } bool Parser::processFloatBase(char ch, unsigned shift, unsigned expOffset) { _int = (_int << 8) | static_cast(ch); if (--_count == 0) { _int <<= shift; long double v; if (expOffset == 63 && _exp == 0x7f) { log_debug("float: value is special"); v = (_int == 0 ? _isNeg ? -std::numeric_limits::infinity() : std::numeric_limits::infinity() : std::numeric_limits::quiet_NaN()); } else if (_exp == 0 && _int == 0) { log_debug("float: value is zero"); v = 0.0; } else { long double ss = static_cast(_int) / (static_cast(std::numeric_limits::max()) + 1.0l) / 2.0l + .5l; v = ldexp(ss, _exp - expOffset); if (_isNeg) v = -v; log_debug("float: s=" << ss << " man=" << std::hex << _int << std::dec << " exp=" << _exp << " isNeg=" << _isNeg << " value=" << v); } if (_deserializer) _deserializer->setValue(v); _int = 0; return true; } return false; } void Parser::dict(const std::string& value) { if (value.empty()) return; for (unsigned idx = 0; idx < _dictionary->size(); ++idx) { if ((*_dictionary)[idx] == value) return; } log_debug("add dictionary value \"" << value << "\" idx=" << _dictionary->size()); _dictionary->push_back(value); } } } cxxtools-3.0/src/bin/deserializer.cpp0000664000175000017500000000501713644433072014720 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include log_define("cxxtools.bin.deserializer") namespace cxxtools { namespace bin { Deserializer::Deserializer(const char* data, size_t size) { begin(); std::stringbuf in(std::string(data, size)); if (_parser.advance(in) && !in.in_avail()) { _parser.finish(); return; } SerializationError::doThrow("binary deserialization failed - unexpected eof"); } void Deserializer::read(std::istream& in) { log_trace("read from input stream"); begin(); while (in.rdbuf()->sgetc() != std::streambuf::traits_type::eof()) { log_debug("call advance - in_avail=" << in.rdbuf()->in_avail() << " ch=" << in.rdbuf()->sgetc()); if (_parser.advance(*in.rdbuf(), true)) { _parser.finish(); return; } } in.setstate(std::ios::eofbit); SerializationError::doThrow("binary deserialization failed - unexpected eof"); } void Deserializer::begin(bool resetDictionary) { cxxtools::Deserializer::begin(); _parser.begin(*this, resetDictionary); } } } cxxtools-3.0/src/bin/socket.cpp0000664000175000017500000001155713644433072013534 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "socket.h" #include "rpcserverimpl.h" #include log_define("cxxtools.bin.socket") namespace cxxtools { namespace bin { Socket::Socket(RpcServerImpl& rpcServerImpl, net::TcpServer& tcpServer, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) : inputSlot(slot(*this, &Socket::onInput)), _rpcServerImpl(rpcServerImpl), _tcpServer(tcpServer), _certificateFile(certificateFile), _privateKeyFile(privateKeyFile), _responder(rpcServerImpl._serviceRegistry), _sslVerifyLevel(sslVerifyLevel), _sslCa(sslCa), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(acceptSslCertificate, *this, &Socket::onAcceptSslCertificate); } Socket::Socket(Socket& socket) : net::TcpSocket(), Connectable(*this), inputSlot(slot(*this, &Socket::onInput)), _rpcServerImpl(socket._rpcServerImpl), _tcpServer(socket._tcpServer), _certificateFile(socket._certificateFile), _privateKeyFile(socket._privateKeyFile), _responder(_rpcServerImpl._serviceRegistry), _sslVerifyLevel(socket._sslVerifyLevel), _sslCa(socket._sslCa), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(acceptSslCertificate, *this, &Socket::onAcceptSslCertificate); } void Socket::accept() { log_debug("accept"); net::TcpSocket::accept(_tcpServer); if (!_certificateFile.empty()) { loadSslCertificateFile(_certificateFile, _privateKeyFile); setSslVerify(_sslVerifyLevel, _sslCa); beginSslAccept(); } } void Socket::postAccept() { log_trace("post accept"); if (!_certificateFile.empty()) { cxxtools::Timespan t = getTimeout(); setTimeout(cxxtools::Seconds(10)); endSslAccept(); setTimeout(t); } _accepted = true; _stream.buffer().beginRead(); log_debug("accepted"); } void Socket::setSelector(SelectorBase* s) { s->add(*this); } void Socket::removeSelector() { TcpSocket::setSelector(0); } void Socket::onIODeviceInput(IODevice& /*iodevice*/) { log_debug("onIODeviceInput"); inputReady(*this); } void Socket::onInput(StreamBuffer& sb) { log_debug("onInput"); sb.endRead(); if (sb.in_avail() == 0 || sb.device()->eof()) { close(); return; } if (_responder.onInput(_stream)) { sb.beginWrite(); onOutput(sb); } else { sb.beginRead(); } } bool Socket::onOutput(StreamBuffer& sb) { log_trace("onOutput"); log_debug("send data to " << getPeerAddr()); try { sb.endWrite(); if ( sb.out_avail() ) { sb.beginWrite(); } else { if (sb.in_avail()) onInput(sb); else sb.beginRead(); } } catch (const std::exception& e) { log_warn("exception occured when processing request: " << e.what()); close(); return false; } return true; } bool Socket::onAcceptSslCertificate(const SslCertificate& cert) { return !_rpcServerImpl.acceptSslCertificate.isConnected() || _rpcServerImpl.acceptSslCertificate(cert); } } } cxxtools-3.0/src/bin/worker.h0000664000175000017500000000344513644433072013217 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_WORKER_H #define CXXTOOLS_BIN_WORKER_H #include namespace cxxtools { namespace bin { class RpcServerImpl; class Worker : public AttachedThread { public: explicit Worker(RpcServerImpl& server) : AttachedThread(callable(*this, &Worker::run)), _server(server) { } private: void run(); RpcServerImpl& _server; }; } } #endif // CXXTOOLS_BIN_WORKER_H cxxtools-3.0/src/bin/rpcserver.cpp0000664000175000017500000000566013644433072014255 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "rpcserverimpl.h" namespace cxxtools { namespace bin { RpcServerImpl* RpcServer::newImpl(EventLoopBase& eventLoop) { return new RpcServerImpl(eventLoop, runmodeChanged, *this); } RpcServer::~RpcServer() { delete _impl; } void RpcServer::listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) { _impl->listen(ip, port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } void RpcServer::addService(const ServiceRegistry& service) { std::vector procs = service.getProcedureNames(); for (std::vector::const_iterator it = procs.begin(); it != procs.end(); ++it) { registerProcedure(*it, service.getProcedure(*it)); } } void RpcServer::addService(const std::string& domain, const ServiceRegistry& service) { std::vector procs = service.getProcedureNames(); for (std::vector::const_iterator it = procs.begin(); it != procs.end(); ++it) { registerProcedure(domain.empty() ? *it : (domain + '\0' + *it), service.getProcedure(*it)); } } unsigned RpcServer::minThreads() const { return _impl->minThreads(); } void RpcServer::minThreads(unsigned m) { _impl->minThreads(m); } unsigned RpcServer::maxThreads() const { return _impl->maxThreads(); } void RpcServer::maxThreads(unsigned m) { _impl->maxThreads(m); } Delegate& RpcServer::acceptSslCertificate() { return _impl->acceptSslCertificate; } } } cxxtools-3.0/src/bin/formatter.cpp0000664000175000017500000007526713666667450014274 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include log_define("cxxtools.bin.formatter") namespace cxxtools { namespace bin { namespace { template bool isTrue(const StringT& s) { return !s.empty() && (s[0] == '1' || s[0] == 't' || s[0] == 'T' || s[0] == 'y' || s[0] == 'Y'); } template bool areLowerBitsSet(T v, unsigned bits) { return v >> bits << bits != v; } static const char bcd[257] = " " // 00-0f " " // 10-1f "\xe \xa \xb\xc " // 20-2f "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xd " // 30-3f " " // 40-4f " " // 50-5f " " // 60-6f " " // 70-7f " " // 80-8f " " // 90-9f " " // a0-af " " // b0-bf " " // c0-cf " " // d0-df " " // e0-ef " "; // f0-ff inline bool isAscii(const std::string& s) { for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) if (*it > '\x7f' || *it < '\1') return false; return true; } } Formatter::Formatter() : _out(0), _ts(new Utf8Codec()) { } Formatter::Formatter(std::ostream& out) : _out(0), _ts(new Utf8Codec()) { begin(out); } void Formatter::begin(std::ostream& out) { _out = &out; _ts.attach(out); _dictionary.clear(); } void Formatter::finish() { _ts.detach(); _dictionary.clear(); _out = 0; } void Formatter::addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) { log_trace("addValueString(\"" << name << "\", \"" << type << "\", \"" << value << "\")"); bool plain = name.empty(); std::streambuf* sb = _out->rdbuf(); if (type == "int" || type == "long") { if (!value.empty() && (value[0] == L'-' || value[0] == L'+')) { int64_t v = convert(value); printInt(v, name); } else { uint64_t v = convert(value); printUInt(v, name); } } else if (value.find_first_not_of(L"0123456789+-.: ") == std::string::npos || value == L"nan" || value == L"inf" || value == L"-inf") { bool isDouble = (type == "double"); sb->sputc(static_cast(isDouble ? plain ? Serializer::TypePlainBcdFloat : Serializer::TypeBcdFloat : plain ? Serializer::TypePlainBcd : Serializer::TypeBcd)); if (!isDouble) outputString(type); if (!plain) outputString(name); if (value == L"nan") { sb->sputc('\xf0'); } else if (value == L"inf") { sb->sputc('\xf1'); } else if (value == L"-inf") { sb->sputc('\xf2'); } else { bool high = true; char ch; for (String::const_iterator it = value.begin(); it != value.end(); ++it) { int v = it->value(); if (high) ch = bcd[v] << 4; else { ch |= bcd[v]; sb->sputc(ch); } high = !high; } if (!high) sb->sputc(static_cast(ch | '\xf')); } sb->sputc('\xff'); } else if (type == "bool") { sb->sputc(static_cast(plain ? Serializer::TypePlainBool : Serializer::TypeBool)); if (!plain) outputString(name); sb->sputc((isTrue(value) ? '\1' : '\0')); } else if (value.find(L'\0') != cxxtools::String::npos) { std::string svalue = Utf8Codec::encode(value); uint32_t v = svalue.size(); if (v <= 0xffff) { sb->sputc(static_cast(plain ? Serializer::TypePlainBinary2 : Serializer::TypeBinary2)); if (!plain) outputString(name); } else { sb->sputc(static_cast(plain ? Serializer::TypePlainBinary4 : Serializer::TypeBinary4)); if (!plain) outputString(name); sb->sputc(static_cast(v >> 24)); sb->sputc(static_cast(v >> 16)); } sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); *_out << svalue; } else { printTypeCode(type, plain); if (!plain) outputString(name); _ts << value; _ts.flush(); sb->sputn("\0\xff", 2); } } void Formatter::addValueStdString(const std::string& name, const std::string& type, const std::string& value) { log_trace("addValueStdString(\"" << name << "\", \"" << type << "\", \"" << value << "\")"); bool plain = name.empty(); std::streambuf* sb = _out->rdbuf(); if (type == "int" || type == "long") { if (!value.empty() && (value[0] == L'-' || value[0] == L'+')) { int64_t v = convert(value); printInt(v, name); } else { uint64_t v = convert(value); printUInt(v, name); } } else if (value.find_first_not_of("0123456789+-.: ") == std::string::npos || value == "nan" || value == "inf" || value == "-inf") { bool isDouble = (type == "double"); sb->sputc(static_cast(isDouble ? plain ? Serializer::TypePlainBcdFloat : Serializer::TypeBcdFloat : plain ? Serializer::TypePlainBcd : Serializer::TypeBcd)); if (!isDouble) outputString(type); if (!plain) outputString(name); if (value == "nan") { sb->sputc('\xf0'); } else if (value == "inf") { sb->sputc('\xf1'); } else if (value == "-inf") { sb->sputc('\xf2'); } else { bool high = true; char ch; for (std::string::const_iterator it = value.begin(); it != value.end(); ++it) { int v = (*it); if (high) ch = bcd[v] << 4; else { ch |= bcd[v]; sb->sputc(ch); } high = !high; } if (!high) sb->sputc(static_cast(ch | '\xf')); } sb->sputc('\xff'); } else if (type == "bool") { sb->sputc(static_cast(plain ? Serializer::TypePlainBool : Serializer::TypeBool)); if (!plain) outputString(name); sb->sputc((isTrue(value) ? '\1' : '\0')); } else if (!isAscii(value)) { uint32_t v = value.size(); if (v <= 0xffff) { sb->sputc(static_cast(plain ? Serializer::TypePlainBinary2 : Serializer::TypeBinary2)); if (!plain) outputString(name); } else { sb->sputc(static_cast(plain ? Serializer::TypePlainBinary4 : Serializer::TypeBinary4)); if (!plain) outputString(name); sb->sputc(static_cast(v >> 24)); sb->sputc(static_cast(v >> 16)); } sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); *_out << value; } else { printTypeCode(type, plain); if (!plain) outputString(name); *_out << value.c_str(); sb->sputn("\0\xff", 2); } } void Formatter::addValueChar(const std::string& name, const std::string& type, char value) { log_trace("addValueChar(\"" << name << "\", \"" << type << "\", " << value << ')'); bool plain = name.empty(); std::streambuf* sb = _out->rdbuf(); sb->sputc(static_cast(plain ? Serializer::TypePlainChar : Serializer::TypeChar)); if (!plain) outputString(name); sb->sputc(value); } void Formatter::addValueBool(const std::string& name, const std::string& type, bool value) { log_trace("addValueBool(\"" << name << "\", \"" << type << "\", " << value << ')'); bool plain = name.empty(); std::streambuf* sb = _out->rdbuf(); sb->sputc(static_cast(plain ? Serializer::TypePlainBool : Serializer::TypeBool)); if (!plain) outputString(name); sb->sputc((value ? '\1' : '\0')); } void Formatter::addValueInt(const std::string& name, const std::string& type, int_type value) { log_trace("addValueInt(\"" << name << "\", \"" << type << "\", " << value << ')'); printInt(value, name); } void Formatter::addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value) { log_trace("addValueUnsigned(\"" << name << "\", \"" << type << "\", " << value << ')'); printUInt(value, name); } void Formatter::addValueFloat(const std::string& name, const std::string& type, float value) { log_trace("addValueFloat(\"" << name << "\", \"" << type << "\", " << value << ')'); std::streambuf* sb = _out->rdbuf(); if (value != value) { // NaN sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\x7f\x1\0", 3); } else if (value == std::numeric_limits::infinity()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\x7f\0\0", 3); } else if (value == -std::numeric_limits::infinity()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\xff\0\0", 3); } else if (value == 0.0) { log_debug("value is zero"); sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\0\0\0", 3); } else { bool isNeg = value < 0; int exp; float s = frexpf(isNeg ? -value : value, &exp); uint64_t m = static_cast((std::numeric_limits::max() + 1.0l) * (s * 2.0l - 1.0l)); if (m < 5 && s > .9) { // this must be an overflow, which may happen when long double has a very high resolution m = std::numeric_limits::max(); } log_debug("value=" << value << " s=" << s << " man=" << std::hex << m << std::dec << " exp=" << exp << " neg=" << isNeg); if (areLowerBitsSet(m, 32) || exp > 63 || exp < -63) { log_debug("output long float"); uint16_t e = exp + 16383; if (isNeg) e |= 0x8000; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainLongFloat : Serializer::TypeLongFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e >> 8)); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); sb->sputc(static_cast(m >> 40)); sb->sputc(static_cast(m >> 32)); sb->sputc(static_cast(m >> 24)); sb->sputc(static_cast(m >> 16)); sb->sputc(static_cast(m >> 8)); sb->sputc(static_cast(m)); } else if (areLowerBitsSet(m, 48)) { log_debug("output medium float"); uint16_t e = exp + 63; if (isNeg) e |= 0x80; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainMediumFloat : Serializer::TypeMediumFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); sb->sputc(static_cast(m >> 40)); sb->sputc(static_cast(m >> 32)); } else { log_debug("output short float"); uint8_t e = exp + 63; if (isNeg) e |= 0x80; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); } } } void Formatter::addValueDouble(const std::string& name, const std::string& type, double value) { log_trace("addValueDouble(\"" << name << "\", \"" << type << "\", " << value << ')'); std::streambuf* sb = _out->rdbuf(); if (value != value) { // NaN sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\x7f\x1\0", 3); } else if (value == std::numeric_limits::infinity()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\x7f\0\0", 3); } else if (value == -std::numeric_limits::infinity()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\xff\0\0", 3); } else if (value == 0.0) { log_debug("value is zero"); sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\0\0\0", 3); } else { bool isNeg = value < 0; int exp; double s = frexp(isNeg ? -value : value, &exp); uint64_t m = static_cast((std::numeric_limits::max() + 1.0l) * (s * 2.0l - 1.0l)); if (m < 5 && s > .9) { // this must be an overflow, which may happen when long double has a very high resolution m = std::numeric_limits::max(); } log_debug("value=" << value << " s=" << s << " man=" << std::hex << m << std::dec << " exp=" << exp << " neg=" << isNeg); if (areLowerBitsSet(m, 32) || exp > 63 || exp < -63) { log_debug("output long float"); uint16_t e = exp + 16383; if (isNeg) e |= 0x8000; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainLongFloat : Serializer::TypeLongFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e >> 8)); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); sb->sputc(static_cast(m >> 40)); sb->sputc(static_cast(m >> 32)); sb->sputc(static_cast(m >> 24)); sb->sputc(static_cast(m >> 16)); sb->sputc(static_cast(m >> 8)); sb->sputc(static_cast(m)); } else if (areLowerBitsSet(m, 48)) { log_debug("output medium float"); uint16_t e = exp + 63; if (isNeg) e |= 0x80; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainMediumFloat : Serializer::TypeMediumFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); sb->sputc(static_cast(m >> 40)); sb->sputc(static_cast(m >> 32)); } else { log_debug("output short float"); uint8_t e = exp + 63; if (isNeg) e |= 0x80; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); } } } void Formatter::addValueLongDouble(const std::string& name, const std::string& type, long double value) { log_trace("addValueLongDouble(\"" << name << "\", \"" << type << "\", " << value << ')'); std::streambuf* sb = _out->rdbuf(); if (value != value) { // NaN sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\x7f\x1\0", 3); } else if (value == std::numeric_limits::infinity()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\x7f\0\0", 3); } else if (value == -std::numeric_limits::infinity()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\xff\0\0", 3); } else if (value == 0.0) { log_debug("value is zero"); sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputn("\0\0\0", 3); } else { bool isNeg = value < 0; int exp; long double s = frexpl(isNeg ? -value : value, &exp); uint64_t m = static_cast((std::numeric_limits::max() + 1.0l) * (s * 2.0l - 1.0l)); if (m < 5 && s > .9) { // this must be an overflow, which may happen when long double has a very high resolution m = std::numeric_limits::max(); } log_debug("value=" << value << " s=" << s << " man=" << std::hex << m << std::dec << " exp=" << exp << " neg=" << isNeg); if (areLowerBitsSet(m, 32) || exp > 63 || exp < -63) { log_debug("output long float"); uint16_t e = exp + 16383; if (isNeg) e |= 0x8000; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainLongFloat : Serializer::TypeLongFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e >> 8)); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); sb->sputc(static_cast(m >> 40)); sb->sputc(static_cast(m >> 32)); sb->sputc(static_cast(m >> 24)); sb->sputc(static_cast(m >> 16)); sb->sputc(static_cast(m >> 8)); sb->sputc(static_cast(m)); } else if (areLowerBitsSet(m, 48)) { log_debug("output medium float"); uint16_t e = exp + 63; if (isNeg) e |= 0x80; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainMediumFloat : Serializer::TypeMediumFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); sb->sputc(static_cast(m >> 40)); sb->sputc(static_cast(m >> 32)); } else { log_debug("output short float"); uint8_t e = exp + 63; if (isNeg) e |= 0x80; sb->sputc(static_cast(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat)); if (!name.empty()) outputString(name); sb->sputc(static_cast(e)); sb->sputc(static_cast(m >> 56)); sb->sputc(static_cast(m >> 48)); } } } void Formatter::addNull(const std::string& name, const std::string& type) { log_trace("addNull(\"" << name << "\", \"" << type << "\")"); std::streambuf* sb = _out->rdbuf(); sb->sputc(static_cast(name.empty() ? Serializer::TypePlainEmpty : Serializer::TypeEmpty)); if (!name.empty()) outputString(name); sb->sputc('\xff'); } void Formatter::beginArray(const std::string& name, const std::string& type) { log_trace("beginArray(\"" << name << "\", \"" << type << "\")"); std::streambuf* sb = _out->rdbuf(); sb->sputc(static_cast(Serializer::CategoryArray)); outputString(name); printTypeCode(type, true); } void Formatter::finishArray() { log_trace("finishArray()"); std::streambuf* sb = _out->rdbuf(); sb->sputc('\xff'); } void Formatter::beginObject(const std::string& name, const std::string& type) { log_trace("beginObject(\"" << name << "\", \"" << type << "\")"); std::streambuf* sb = _out->rdbuf(); sb->sputc(static_cast(Serializer::CategoryObject)); outputString(name); printTypeCode(type, false); } void Formatter::beginMember(const std::string& name) { log_trace("beginMember(\"" << name << "\")"); } void Formatter::finishMember() { log_trace("finishMember()"); } void Formatter::finishObject() { log_trace("finishObject()"); std::streambuf* sb = _out->rdbuf(); sb->sputc('\xff'); } void Formatter::printTypeCode(const std::string& type, bool plain) { std::streambuf* sb = _out->rdbuf(); if (type == "bool") sb->sputc(static_cast(plain ? Serializer::TypePlainBool : Serializer::TypeBool)); else if (type == "char") sb->sputc(static_cast(plain ? Serializer::TypePlainChar : Serializer::TypeChar)); else if (type == "string") sb->sputc(static_cast(plain ? Serializer::TypePlainString : Serializer::TypeString)); else if (type == "int") sb->sputc(static_cast(plain ? Serializer::TypePlainInt : Serializer::TypeInt)); else if (type == "double") sb->sputc(static_cast(plain ? Serializer::TypePlainBcdFloat : Serializer::TypeBcdFloat)); else if (type == "pair") sb->sputc(static_cast(plain ? Serializer::TypePlainPair : Serializer::TypePair)); else if (type == "array") sb->sputc(static_cast(plain ? Serializer::TypePlainArray : Serializer::TypeArray)); else if (type == "list") sb->sputc(static_cast(plain ? Serializer::TypePlainList : Serializer::TypeList)); else if (type == "deque") sb->sputc(static_cast(plain ? Serializer::TypePlainDeque : Serializer::TypeDeque)); else if (type == "set") sb->sputc(static_cast(plain ? Serializer::TypePlainSet : Serializer::TypeSet)); else if (type == "multiset") sb->sputc(static_cast(plain ? Serializer::TypePlainMultiset : Serializer::TypeMultiset)); else if (type == "map") sb->sputc(static_cast(plain ? Serializer::TypePlainMap : Serializer::TypeMap)); else if (type == "multimap") sb->sputc(static_cast(plain ? Serializer::TypePlainMultimap : Serializer::TypeMultimap)); else { sb->sputc(static_cast(plain ? Serializer::TypePlainOther : Serializer::TypeOther)); outputString(type); } } void Formatter::printUInt(uint64_t v, const std::string& name) { std::streambuf* sb = _out->rdbuf(); if (v <= std::numeric_limits::max()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainUInt8 : Serializer::TypeUInt8)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v)); } else if (v <= std::numeric_limits::max()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainUInt16 : Serializer::TypeUInt16)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); } else if (v <= std::numeric_limits::max()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainUInt32 : Serializer::TypeUInt32)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v >> 24)); sb->sputc(static_cast(v >> 16)); sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); } else { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainUInt64 : Serializer::TypeUInt64)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v >> 56)); sb->sputc(static_cast(v >> 48)); sb->sputc(static_cast(v >> 40)); sb->sputc(static_cast(v >> 32)); sb->sputc(static_cast(v >> 24)); sb->sputc(static_cast(v >> 16)); sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); } } void Formatter::printInt(int64_t v, const std::string& name) { std::streambuf* sb = _out->rdbuf(); if (v >= 0) { printUInt(v, name); } else if (v >= std::numeric_limits::min() && v <= std::numeric_limits::max()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainInt8 : Serializer::TypeInt8)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v)); } else if (v >= std::numeric_limits::min() && v <= std::numeric_limits::max()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainInt16 : Serializer::TypeInt16)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); } else if (v >= std::numeric_limits::min() && v <= std::numeric_limits::max()) { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainInt32 : Serializer::TypeInt32)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v >> 24)); sb->sputc(static_cast(v >> 16)); sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); } else { sb->sputc(static_cast(name.empty() ? Serializer::TypePlainInt64 : Serializer::TypeInt64)); if (!name.empty()) outputString(name); sb->sputc(static_cast(v >> 56)); sb->sputc(static_cast(v >> 48)); sb->sputc(static_cast(v >> 40)); sb->sputc(static_cast(v >> 32)); sb->sputc(static_cast(v >> 24)); sb->sputc(static_cast(v >> 16)); sb->sputc(static_cast(v >> 8)); sb->sputc(static_cast(v)); } } void Formatter::outputString(const std::string& value) { std::streambuf* sb = _out->rdbuf(); if (value.empty()) { sb->sputc('\0'); return; } unsigned idx; for (idx = 0; idx < _dictionary.size(); ++idx) { if (_dictionary[idx] == value) { log_debug("use dictionary value \"" << value << "\" idx=" << idx); sb->sputc('\1'); sb->sputc(static_cast(idx >> 8)); sb->sputc(static_cast(idx)); return; } } if (_dictionary.size() <= 0xffff) { log_debug("add dictionary value \"" << value << "\" idx=" << _dictionary.size()); _dictionary.push_back(value); } *_out << value; sb->sputc('\0'); } std::string Formatter::rawString(const std::string& value) { if (value.find_first_not_of("0123456789+-.: ") != std::string::npos) return value; bool high = true; char ch; std::string ret; for (std::string::const_iterator it = value.begin(); it != value.end(); ++it) { int v = (*it); if (high) ch = bcd[v] << 4; else { ch |= bcd[v]; ret += ch; } high = !high; } if (!high) ret += static_cast(ch | '\xf'); return ret; } } } cxxtools-3.0/src/bin/rpcclientimpl.h0000664000175000017500000001070213644433072014545 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RPCCLIENTIMPL_H #define CXXTOOLS_BIN_RPCCLIENTIMPL_H #include #include #include #include #include #include #include #include #include #include #include "scanner.h" namespace cxxtools { class SelectorBase; namespace bin { class RpcClientImpl : public RefCounted, public Connectable { RpcClientImpl(RpcClientImpl&); void operator= (const RpcClientImpl&); public: RpcClientImpl(); net::TcpSocket& socket() { return _socket; } void setSelector(SelectorBase* selector) { _socket.setSelector(selector); } void prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { _addrInfo = addrinfo; _socket.close(); _sslCertificate = sslCertificate; _ssl = !sslCertificate.empty(); } void ssl(bool sw) { _ssl = sw; } void connect(); void close(); void setSslVerify(int level, const std::string& ca) { _sslVerifyLevel = level; _sslCa = ca; } void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Timespan timeout() const { return _timeout; } void timeout(Timespan t) { _timeout = t; if (!_connectTimeoutSet) _connectTimeout = t; } Timespan connectTimeout() const { return _connectTimeout; } void connectTimeout(Timespan t) { _connectTimeout = t; _connectTimeoutSet = true; } const IRemoteProcedure* activeProcedure() const { return _proc; } void cancel(); void wait(Timespan msecs); const std::string& domain() const { return _domain; } void domain(const std::string& p) { _domain = p; } private: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void onConnect(net::TcpSocket& socket); void onSslConnect(net::TcpSocket& socket); void onOutput(StreamBuffer& sb); void onInput(StreamBuffer& sb); // connection state net::TcpSocket _socket; IOStream _stream; net::AddrInfo _addrInfo; bool _ssl; std::string _sslCertificate; int _sslVerifyLevel; std::string _sslCa; std::string _domain; // serialization Scanner _scanner; Deserializer _deserializer; Formatter _formatter; bool _exceptionPending; IRemoteProcedure* _proc; Timespan _timeout; bool _connectTimeoutSet; // indicates if connectTimeout is explicitely set // when not, it follows the setting of _timeout Timespan _connectTimeout; }; } } #endif // CXXTOOLS_BIN_RPCCLIENTIMPL_H cxxtools-3.0/src/bin/worker.cpp0000664000175000017500000001113413644433072013544 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "worker.h" #include "rpcserverimpl.h" #include #include #include "socket.h" log_define("cxxtools.bin.worker") namespace cxxtools { namespace bin { void Worker::run() { log_info("new thread running"); while (!_server.isTerminating() && _server._queue.numWaiting() < _server.minThreads()) { Socket* socket = _server._queue.get(); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } if (_server._queue.numWaiting() == 0) _server.noWaitingThreads(); try { if (!socket->hasAccepted()) { try { // do blocking accept socket->accept(); log_debug("connection accepted from " << socket->getPeerAddr()); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } // new connection arrived - create new accept socket log_info("new connection accepted from " << socket->getPeerAddr()); _server._queue.put(new Socket(*socket)); socket->postAccept(); } catch (const std::exception&) { _server._queue.put(new Socket(*socket)); throw; } } else if (socket->isConnected()) { log_debug("process available input from " << socket->getPeerAddr()); socket->onInput(socket->buffer()); } else { log_debug("socket is not connected any more; delete " << static_cast(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; continue; } Connection inputConnection = connect(socket->buffer().inputReady, socket->inputSlot); while (socket->wait(10) && socket->isConnected()) ; if (socket->isConnected()) { log_debug("timeout processing socket"); inputConnection.close(); _server.addIdleSocket(socket); } else if (_server.isTerminating()) { _server._queue.put(socket); } else { log_debug("socket is not connected any more; delete " << static_cast(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; } } catch (const net::AcceptTerminated&) { delete socket; } catch (const std::exception& e) { log_warn("error occured in device: " << e.what() << "; delete " << static_cast(socket)); delete socket; } } log_info("thread terminated"); _server.threadTerminated(this); } } } cxxtools-3.0/src/bin/scanner.h0000664000175000017500000000512313644433072013332 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_SCANNER_H #define CXXTOOLS_BIN_SCANNER_H #include #include #include #include namespace cxxtools { namespace bin { class Deserializer; class Scanner { public: Scanner() : _state(state_0), _deserializer(0), _composer(0), _count(0), _failed(false), _errorCode(0) { } void begin(Deserializer& handler, IComposer& composer); bool advance(std::streambuf& in); void finish(); private: enum { state_0, state_value, state_errorcode, state_errormessage, state_end } _state; Parser _vp; Deserializer* _deserializer; IComposer* _composer; unsigned short _count; bool _failed; int _errorCode; std::string _errorMessage; }; } } #endif // CXXTOOLS_BIN_SCANNER_H cxxtools-3.0/src/bin/responder.h0000664000175000017500000000560113644433072013703 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RESPONDER_H #define CXXTOOLS_BIN_RESPONDER_H #include #include #include #include #include namespace cxxtools { class ServiceProcedure; class IComposer; class IDecomposer; namespace bin { class RpcServerImpl; class Socket; class Responder { friend class Socket; enum State { state_0, state_domain, state_method, state_params, state_params_skip, state_param, state_param_skip }; public: explicit Responder(ServiceRegistry& serviceRegistry) : _serviceRegistry(serviceRegistry), _state(state_0), _proc(0), _args(0), _result(0), _failed(false) { } ~Responder(); // returns true, if request is ready and reply is put to the socket bool onInput(IOStream& ios); bool advance(std::streambuf& in); void reply(IOStream& out); void replyError(IOStream& out, const char* msg, int rc); private: ServiceRegistry& _serviceRegistry; State _state; std::string _domain; std::string _methodName; Deserializer _deserializer; ServiceProcedure* _proc; IComposer** _args; IDecomposer* _result; Formatter _formatter; bool _failed; std::string _errorMessage; }; } } #endif // CXXTOOLS_BIN_RESPONDER_H cxxtools-3.0/src/bin/rpcclientimpl.cpp0000664000175000017500000002305513644433072015105 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcclientimpl.h" #include #include #include #include #include #include log_define("cxxtools.bin.rpcclient.impl") namespace cxxtools { namespace bin { RpcClientImpl::RpcClientImpl() : _stream(_socket, 8192, true), _ssl(false), _sslVerifyLevel(0), _exceptionPending(false), _proc(0), _timeout(Selectable::WaitInfinite), _connectTimeoutSet(false), _connectTimeout(Selectable::WaitInfinite) { cxxtools::connect(_socket.connected, *this, &RpcClientImpl::onConnect); cxxtools::connect(_socket.sslConnected, *this, &RpcClientImpl::onSslConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &RpcClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &RpcClientImpl::onInput); } void RpcClientImpl::connect() { _socket.setTimeout(_connectTimeout); _socket.close(); _socket.connect(_addrInfo); if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); _socket.sslConnect(); } } void RpcClientImpl::close() { _socket.close(); } void RpcClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); if (_proc) throw std::logic_error("asyncronous request already running"); _proc = &method; prepareRequest(method.name(), argv, argc); try { if (_socket.isConnected()) { try { _stream.buffer().beginWrite(); } catch (const IOError&) { log_debug("write failed, connection is not active any more"); _socket.beginConnect(_addrInfo); } } else { log_debug("not yet connected - do it now"); _socket.beginConnect(_addrInfo); } } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } _scanner.begin(_deserializer, r); } void RpcClientImpl::endCall() { _proc = 0; _formatter.finish(); if (_exceptionPending) { _exceptionPending = false; throw; } } void RpcClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { try { _proc = &method; StreamBuffer& sb = _stream.buffer(); if (_socket.isConnected()) { log_debug("socket is connected"); try { prepareRequest(_proc->name(), argv, argc); _socket.setTimeout(timeout()); sb.pubsync(); // try to read from socket to check if still connected // sgetc fills the input buffer but do not consume the character int ch = sb.sgetc(); if (ch == StreamBuffer::traits_type::eof()) { log_debug("reading failed"); _socket.close(); } } catch (const std::exception& e) { log_debug("request failed: " << e.what()); _socket.close(); } } if (!_socket.isConnected()) { log_debug("socket is not connected"); _socket.setTimeout(_connectTimeout); _socket.connect(_addrInfo); if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); _socket.sslConnect(); } prepareRequest(_proc->name(), argv, argc); _socket.setTimeout(timeout()); sb.pubsync(); } _scanner.begin(_deserializer, r); while (true) { if (sb.sgetc() == std::streambuf::traits_type::eof()) { cancel(); throw std::runtime_error("reading result failed"); } if (_scanner.advance(sb)) { _proc = 0; _scanner.finish(); break; } } } catch (const RemoteException& e) { _proc = 0; throw; } catch (const std::exception& e) { cancel(); throw; } } void RpcClientImpl::cancel() { _socket.close(); _stream.clear(); _stream.buffer().discard(); _proc = 0; } void RpcClientImpl::wait(Timespan timeout) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (timeout >= Timespan(0)) clock.start(); Timespan remaining = timeout; while (activeProcedure() != 0) { if (_socket.selector()->wait(remaining) == false) throw IOTimeout(); if (timeout >= Timespan(0)) { remaining = timeout - clock.stop(); if (remaining < Timespan(0)) remaining = Timespan(0); } } } void RpcClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { _formatter.begin(_stream); if (_domain.empty()) _stream << '\xc0' << name << '\0'; else _stream << '\xc3' << _domain << '\0' << name << '\0'; for(unsigned n = 0; n < argc; ++n) { argv[n]->format(_formatter); } _stream << '\xff'; } void RpcClientImpl::onConnect(net::TcpSocket& socket) { try { log_trace("onConnect"); socket.endConnect(); _exceptionPending = false; if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); socket.beginSslConnect(); return; } _stream.buffer().beginWrite(); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onSslConnect(net::TcpSocket& socket) { try { log_trace("onSslConnect"); _exceptionPending = false; socket.endSslConnect(); _stream.buffer().beginWrite(); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onOutput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endWrite(); if (sb.out_avail() > 0) sb.beginWrite(); else sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onInput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endRead(); if (sb.device()->eof()) throw IOError("end of input"); if (_scanner.advance(sb)) { _scanner.finish(); IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); return; } if (!_stream) { close(); throw std::runtime_error("reading result failed"); } sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } } } cxxtools-3.0/src/bin/rpcserverimpl.h0000664000175000017500000001216013644433072014575 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RPCSERVERIMPL_H #define CXXTOOLS_BIN_RPCSERVERIMPL_H #include #include #include #include #include #include #include #include #include #include namespace cxxtools { class EventLoopBase; class ServiceProcedure; namespace net { class TcpServer; } namespace bin { class RpcServerImpl; class Worker; class Socket; class IdleSocketEvent; class ServerStartEvent; class NoWaitingThreadsEvent; class ThreadTerminatedEvent; class ActiveSocketEvent; class RpcServerImpl : public Connectable { #if __cplusplus >= 201103L RpcServerImpl(const RpcServerImpl&) = delete; RpcServerImpl& operator=(const RpcServerImpl&) = delete; #else RpcServerImpl(const RpcServerImpl&); RpcServerImpl& operator=(const RpcServerImpl&); #endif public: RpcServerImpl(EventLoopBase& eventLoop, Signal& runmodeChanged, ServiceRegistry& serviceRegistry); ~RpcServerImpl(); void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa); unsigned minThreads() const { return _minThreads; } void minThreads(unsigned m) { _minThreads = m; } unsigned maxThreads() const { return _maxThreads; } void maxThreads(unsigned m) { _maxThreads = m; } void terminate(); RpcServer::Runmode runmode() const { return _runmode; } Delegate acceptSslCertificate; private: void runmode(RpcServer::Runmode runmode) { _runmode = runmode; _runmodeChanged(runmode); } RpcServer::Runmode _runmode; Signal& _runmodeChanged; EventLoopBase& _eventLoop; void noWaitingThreads(); void onInput(Socket& _socket); void addIdleSocket(Socket* socket); void onIdleSocket(const IdleSocketEvent& event); void onActiveSocket(const ActiveSocketEvent& event); void onNoWaitingThreads(const NoWaitingThreadsEvent& event); void onThreadTerminated(const ThreadTerminatedEvent& event); void onServerStart(const ServerStartEvent& event); void start(); friend class Worker; friend class Socket; //////////////////////////////////////////////////// MethodSlot inputSlot; ServiceRegistry& _serviceRegistry; unsigned _minThreads; unsigned _maxThreads; std::vector _listener; Queue _queue; typedef std::set IdleSocket; IdleSocket _idleSocket; Mutex _threadMutex; Condition _threadTerminated; typedef std::set Threads; Threads _threads; Threads _terminatedThreads; void threadTerminated(Worker* worker); bool isTerminating() const { return runmode() == RpcServer::Terminating; } }; } } #endif // CXXTOOLS_BIN_RPCSERVERIMPL_H cxxtools-3.0/src/bin/responder.cpp0000664000175000017500000001617613644433072014247 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "responder.h" #include "rpcserverimpl.h" #include #include #include #include log_define("cxxtools.bin.responder") namespace cxxtools { namespace bin { Responder::~Responder() { if (_proc) _serviceRegistry.releaseProcedure(_proc); } void Responder::reply(IOStream& out) { log_info("send reply"); out << '\xc1'; _formatter.begin(out); _result->format(_formatter); _formatter.finish(); out << '\xff'; } void Responder::replyError(IOStream& out, const char* msg, int rc) { log_info("send error \"" << msg << '"'); out << '\xc2' << static_cast(static_cast(rc) >> 24) << static_cast(static_cast(rc) >> 16) << static_cast(static_cast(rc) >> 8) << static_cast(static_cast(rc)) << msg << '\0' << '\xff'; } bool Responder::onInput(IOStream& ios) { while (ios.buffer().in_avail() > 0) { if (advance(ios.buffer())) { if (_failed) { replyError(ios, _errorMessage.c_str(), 0); } else { try { _result = _proc->endCall(); reply(ios); } catch (const RemoteException& e) { ios.buffer().discard(); replyError(ios, e.what(), e.rc()); } catch (const std::exception& e) { ios.buffer().discard(); replyError(ios, e.what(), 0); } } _serviceRegistry.releaseProcedure(_proc); _proc = 0; _args = 0; _result = 0; _state = state_0; _failed = false; _errorMessage.clear(); _deserializer.begin(); return true; } } return false; } bool Responder::advance(std::streambuf& in) { std::streambuf::int_type chi; while ((chi = in.sgetc()) != std::streambuf::traits_type::eof()) { char ch = std::streambuf::traits_type::to_char_type(chi); switch (_state) { case state_0: log_debug("new rpc request"); if (ch == '\xc0') _state = state_method; else if (ch == '\xc3') _state = state_domain; else throw std::runtime_error("domain or method name expected"); in.sbumpc(); break; case state_domain: if (ch == '\0') { log_info_if(!_domain.empty(), "rpc method domain \"" << _domain << '"'); _state = state_method; } else _domain += ch; in.sbumpc(); break; case state_method: if (ch == '\0') { log_info("rpc method \"" << _methodName << '"'); _proc = _serviceRegistry.getProcedure(_domain.empty() ? _methodName : _domain + '\0' + _methodName); if (_proc) { _args = _proc->beginCall(); _state = state_params; } else { _failed = true; _errorMessage = "unknown method \"" + _methodName + '"'; _state = state_params_skip; } _methodName.clear(); _domain.clear(); } else _methodName += ch; in.sbumpc(); break; case state_params: if (ch == '\xff') { if (_args && *_args) { _failed = true; _errorMessage = "argument expected"; } in.sbumpc(); return true; } else { if (_args == 0 || *_args == 0) { _failed = true; _errorMessage = "too many arguments"; _state = state_params_skip; } else { _deserializer.begin(false); _state = state_param; } } break; case state_params_skip: if (ch == '\xff') { in.sbumpc(); return true; } else { _deserializer.skip(); _state = state_param_skip; } break; case state_param: if (_deserializer.advance(in)) { try { (*_args)->fixup(_deserializer.si()); ++_args; _state = state_params; } catch (const std::exception& e) { _failed = true; _errorMessage = e.what(); _state = state_params_skip; } } break; case state_param_skip: if (_deserializer.advance(in)) _state = state_params_skip; break; } } return false; } } } cxxtools-3.0/src/timer.cpp0000664000175000017500000001515113644433072012606 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/timer.h" #include "cxxtools/clock.h" #include "cxxtools/selector.h" #include "cxxtools/datetime.h" #include namespace cxxtools { class Timer::Sentry { public: Sentry(Sentry*& sentry) : _deleted(false) , _sentry(sentry) { sentry = this; } ~Sentry() { if( ! _deleted ) this->detach(); } bool operator!() const { return _deleted; } void detach() { _sentry = 0; _deleted = true; } bool _deleted; Sentry*& _sentry; }; Timer::Timer(SelectorBase* selector) : _sentry(0) , _selector(0) , _active(false) , _finished(0) { if (selector) setSelector(selector); } Timer::~Timer() { try { if(_selector) _selector->remove(*this); } catch(...) {} if(_sentry) _sentry->detach(); } bool Timer::active() const { return _active; } const Timespan& Timer::interval() const { return _interval; } void Timer::start(const Milliseconds& interval) { if (interval <= Timespan(0)) throw std::logic_error("cannot run interval timer without interval"); if (_active) stop(); _active = true; _interval = interval; _once = false; _finished = Clock::getSystemTicks() + _interval; if (_selector) _selector->onTimerChanged(*this); } void Timer::start(const DateTime& startTime, const Milliseconds& interval, bool localtime) { if (interval <= Timespan(0)) throw std::logic_error("cannot run interval timer without interval"); if (_active) stop(); _active = true; _interval = interval; _once = false; Timespan systemTime = Clock::getSystemTicks(); struct tm tim; time_t sec = static_cast(systemTime.totalSeconds()); if (localtime) localtime_r(&sec, &tim); else gmtime_r(&sec, &tim); DateTime now(tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, 0, systemTime.totalUSecs() % 1000000); if (startTime > now) { _finished = systemTime + (startTime - now); } else { // startTime =< now Timespan elapsed = now - startTime; uint64_t ticksElapsed = elapsed.totalMSecs() / interval.totalMSecs(); DateTime tickTime = startTime + (ticksElapsed + 1) * Timespan(interval); _finished = systemTime + (tickTime - now); } if (_selector) _selector->onTimerChanged(*this); } void Timer::after(const Milliseconds& interval) { start(interval); _once = true; } void Timer::at(const DateTime& tickTime, bool localtime) { if (_active) stop(); _once = true; DateTime now = localtime ? DateTime(Clock::getLocalTime()) : DateTime(Clock::getSystemTime()); if (tickTime >= now) { _active = true; _finished = Clock::getSystemTicks() + (tickTime - now); if (_selector) _selector->onTimerChanged(*this); } } void Timer::at(const UtcDateTime& tickTime) { at(DateTime(tickTime), false); } void Timer::stop() { _active = false; _finished = Timespan(0); if(_selector) _selector->onTimerChanged(*this); } bool Timer::update() { if(_active == false) return false; Timespan now = Clock::getSystemTicks(); return this->update(now); } bool Timer::update(const Milliseconds& now) { if(_active == false) return false; bool hasElapsed = now >= _finished; Timer::Sentry sentry(_sentry); DateTime ts; while( _active && now >= _finished ) { Milliseconds currentTs = _finished; // We add another interval before sending the signal // since sending might throw an exception. We would // skip recalculating the new time then and may loop. _finished += _interval; if( ! sentry ) return hasElapsed; if (_once) stop(); timeout.send(); // We send the signal with datetime only, when someone is // connected since it will take some time to calculate a // DateTime object from milliseconds. if (timeoutts.connectionCount() > 0) { struct tm tim; time_t sec = static_cast(currentTs.totalSeconds()); localtime_r(&sec, &tim); DateTime dueTime(tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, 0, currentTs.totalUSecs() % 1000000); timeoutts.send(dueTime); } if (timeoutUtc.connectionCount() > 0) { struct tm tim; time_t sec = static_cast(currentTs.totalSeconds()); gmtime_r(&sec, &tim); DateTime dueTime(tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, 0, currentTs.totalUSecs() % 1000000); timeoutUtc.send(dueTime); } } return hasElapsed; } void Timer::setSelector(SelectorBase* selector) { if(_selector == selector) return; if(_selector) { _selector->onRemoveTimer(*this); } if(selector) { selector->onAddTimer(*this); } _selector = selector; } } cxxtools-3.0/src/mutex.cpp0000664000175000017500000000552113644433072012630 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "muteximpl.h" #include "cxxtools/mutex.h" namespace cxxtools { Mutex::Mutex() { _impl = new MutexImpl(); } Mutex::~Mutex() { delete _impl; } void Mutex::lock() { _impl->lock(); } bool Mutex::tryLock() { return _impl->tryLock(); } void Mutex::unlock() { _impl->unlock(); } bool Mutex::unlockNoThrow() { try { _impl->unlock(); return true; } catch(...) {} return false; } RecursiveMutex::RecursiveMutex() { _impl = new MutexImpl(true); } RecursiveMutex::~RecursiveMutex() { delete _impl; } void RecursiveMutex::lock() { _impl->lock(); } bool RecursiveMutex::tryLock() { return _impl->tryLock(); } void RecursiveMutex::unlock() { _impl->unlock(); } bool RecursiveMutex::unlockNoThrow() { try { _impl->unlock(); return true; } catch(...) {} return false; } ReadWriteMutex::ReadWriteMutex() { _impl = new ReadWriteMutexImpl(); } ReadWriteMutex::~ReadWriteMutex() { delete _impl; } void ReadWriteMutex::readLock() { _impl->readLock(); } bool ReadWriteMutex::tryReadLock() { return _impl->tryReadLock(); } void ReadWriteMutex::writeLock() { _impl->writeLock(); } bool ReadWriteMutex::tryWriteLock() { return _impl->tryWriteLock(); } void ReadWriteMutex::unlock() { _impl->unlock(); } bool ReadWriteMutex::unlockNoThrow() { try { _impl->unlock(); return true; } catch(...) {} return false; } } cxxtools-3.0/src/fileinfo.cpp0000664000175000017500000000732613644433072013266 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fileinfoimpl.h" #include "fileimpl.h" #include "directoryimpl.h" #include "cxxtools/fileinfo.h" #include "cxxtools/directory.h" namespace cxxtools { FileInfo::FileInfo() : _type(FileInfo::Invalid) {} FileInfo::FileInfo(const std::string& path) : _path(path) { _type = FileInfoImpl::getType( path.c_str() ); } FileInfo::FileInfo(const DirectoryIterator& it) : _path(it.path()) { _type = FileInfoImpl::getType( _path.c_str() ); } FileInfo::FileInfo(const FileInfo& fi) : _type(fi._type) , _path(fi._path) { } FileInfo::~FileInfo() { } FileInfo& FileInfo::operator=(const FileInfo& fi) { _type = fi._type; _path = fi._path; return *this; } FileInfo::Type FileInfo::type() const { return _type; } std::string FileInfo::name() const { std::string::size_type pos = _path.rfind( DirectoryImpl::sep() ); if (pos != std::string::npos) { return _path.substr(pos + 1); } else { return _path; } } const std::string& FileInfo::path() const { return _path; } std::string FileInfo::dirName() const { // Find last slash. This separates the file name from the path. std::string::size_type pos = _path.find_last_of( DirectoryImpl::sep() ); // If there is no separator, the file is relative to the current // directory. So an empty path is returned. if (pos == std::string::npos) { return ""; } // Include trailing separator to be able to distinguish between no // path ("") and a path which is relative to the root ("/"), for example. return _path.substr(0, pos + 1); } std::size_t FileInfo::size() const { if(_type == FileInfo::File || _type == FileInfo::Symlink) { return FileImpl::size( _path.c_str() ); } return 0; } void FileInfo::remove() { if (_type == FileInfo::Directory) { return DirectoryImpl::remove( _path.c_str() ); } return FileImpl::remove( _path.c_str() ); } void FileInfo::move(const std::string& to) { if(_type == FileInfo::Directory) { return DirectoryImpl::move( _path.c_str(), to.c_str() ); } return FileImpl::move( _path.c_str(), to.c_str() ); } bool FileInfo::exists(const std::string& path) { return FileInfo::getType( path ) != FileInfo::Invalid; } FileInfo::Type FileInfo::getType(const std::string& path) { return FileInfoImpl::getType( path ); } } // namespace cxxtools cxxtools-3.0/src/posix/0000775000175000017500000000000013672344760012207 500000000000000cxxtools-3.0/src/posix/pipestream.cpp0000664000175000017500000001065213644433072015002 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include log_define("cxxtools.pipestream") namespace cxxtools { namespace posix { Pipestreambuf::Pipestreambuf(unsigned bufsize_) : bufsize(bufsize_), ibuffer(0), obuffer(0) { } Pipestreambuf::~Pipestreambuf() { log_debug("Pipestreambuf::~Pipestreambuf()"); try { closeReadFd(); } catch (const std::exception& e) { log_debug("ignore exception in closing read pipe: " << e.what()); } try { closeWriteFd(); } catch (const std::exception& e) { log_debug("ignore exception in closing write pipe: " << e.what()); } delete [] ibuffer; delete [] obuffer; } std::streambuf::int_type Pipestreambuf::overflow(std::streambuf::int_type ch) { log_debug("overflow(" << ch << ')'); if (pptr() != pbase()) { log_debug("write " << (pptr() - pbase()) << " bytes to fd " << getWriteFd()); ssize_t ret = ::write(getWriteFd(), pbase(), pptr() - pbase()); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); else { log_debug(ret << " bytes written to fd " << getWriteFd()); if (static_cast(ret) < bufsize) std::memmove(obuffer, obuffer + ret, bufsize - ret); setp(obuffer, obuffer + bufsize); pbump(bufsize - ret); } } else { log_debug("initialize outputbuffer"); if (obuffer == 0) { log_debug("allocate " << bufsize << " bytes output buffer"); obuffer = new char[bufsize]; } setp(obuffer, obuffer + bufsize); } if (ch != traits_type::eof()) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type Pipestreambuf::underflow() { log_debug("underflow()"); if (ibuffer == 0) { log_debug("allocate " << bufsize << " bytes input buffer"); ibuffer = new char[bufsize]; } log_debug("read from fd " << getReadFd()); int ret = ::read(getReadFd(), ibuffer, bufsize); log_debug("read returned " << ret); if(ret < 0) throw SystemError(errno, "read"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes read"); setg(ibuffer, ibuffer, ibuffer + ret); return traits_type::to_int_type( *(gptr()) ); } int Pipestreambuf::sync() { log_debug("sync()"); if (pptr() != pbase()) { char* p = pbase(); while (p < pptr()) { log_debug("write " << (pptr() - p) << " bytes to fd " << getWriteFd()); ssize_t ret = ::write(getWriteFd(), p, pptr() - p); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes written to fd " << getWriteFd()); p += ret; } setp(obuffer, obuffer + bufsize); } return 0; } } } cxxtools-3.0/src/posix/daemonize.cpp0000664000175000017500000000477613644433072014616 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include namespace cxxtools { namespace posix { namespace { std::string pidfile; extern "C" { void sigstop(int) { if (!pidfile.empty()) ::unlink(pidfile.c_str()); exit(0); } } } void daemonize(const std::string& pidfile_) { cxxtools::posix::Fork fork1; if (fork1.parent()) exit(0); if (::freopen("/dev/null", "r", stdin) == 0) throw cxxtools::SystemError("freopen(stdin)"); if (::freopen("/dev/null", "w", stdout) == 0) throw cxxtools::SystemError("freopen(stdout)"); if (::freopen("/dev/null", "w", stderr) == 0) throw cxxtools::SystemError("freopen(stderr)"); if (::setsid() == -1) throw cxxtools::SystemError("setsid"); cxxtools::posix::Fork fork2; if (fork2.parent()) { // don't wait but just exit fork2.setNowait(); exit(0); } if (!pidfile_.empty()) { std::ofstream f(pidfile_.c_str()); f << getpid(); if (f) pidfile = pidfile_; signal(SIGTERM, sigstop); } } } } cxxtools-3.0/src/posix/fork.cpp0000664000175000017500000000355713644433072013600 00000000000000/* * Copyright (C) 2018 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include namespace cxxtools { namespace posix { void Fork::fork() { pid = ::fork(); if (pid < 0) throw SystemError("fork"); if (pid == 0) { // disable logging in child process to prevent deadlock if another // hold the lock for logging cxxtools::LogManager::disable(); } } int Fork::wait(int options) { int status; ::waitpid(pid, &status, options); pid = 0; return status; } } } cxxtools-3.0/src/posix/commandoutput.cpp0000664000175000017500000000362613644433072015533 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include namespace cxxtools { namespace posix { void CommandOutput::run(bool combineStderr) { _fork.fork(); if (_fork.child()) { streambuf.redirectStdout(); if (combineStderr) streambuf.redirectStderr(false); streambuf.closeReadFd(); try { _exec.exec(); } catch (const SystemError&) { ::_exit(-1); } } streambuf.closeWriteFd(); } } } cxxtools-3.0/src/posix/commandinput.cpp0000664000175000017500000000347213644433072015331 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include namespace cxxtools { namespace posix { void CommandInput::run() { _fork.fork(); if (_fork.child()) { streambuf.redirectStdin(); streambuf.closeWriteFd(); try { _exec.exec(); } catch (const SystemError&) { ::_exit(-1); } } streambuf.closeReadFd(); } } } cxxtools-3.0/src/posix/posixpipe.cpp0000664000175000017500000000407213644433072014650 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/posix/pipe.h" #include "pipeimpl.h" namespace cxxtools { namespace posix { int Pipe::getReadFd() const { return impl()->out().fd(); } int Pipe::getWriteFd() const { return impl()->in().fd(); } /// Redirect read-end to stdin. /// When the close argument is set, closes the original filedescriptor void Pipe::redirectStdin(bool close, bool inherit) { impl()->out().redirect(0, close, inherit); } void Pipe::redirectStdout(bool close, bool inherit) { impl()->in().redirect(1, close, inherit); } /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void Pipe::redirectStderr(bool close, bool inherit) { impl()->in().redirect(2, close, inherit); } } } cxxtools-3.0/src/dateutils.cpp0000664000175000017500000001056013644433072013463 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "dateutils.h" #include #include #include namespace cxxtools { const char* weekdaynames[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; const char* monthnames[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; void skipNonDigit(std::string::const_iterator& b, std::string::const_iterator e) { while (b != e && !std::isdigit(*b)) ++b; } void skipWord(std::string::const_iterator& b, std::string::const_iterator e) { while (b != e && std::isalnum(*b)) ++b; } unsigned getUnsigned(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits) { if (b == e || !std::isdigit(*b)) throw std::invalid_argument("invalid date format"); unsigned ret = 0; for (unsigned d = 0; d < digits && b != e && std::isdigit(*b); ++d, ++b) ret = ret * 10 + (*b - '0'); return ret; } unsigned getUnsignedF(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits) { unsigned ret = 0; for (unsigned d = 0; d < digits; ++d, ++b) { if (b == e || !std::isdigit(*b)) throw std::invalid_argument("invalid date format"); ret = ret * 10 + (*b - '0'); } return ret; } unsigned getInt(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits) { int sgn = 1; if (b != e) { if (*b == '-') { sgn = -1; ++b; } else if (*b == '+') ++b; } if (b == e || !std::isdigit(*b)) throw std::invalid_argument("invalid date format"); int ret = 0; for (unsigned d = 0; d < digits && b != e && std::isdigit(*b); ++d, ++b) ret = ret * 10 + (*b - '0'); return ret * sgn; } unsigned getMicroseconds(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits) { unsigned m = 0; unsigned d = 100000; for (unsigned c = 0; c < digits; ++c) { if (b == e || !std::isdigit(*b)) return m; m += (*b++ - '0') * d; d /= 10; } return m; } void appendDn(std::string& s, unsigned short n, unsigned v) { s.resize(s.size() + n); for (unsigned short i = 0; i < n; ++i) { s[s.size() - i - 1] = '0' + v % 10; v /= 10; } } void appendDn(std::string& s, unsigned short n, int v) { if (v < 0) { s += '-'; appendDn(s, n, static_cast(-v)); } else appendDn(s, n, static_cast(v)); } unsigned getMonthFromName(std::string::const_iterator& b, std::string::const_iterator e) { char m[4]; unsigned d; for (d = 0; d < 3 && b != e && std::isalpha(*b); ++d) m[d] = *b++; if (d != 3) throw std::invalid_argument("invalid date format - monthname expected"); m[3] = '\0'; for (d = 0; d < 12; ++d) { if (strcasecmp(monthnames[d], m) == 0) return d + 1; } throw std::invalid_argument("invalid date format - monthname expected"); } } cxxtools-3.0/src/pipe.cpp0000664000175000017500000000336613644433072012430 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/pipe.h" #include "pipeimpl.h" namespace cxxtools { Pipe::Pipe(OpenMode mode) { _impl = new PipeImpl(mode & IODevice::Async); } Pipe::~Pipe() { delete _impl; } IODevice& Pipe::out() { return _impl->out(); } const IODevice& Pipe::out() const { return _impl->out(); } IODevice& Pipe::in() { return _impl->in(); } const IODevice& Pipe::in() const { return _impl->in(); } } cxxtools-3.0/src/remoteclient.cpp0000664000175000017500000000267613644433072014170 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { const std::size_t RemoteClient::WaitInfinite; } cxxtools-3.0/src/serviceregistry.cpp0000664000175000017500000000503413644433072014716 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { ServiceRegistry::~ServiceRegistry() { ProcedureMap::iterator it; for(it = _procedures.begin(); it != _procedures.end(); ++it) { delete it->second; } } ServiceProcedure* ServiceRegistry::getProcedure(const std::string& name) const { ProcedureMap::const_iterator it = _procedures.find( name ); if( it == _procedures.end() ) { return 0; } return it->second->clone(); } void ServiceRegistry::releaseProcedure(ServiceProcedure* proc) const { delete proc; } std::vector ServiceRegistry::getProcedureNames() const { std::vector procs; for (ProcedureMap::const_iterator it = _procedures.begin(); it != _procedures.end(); ++it) { procs.push_back(it->first); } return procs; } void ServiceRegistry::registerProcedure(const std::string& name, ServiceProcedure* proc) { ProcedureMap::iterator it = _procedures.find(name); if (it == _procedures.end()) { std::pair p( name, proc ); _procedures.insert( p ); } else { delete it->second; it->second = proc; } } } cxxtools-3.0/src/semaphoreimpl.h0000664000175000017500000000336013644433072013777 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SemaphoreImpl_h #define cxxtools_SemaphoreImpl_h #include namespace cxxtools { class SemaphoreImpl { public: SemaphoreImpl(unsigned int initial = 0); ~SemaphoreImpl(); void wait(); bool tryWait(); void post(); private: sem_t _handle; }; } // !namespace cxxtools #endif cxxtools-3.0/src/iso8859_codec.cpp0000664000175000017500000011006013644433072013746 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iso8859_1codec.h" #include "cxxtools/iso8859_2codec.h" #include "cxxtools/iso8859_3codec.h" #include "cxxtools/iso8859_4codec.h" #include "cxxtools/iso8859_5codec.h" #include "cxxtools/iso8859_6codec.h" #include "cxxtools/iso8859_7codec.h" #include "cxxtools/iso8859_8codec.h" #include "cxxtools/iso8859_9codec.h" #include "cxxtools/iso8859_10codec.h" #include "cxxtools/iso8859_11codec.h" #include "cxxtools/iso8859_13codec.h" #include "cxxtools/iso8859_14codec.h" #include "cxxtools/iso8859_15codec.h" #include "cxxtools/iso8859_16codec.h" namespace cxxtools { namespace { static const Char::value_type iso8859_1CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, }; static const Char::value_type iso8859_2CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9, }; static const Char::value_type iso8859_3CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0020, 0x0124, 0x00A7, 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0020, 0x017B, 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0020, 0x017C, 0x00C0, 0x00C1, 0x00C2, 0x0020, 0x00C4, 0x010A, 0x0108, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0020, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x0020, 0x00E4, 0x010B, 0x0109, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0020, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9, }; static const Char::value_type iso8859_4CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF, 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B, 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A, 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF, 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B, 0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9, }; static const Char::value_type iso8859_5CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F, }; static const Char::value_type iso8859_6CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0020, 0x0020, 0x0020, 0x00A4, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x060C, 0x00AD, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x061B, 0x0020, 0x0020, 0x0020, 0x061F, 0x0020, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0x0650, 0x0651, 0x0652, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, }; static const Char::value_type iso8859_7CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x0020, 0x2015, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x0020, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0020, }; static const Char::value_type iso8859_8CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0020, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x2017, 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x0020, 0x0020, 0x200E, 0x200F, 0x0020, }; static const Char::value_type iso8859_9CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF, }; static const Char::value_type iso8859_10CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A, 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B, 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138, }; static const Char::value_type iso8859_11CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F, 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F, 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, 0x0E38, 0x0E39, 0x0E3A, 0x0020, 0x0020, 0x0020, 0x0020, 0x0E3F, 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F, 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0020, 0x0020, 0x0020, 0x0020, }; static const Char::value_type iso8859_13CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019, }; static const Char::value_type iso8859_14CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178, 0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF, }; static const Char::value_type iso8859_15CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, }; static const Char::value_type iso8859_16CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0104, 0x0105, 0x0141, 0x20AC, 0x201E, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x0218, 0x00AB, 0x0179, 0x00AD, 0x017A, 0x017B, 0x00B0, 0x00B1, 0x010C, 0x0142, 0x017D, 0x201D, 0x00B6, 0x00B7, 0x017E, 0x010D, 0x0219, 0x00BB, 0x0152, 0x0153, 0x0178, 0x017C, 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0106, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0110, 0x0143, 0x00D2, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x015A, 0x0170, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0118, 0x021A, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x0107, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0111, 0x0144, 0x00F2, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x015B, 0x0171, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0119, 0x021B, 0x00FF, }; } Iso8859_1Codec::Iso8859_1Codec(size_t ref) : CharMapCodec(iso8859_1CharMap, ref) { } Iso8859_2Codec::Iso8859_2Codec(size_t ref) : CharMapCodec(iso8859_2CharMap, ref) { } Iso8859_3Codec::Iso8859_3Codec(size_t ref) : CharMapCodec(iso8859_3CharMap, ref) { } Iso8859_4Codec::Iso8859_4Codec(size_t ref) : CharMapCodec(iso8859_4CharMap, ref) { } Iso8859_5Codec::Iso8859_5Codec(size_t ref) : CharMapCodec(iso8859_5CharMap, ref) { } Iso8859_6Codec::Iso8859_6Codec(size_t ref) : CharMapCodec(iso8859_6CharMap, ref) { } Iso8859_7Codec::Iso8859_7Codec(size_t ref) : CharMapCodec(iso8859_7CharMap, ref) { } Iso8859_8Codec::Iso8859_8Codec(size_t ref) : CharMapCodec(iso8859_8CharMap, ref) { } Iso8859_9Codec::Iso8859_9Codec(size_t ref) : CharMapCodec(iso8859_9CharMap, ref) { } Iso8859_10Codec::Iso8859_10Codec(size_t ref) : CharMapCodec(iso8859_10CharMap, ref) { } Iso8859_11Codec::Iso8859_11Codec(size_t ref) : CharMapCodec(iso8859_11CharMap, ref) { } Iso8859_13Codec::Iso8859_13Codec(size_t ref) : CharMapCodec(iso8859_13CharMap, ref) { } Iso8859_14Codec::Iso8859_14Codec(size_t ref) : CharMapCodec(iso8859_14CharMap, ref) { } Iso8859_15Codec::Iso8859_15Codec(size_t ref) : CharMapCodec(iso8859_15CharMap, ref) { } Iso8859_16Codec::Iso8859_16Codec(size_t ref) : CharMapCodec(iso8859_16CharMap, ref) { } } // namespace cxxtools cxxtools-3.0/src/semaphoreimpl.cpp0000664000175000017500000000430513644433072014332 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "semaphoreimpl.h" #include "cxxtools/systemerror.h" #include namespace cxxtools { SemaphoreImpl::SemaphoreImpl(unsigned int initial) { int ret = sem_init(&_handle, 0, initial); if( ret == -1 ) throw SystemError("sem_init"); } SemaphoreImpl::~SemaphoreImpl() { sem_destroy( &_handle ); } void SemaphoreImpl::wait() { int ret = sem_wait(&_handle); if(ret == -1) throw SystemError("sem_wait"); } bool SemaphoreImpl::tryWait() { int ret = sem_trywait( &_handle ); if(ret == -1) { if(errno == EAGAIN) return false; throw SystemError("sem_trywait"); } return true; } void SemaphoreImpl::post() { again: if( 0 != sem_post(&_handle) ) { if(errno == EINTR) goto again; throw SystemError("sem_post"); } } } // namespace cxxtools cxxtools-3.0/src/eventsource.cpp0000664000175000017500000001144613644433072014033 00000000000000/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/eventsource.h" #include "cxxtools/eventsink.h" namespace cxxtools { RecursiveMutex dmx; struct EventSource::Sentry { Sentry(const EventSource* es) : _es(es) { _es->_sentry = this; _es->_dirty = false; } ~Sentry() { if( _es ) this->detach(); } void detach() { if( _es->_dirty ) { SinkMap::iterator it = _es->_sinks.begin(); while( it != _es->_sinks.end() ) { if( it->second ) { ++it; } else { _es->_sinks.erase(it++); } } } _es->_dirty = false; _es->_sentry = 0; _es = 0; } bool operator!() const { return _es == 0; } const EventSource* _es; }; EventSource::EventSource() : _dmutex(&dmx) , _sentry(0) , _dirty(false) { } EventSource::~EventSource() { RecursiveLock dlock(*_dmutex); while( true ) { RecursiveLock lock( _mutex ); if(_sentry) _sentry->detach(); if( _sinks.empty() ) return; EventSink* sink = _sinks.begin()->second; if( ! this->tryDisconnect(*sink) ) { lock.unlock(); Thread::yield(); } } } void EventSource::connect(EventSink& sink) { RecursiveLock lock( _mutex ); sink.onConnect(*this); const std::type_info* ti = 0; SinkMap::value_type elem(ti, &sink); _sinks.insert( elem ); //_sinks.insert( std::make_pair(ti, &sink) ); } void EventSource::disconnect(EventSink& sink) { RecursiveLock lock( _mutex ); sink.onDisconnect(*this); SinkMap::iterator it = _sinks.begin(); while( it != _sinks.end() ) { if(it->second == &sink) { if(_sentry) { _dirty = true; it->second = 0; } else { _sinks.erase(it++); continue; } } ++it; } } bool EventSource::tryDisconnect(EventSink& sink) { if( _dmutex->tryLock() ) { this->disconnect(sink); _dmutex->unlock(); return true; } return false; } void EventSource::subscribe(EventSink& sink, const std::type_info& ti) { RecursiveLock lock( _mutex ); sink.onConnect(*this); SinkMap::value_type elem(&ti, &sink); _sinks.insert( elem ); //_sinks.insert( std::make_pair(&ti, &sink) ); } void EventSource::unsubscribe(EventSink& sink, const std::type_info& ti) { RecursiveLock lock( _mutex ); sink.onUnsubscribe(*this); SinkMap::iterator it = _sinks.lower_bound(&ti); while( it != _sinks.end() && *(it->first) == ti ) { if(it->second == &sink) { if(_sentry) { _dirty = true; it->second = 0; } else { _sinks.erase(it++); continue; } } ++it; } } void EventSource::send(const cxxtools::Event& ev) { RecursiveLock lock(_mutex); EventSource::Sentry sentry(this); SinkMap::iterator it; for(it = _sinks.begin(); it != _sinks.end(); ++it) { EventSink* sink = it->second; if(sink) sink->commitEvent(ev); if( ! sentry ) return; } } } // namespace cxxtools cxxtools-3.0/src/fileimpl.h0000664000175000017500000000400413644433072012727 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { class FileImpl { public: FileImpl(); ~FileImpl(); static std::size_t size(const std::string& path); static void resize(const std::string& path, std::size_t n); static void remove(const std::string& path); static void move(const std::string& path, const std::string& to); static void link(const std::string& path, const std::string& to); static void symlink(const std::string& path, const std::string& to); static void copy(const std::string& path, const std::string& to); static void create(const std::string& path); }; } // namespace cxxtools cxxtools-3.0/src/tcpserver.cpp0000664000175000017500000000572413644433072013510 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "tcpserverimpl.h" #include #include namespace cxxtools { namespace net { namespace { std::string AddressInUseMsg(const std::string& ipaddr, unsigned short int port) { std::ostringstream msg; msg << "address " << ipaddr << ':' << port << " in use"; return msg.str(); } } AddressInUse::AddressInUse(const std::string& ipaddr, unsigned short int port) : IOError(AddressInUseMsg(ipaddr, port)) { } TcpServer::TcpServer() : _impl(0) { _impl = new TcpServerImpl(*this); } TcpServer::TcpServer(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags) : _impl(0) { _impl = new TcpServerImpl(*this); try { listen(ipaddr, port, backlog, flags); } catch (...) { delete _impl; throw; } } TcpServer::~TcpServer() { try { this->close(); } catch(...) {} delete _impl; } void TcpServer::listen(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags) { this->close(); _impl->listen(ipaddr, port, backlog, flags); this->setEnabled(true); } void TcpServer::terminateAccept() { _impl->terminateAccept(); } SelectableImpl& TcpServer::simpl() { return *_impl; } TcpServerImpl& TcpServer::impl() const { return *_impl; } void TcpServer::onClose() { _impl->close(); } bool TcpServer::onWait(Timespan timeout) { return _impl->wait(timeout); } void TcpServer::onAttach(SelectorBase& sb) { _impl->attach(sb); } void TcpServer::onDetach(SelectorBase& sb) { _impl->detach(sb); } } // namespace net } // namespace cxxtools cxxtools-3.0/src/tcpsocket.cpp0000664000175000017500000001644113644433072013470 00000000000000/* * Copyright (C) 2006-2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "tcpsocketimpl.h" #include "cxxtools/net/tcpsocket.h" #include "cxxtools/log.h" #include "cxxtools/systemerror.h" #include "cxxtools/ioerror.h" #include "cxxtools/sslcertificate.h" #include #include #include "config.h" log_define("cxxtools.net.tcpsocket") namespace cxxtools { namespace net { TcpSocket::TcpSocket() : _impl(new TcpSocketImpl(*this)) { } TcpSocket::TcpSocket(const TcpServer& server, unsigned flags) : _impl(new TcpSocketImpl(*this)) { try { accept(server, flags); } catch (...) { delete _impl; throw; } } TcpSocket::TcpSocket(const std::string& ipaddr, unsigned short int port) : _impl(new TcpSocketImpl(*this)) { try { connect(ipaddr, port); } catch (...) { delete _impl; throw; } } TcpSocket::TcpSocket(const AddrInfo& addrinfo) : _impl(new TcpSocketImpl(*this)) { try { connect(addrinfo); } catch (...) { delete _impl; throw; } } TcpSocket::~TcpSocket() { try { close(); } catch(const std::exception& e) { log_error("TcpSocket::close failed: " << e.what()); } delete _impl; } std::string TcpSocket::getSockAddr() const { return _impl->getSockAddr(); } std::string TcpSocket::getPeerAddr() const { return _impl->getPeerAddr(); } void TcpSocket::setTimeout(Milliseconds timeout) { _impl->setTimeout(timeout); } Milliseconds TcpSocket::timeout() const { return _impl->timeout(); } void TcpSocket::connect(const AddrInfo& addrinfo) { close(); _impl->beginConnect(addrinfo); _impl->endConnect(); setEnabled(true); setAsync(true); setEof(false); } bool TcpSocket::beginConnect(const AddrInfo& addrinfo) { close(); bool ret = _impl->beginConnect(addrinfo); setEnabled(true); setAsync(true); setEof(false); if (ret) connected(*this); return ret; } void TcpSocket::endConnect() { try { _impl->endConnect(); } catch (...) { close(); throw; } } bool TcpSocket::isConnected() const { return _impl->isConnected(); } bool TcpSocket::isSslConnected() const { #ifdef WITH_SSL return _impl->isSslConnected(); #else return false; #endif } int TcpSocket::getFd() const { return _impl->fd(); } void TcpSocket::loadSslCertificateFile(const std::string& certFile, const std::string& privateKeyFile) { #ifdef WITH_SSL _impl->loadSslCertificateFile(certFile, privateKeyFile); #else log_warn("can't load certificate file since ssl is disabled"); #endif } void TcpSocket::setSslVerify(int level, const std::string& ca) { #ifdef WITH_SSL _impl->setSslVerify(level, ca); #else log_warn("can't set ssl verify level since ssl is disabled"); #endif } bool TcpSocket::hasSslPeerCertificate() const { #ifdef WITH_SSL return getSslPeerCertificate(); #else return false; #endif } const SslCertificate& TcpSocket::getSslPeerCertificate() const { #ifdef WITH_SSL return _impl->getSslPeerCertificate(); #else log_warn("can't get ssl peer certificate since ssl is disabled"); static SslCertificate cert; return cert; #endif } void TcpSocket::beginSslConnect() { #ifdef WITH_SSL if (_impl->beginSslConnect()) sslConnected(*this); #else log_warn("can't connect ssl since ssl is disabled"); sslConnected(*this); #endif } void TcpSocket::endSslConnect() { #ifdef WITH_SSL _impl->endSslConnect(); #endif } void TcpSocket::sslConnect() { #ifdef WITH_SSL _impl->beginSslConnect(); _impl->endSslConnect(); #else log_warn("can't connect ssl since ssl is disabled"); sslConnected(*this); #endif } void TcpSocket::beginSslAccept() { #ifdef WITH_SSL if (_impl->beginSslAccept()) sslAccepted(*this); #else log_warn("can't accept ssl connection since ssl is disabled"); sslAccepted(*this); #endif } void TcpSocket::endSslAccept() { #ifdef WITH_SSL _impl->endSslAccept(); #endif } void TcpSocket::sslAccept() { #ifdef WITH_SSL _impl->beginSslAccept(); _impl->endSslAccept(); #else log_warn("can't accept ssl connection since ssl is disabled"); #endif } void TcpSocket::beginSslShutdown() { #ifdef WITH_SSL if (_impl->beginSslShutdown()) sslClosed(*this); #else log_warn("can't shutdown ssl connection since ssl is disabled"); sslClosed(*this); #endif } void TcpSocket::endSslShutdown() { #ifdef WITH_SSL _impl->endSslShutdown(); #endif } void TcpSocket::sslShutdown() { #ifdef WITH_SSL _impl->beginSslShutdown(); _impl->endSslShutdown(); #else log_warn("can't shutdown ssl connection since ssl is disabled"); #endif } void TcpSocket::accept(const TcpServer& server, unsigned flags) { close(); _impl->accept(server, flags); setEnabled(true); setAsync(true); setEof(false); } SelectableImpl& TcpSocket::simpl() { return *_impl; } size_t TcpSocket::onBeginRead(char* buffer, size_t n, bool& eof) { if (!_impl->isConnected()) throw IOError("socket not connected when trying to read"); return _impl->beginRead(buffer, n, eof); } size_t TcpSocket::onBeginWrite(const char* buffer, size_t n) { if (!_impl->isConnected()) throw IOError("socket not connected when trying to write"); return _impl->beginWrite(buffer, n); } IODeviceImpl& TcpSocket::ioimpl() { return *_impl; } short TcpSocket::poll(short events) const { struct pollfd fds; fds.fd = _impl->fd(); fds.events = events; int timeout = getTimeout().ceil(); log_debug("poll timeout " << timeout); int p = ::poll(&fds, 1, timeout); log_debug("poll returns " << p << " revents " << fds.revents); if (p < 0) { log_error("error in poll; errno=" << errno); throw SystemError("poll"); } else if (p == 0) { log_debug("poll timeout (" << timeout << ')'); throw IOTimeout(); } return fds.revents; } } // namespace net } // namespace cxxtools cxxtools-3.0/src/convert.cpp0000664000175000017500000003363213644433072013152 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace cxxtools { template void _skipws(IterT& it, IterT end) { while (it != end && isspace(*it)) ++it; } template class nullterm_array_iterator : public std::iterator { public: nullterm_array_iterator() : _ptr(0) { } explicit nullterm_array_iterator(const T* ptr) : _ptr(ptr) { if(*_ptr == '\0') _ptr = 0; } nullterm_array_iterator& operator=(const nullterm_array_iterator& it) { _ptr = it._ptr; return *this; } bool operator==(const nullterm_array_iterator& it) const { return _ptr == it._ptr; } bool operator!=(const nullterm_array_iterator& it) const { return _ptr != it._ptr; } const T& operator*() const { return *_ptr; } nullterm_array_iterator& operator++() { if(*++_ptr == '\0') _ptr = 0; return *this; } nullterm_array_iterator operator++(int) { if(*++_ptr == '\0') _ptr = 0; return *this; } private: const T* _ptr; }; template void convertInt(T& n, const String& str, const char* typeto) { bool ok = false; String::const_iterator r = getInt( str.begin(), str.end(), ok, n, DecimalFormat() ); if (ok) _skipws(r, str.end()); if( r != str.end() || ! ok ) ConversionError::doThrow(typeto, "String", str.narrow().c_str()); } template void convertInt(T& n, const std::string& str, const char* typeto) { bool ok = false; std::string::const_iterator r = getInt( str.begin(), str.end(), ok, n ); if (ok) _skipws(r, str.end()); if( r != str.end() || ! ok ) ConversionError::doThrow(typeto, "string", str.c_str()); } template void convertInt(T& n, const char* str, const char* typeto) { bool ok = false; nullterm_array_iterator it(str); nullterm_array_iterator end; it = getInt( it, end, ok, n ); if (ok) _skipws(it, end); if( it != end || ! ok ) ConversionError::doThrow(typeto, "char*"); } template void convertFloat(T& n, const String& str, const char* typeto) { bool ok = false; String::const_iterator r = getFloat(str.begin(), str.end(), ok, n, FloatFormat() ); if (ok) _skipws(r, str.end()); if(r != str.end() || ! ok) ConversionError::doThrow(typeto, "String", str.narrow().c_str()); } template void convertFloat(T& n, const std::string& str, const char* typeto) { bool ok = false; std::string::const_iterator r = getFloat(str.begin(), str.end(), ok, n); if (ok) _skipws(r, str.end()); if(r != str.end() || ! ok) ConversionError::doThrow(typeto, "string", str.c_str()); } template void convertFloat(T& n, const char* str, const char* typeto) { bool ok = false; nullterm_array_iterator it(str); nullterm_array_iterator end; it = getFloat( it, end, ok, n ); if (ok) _skipws(it, end); if( it != end || ! ok ) ConversionError::doThrow(typeto, "char*", str); } // // Conversions to cxxtools::String // void convert(String& s, const std::string& value) { s = String::widen(value); } void convert(String& str, bool value) { static const wchar_t* trueValue = L"true"; static const wchar_t* falseValue = L"false"; str = value ? trueValue : falseValue; } void convert(String& str, char value) { str = String(1, Char(value)); } void convert(String& str, wchar_t value) { str = String(1, Char(value)); } void convert(String& str, Char value) { str = String(1, value); } void convert(String& str, unsigned char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, signed char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, unsigned short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, unsigned int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, long value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, unsigned long value) { str.clear(); putInt(std::back_inserter(str), value); } #ifdef HAVE_LONG_LONG void convert(String& str, long long value) { str.clear(); putInt(std::back_inserter(str), value); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(String& str, unsigned long long value) { str.clear(); putInt(std::back_inserter(str), value); } #endif void convert(String& str, float value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(String& str, double value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(String& str, long double value) { str.clear(); putFloat(std::back_inserter(str), value); } // // Conversions from cxxtools::String // void convert(bool& n, const String& str) { if (str == L"true" || str == L"1") n = true; else if (str == L"false" || str == L"0") n = false; else ConversionError::doThrow("bool", "String", str.narrow().c_str()); } void convert(char& c, const String& str) { if ( str.empty() ) ConversionError::doThrow("char", "String"); c = str[0].narrow(); } void convert(wchar_t& c, const String& str) { if ( str.empty() ) ConversionError::doThrow("wchar_t", "String"); c = str[0].toWchar(); } void convert(Char& c, const String& str) { if ( str.empty() ) ConversionError::doThrow("char", "Char"); c = str[0]; } void convert(unsigned char& n, const String& str) { convertInt(n, str, "unsigned char"); } void convert(signed char& n, const String& str) { convertInt(n, str, "signed char"); } void convert(short& n, const String& str) { convertInt(n, str, "short"); } void convert(unsigned short& n, const String& str) { convertInt(n, str, "unsigned short"); } void convert(int& n, const String& str) { convertInt(n, str, "int"); } void convert(unsigned int& n, const String& str) { convertInt(n, str, "unsigned int"); } void convert(long& n, const String& str) { convertInt(n, str, "long"); } void convert(unsigned long& n, const String& str) { convertInt(n, str, "unsigned long"); } #ifdef HAVE_LONG_LONG void convert(long long& n, const String& str) { convertInt(n, str, "long long"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const String& str) { convertInt(n, str, "unsigned long long"); } #endif void convert(float& n, const String& str) { convertFloat(n, str, "float"); } void convert(double& n, const String& str) { convertFloat(n, str, "double"); } void convert(long double& n, const String& str) { convertFloat(n, str, "long double"); } // // Conversions to std::string // void convert(std::string& s, const String& str) { s = str.narrow(); } void convert(std::string& str, bool value) { static const char* trueValue = "true"; static const char* falseValue = "false"; str = value ? trueValue : falseValue; } void convert(std::string& str, char value) { str.clear(); str += value; } void convert(std::string& str, signed char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, long value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned long value) { str.clear(); putInt(std::back_inserter(str), value); } #ifdef HAVE_LONG_LONG void convert(std::string& str, long long value) { str.clear(); putInt(std::back_inserter(str), value); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(std::string& str, unsigned long long value) { str.clear(); putInt(std::back_inserter(str), value); } #endif void convert(std::string& str, float value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(std::string& str, double value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(std::string& str, long double value) { str.clear(); putFloat(std::back_inserter(str), value); } // // Conversions from std::string // void convert(bool& n, const std::string& str) { if (str == "true" || str == "1") n = true; else if (str == "false" || str == "0") n = false; else ConversionError::doThrow("bool", "string", str.c_str()); } void convert(char& c, const std::string& str) { if ( str.empty() ) ConversionError::doThrow("char", "string"); int n = str[0]; c = n; } void convert(signed char& n, const std::string& str) { convertInt(n, str, "signed char"); } void convert(unsigned char& n, const std::string& str) { convertInt(n, str, "unsigned char"); } void convert(short& n, const std::string& str) { convertInt(n, str, "short"); } void convert(unsigned short& n, const std::string& str) { convertInt(n, str, "unsigned short"); } void convert(int& n, const std::string& str) { convertInt(n, str, "int"); } void convert(unsigned int& n, const std::string& str) { convertInt(n, str, "unsigned int"); } void convert(long& n, const std::string& str) { convertInt(n, str, "long"); } void convert(unsigned long& n, const std::string& str) { convertInt(n, str, "unsigned long"); } #ifdef HAVE_LONG_LONG void convert(long long& n, const std::string& str) { convertInt(n, str, "long long"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const std::string& str) { convertInt(n, str, "unsigned long long"); } #endif void convert(float& n, const std::string& str) { convertFloat(n, str, "float"); } void convert(double& n, const std::string& str) { convertFloat(n, str, "double"); } void convert(long double& n, const std::string& str) { convertFloat(n, str, "long double"); } // // Conversions from const char* // void convert(bool& n, const char* str) { if (std::strcmp(str, "true") == 0 || std::strcmp(str, "1") == 0) n = true; else if (std::strcmp(str, "false") || std::strcmp(str, "0")) n = false; else ConversionError::doThrow("bool", "char*", str); } void convert(char& c, const char* str) { if ( *str == '\0' ) ConversionError::doThrow("char", "char*"); c = str[0]; } void convert(signed char& n, const char* str) { convertInt(n, str, "signed char"); } void convert(unsigned char& n, const char* str) { convertInt(n, str, "unsigned char"); } void convert(short& n, const char* str) { convertInt(n, str, "short"); } void convert(unsigned short& n, const char* str) { convertInt(n, str, "unsigned short"); } void convert(int& n, const char* str) { convertInt(n, str, "int"); } void convert(unsigned int& n, const char* str) { convertInt(n, str, "unsigned int"); } void convert(long& n, const char* str) { convertInt(n, str, "long"); } void convert(unsigned long& n, const char* str) { convertInt(n, str, "unsigned long"); } #ifdef HAVE_LONG_LONG void convert(long long& n, const char* str) { convertInt(n, str, "long long"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const char* str) { convertInt(n, str, "unsigned long long"); } #endif void convert(float& n, const char* str) { convertFloat(n, str, "float"); } void convert(double& n, const char* str) { convertFloat(n, str, "double"); } void convert(long double& n, const char* str) { convertFloat(n, str, "long double"); } } cxxtools-3.0/src/directoryimpl.cpp0000664000175000017500000001323213644433072014352 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "directoryimpl.h" #include "cxxtools/systemerror.h" #include #include #include #include #include #include #include #include namespace cxxtools { DirectoryIteratorImpl::DirectoryIteratorImpl() : _refs(1), _handle(0), _current(0), _dirty(true), _skipHidden(true) { } DirectoryIteratorImpl::DirectoryIteratorImpl(const char* path, bool skipHidden) : _refs(1), _path(path), _handle(0), _current(0), _dirty(true), _skipHidden(skipHidden) { _handle = ::opendir( path ); // EACCES Permission denied. // EMFILE Too many file descriptors in use by process. // ENFILE Too many files are currently open in the system. // ENOENT Directory does not exist, or name is an empty string. // ENOMEM Insufficient memory to complete the operation. // ENOTDIR name is not a directory. if( !_handle ) { std::string fn = "opendir(\""; fn += path; fn += "\")"; throw SystemError(fn.c_str()); } // append a trailing slash if not empty, so we can add the // directory entry name easily if( ! _path.empty() && _path[_path.size()-1] != '/') _path += '/'; this->advance(); } DirectoryIteratorImpl::~DirectoryIteratorImpl() { if(_handle) ::closedir(_handle); } const std::string& DirectoryIteratorImpl::name() const { return _name; } const std::string& DirectoryIteratorImpl::path() const { if(_dirty) { // replace substring after last slash with the new file-name or // append the file-name if we have a trailing slash. Ctor makes // sure we have a trailing slash. std::string::size_type idx = _path.rfind('/'); if(idx != std::string::npos && ++idx < _path.size() ) { _path.replace(idx, _path.size(), _current->d_name); } else { _path += _current->d_name; } } return _path; } int DirectoryIteratorImpl::ref() { return ++_refs; } int DirectoryIteratorImpl::deref() { return --_refs; } bool DirectoryIteratorImpl::advance() { _dirty = true; // _current == 0 means end do { _current = ::readdir( _handle ); if(_current) _name = _current->d_name; } while (_skipHidden && _current && _current->d_name[0] == '.'); return _current != 0; } void DirectoryImpl::create(const std::string& path) { if( -1 == ::mkdir(path.c_str(), 0777) ) { throw SystemError("mkdir", "Could not create directory '" + path + "'"); } } bool DirectoryImpl::exists(const std::string& path) { struct stat buff; int err = stat(path.c_str(), &buff); if (err == -1 ) { if (errno == ENOENT || errno == ENOTDIR) { return false; } throw SystemError("stat", "Could not stat file '" + path + "'"); } return true; } void DirectoryImpl::remove(const std::string& path) { if( -1 == ::rmdir(path.c_str()) ) { throw SystemError("rmdir", "Could not remove directory '" + path + "'"); } } void DirectoryImpl::move(const std::string& oldName, const std::string& newName) { if (0 != ::rename(oldName.c_str(), newName.c_str())) { throw SystemError("rename", "Could not move directory '" + oldName + "' to '" + newName + "'"); } } void DirectoryImpl::chdir(const std::string& path) { if( -1 == ::chdir(path.c_str()) ) { throw SystemError("chdir", "Could not change working directory to '" + path + "'"); } } std::string DirectoryImpl::cwd() { std::vector cwd(1024); while ( getcwd(&cwd[0], cwd.size()) == 0 ) { if (errno != ERANGE) throw SystemError("getcwd"); cwd.resize(cwd.size() * 2); } return std::string(&cwd[0]); } std::string DirectoryImpl::curdir() { return "."; } std::string DirectoryImpl::updir() {; return ".."; } std::string DirectoryImpl::rootdir() { return "/"; } std::string DirectoryImpl::tmpdir() { const char* tmpdir = getenv("TEMP"); if(tmpdir) { return tmpdir; } tmpdir = getenv("TMP"); if(tmpdir) { return tmpdir; } return DirectoryImpl::exists("/tmp") ? "/tmp" : curdir(); } std::string DirectoryImpl::sep() { return "/"; } } // namespace cxxtools cxxtools-3.0/src/tz.cpp0000664000175000017500000004776713644433072012145 00000000000000/* * Copyright (C) 2018 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include log_define("cxxtools.tz") namespace cxxtools { class Tz::Impl : public RefCounted { friend class Tz; friend class TzDateTime; typedef std::map > TimeZones; static TimeZones timeZones; static cxxtools::Mutex mutex; struct TzHead { char version; uint32_t ttisgmtcnt; uint32_t ttisstdcnt; uint32_t leapcnt; uint32_t timecnt; uint32_t typecnt; uint32_t charcnt; }; struct TtInfo { int32_t gmtoff; char isdst; int abbreviationIndex; }; struct LeapInfo { time_t transitionTime; int32_t corrections; }; struct Transition { time_t transitionTime; uint8_t ttIndex; }; std::string _name; TzHead head; std::vector transitions; std::vector ttInfos; std::string abbreviations; std::vector leapInfos; template static void get(std::istream& in, IntType& ret) { char ch; ret = 0; for (size_t i = 0; i < sizeof(IntType); ++i) { in.get(ch); ret = ((ret << 8) | static_cast(ch)); } } static void check(std::istream& in) { if (!in) throw TzInvalidTimeZoneFile(); } template void loadData(std::istream& in) { // trasition times log_debug("read transition times"); transitions.resize(head.timecnt); for (unsigned i = 0; i < head.timecnt; ++i) { IntType t; get(in, t); transitions[i].transitionTime = t; } check(in); // indices log_debug("read indices"); for (unsigned i = 0; i < head.timecnt; ++i) transitions[i].ttIndex = in.get(); check(in); for (unsigned i = 0; i < head.timecnt; ++i) { if (transitions[i].ttIndex >= head.typecnt) throw TzInvalidTimeZoneFile(); log_debug("transitions[" << i << "]={transitionTime: \"" << cxxtools::DateTime::fromMSecsSinceEpoch(transitions[i].transitionTime).toString() << "\", ttIndex: " << static_cast(transitions[i].ttIndex) << '}'); } // ttinfo log_debug("read ttinfo"); ttInfos.resize(head.typecnt); for (unsigned i = 0; i < head.typecnt; ++i) { get(in, ttInfos[i].gmtoff); in.get(ttInfos[i].isdst); ttInfos[i].abbreviationIndex = in.get(); } check(in); for (unsigned i = 0; i < head.typecnt; ++i) if (ttInfos[i].abbreviationIndex > static_cast(head.charcnt)) throw TzInvalidTimeZoneFile(); log_debug("read abbreviations"); abbreviations.reserve(head.charcnt); for (unsigned i = 0; i < head.charcnt; ++i) { char ch; in.get(ch); abbreviations.push_back(ch); } check(in); // verify for (unsigned i = 0; i < head.typecnt; ++i) log_debug("ttInfos[" << i << "]={gmtoff: " << ttInfos[i].gmtoff << ", isdst: " << (ttInfos[i].isdst ? '1' : '0') << ", abbreviationIndex: " << ttInfos[i].abbreviationIndex << ", abbreviation: " << (abbreviations.data() + ttInfos[i].abbreviationIndex) << '}'); log_debug("read leapInfos"); leapInfos.resize(head.leapcnt); for (unsigned i = 0; i < head.leapcnt; ++i) { get(in, leapInfos[i].transitionTime); get(in, leapInfos[i].corrections); } for (unsigned i = 0; i < leapInfos.size(); ++i) log_debug("leapInfos[" << i << "]={transitionTime: " << leapInfos[i].transitionTime << ", corrections: " << leapInfos[i].corrections << '}'); log_debug("head finished"); } const char* abbreviation(int index) const { return abbreviations.data() + index; } public: explicit Impl(std::istream& in, const std::string& name); const std::string& name() const { return _name; } void dump(std::ostream& out) const; }; Tz::Impl::Impl(std::istream& in, const std::string& name) : _name(name) { log_debug("read magic"); char magic[4]; in.read(magic, 4); log_debug("magic=" << std::string(magic, 4)); check(in); if (memcmp(magic, "TZif", 4) != 0) throw TzInvalidTimeZoneFile("invalid timezone file: bad magic"); in.get(head.version); log_debug_if(head.version, "version: " << head.version); log_debug_if(!head.version, "no version"); in.ignore(15); get(in, head.ttisgmtcnt); get(in, head.ttisstdcnt); get(in, head.leapcnt); get(in, head.timecnt); get(in, head.typecnt); get(in, head.charcnt); log_debug("counters read"); check(in); log_debug("ttisgmtcnt: " << head.ttisgmtcnt << "\t" "ttisstdcnt: " << head.ttisstdcnt << "\t" "leapcnt: " << head.leapcnt << "\t" "timecnt: " << head.timecnt << "\t" "typecnt: " << head.typecnt << "\t" "charcnt: " << head.charcnt); if (head.version == 0) { log_debug("loadData 32"); loadData(in); } else { in.ignore((4+1)*head.timecnt + 6*head.typecnt + head.charcnt + 8*head.leapcnt + head.ttisstdcnt + head.ttisgmtcnt + (4+1+15)); get(in, head.ttisgmtcnt); get(in, head.ttisstdcnt); get(in, head.leapcnt); get(in, head.timecnt); get(in, head.typecnt); get(in, head.charcnt); check(in); log_debug("counters read 2"); log_debug("ttisgmtcnt: " << head.ttisgmtcnt << "\t" "ttisstdcnt: " << head.ttisstdcnt << "\t" "leapcnt: " << head.leapcnt << "\t" "timecnt: " << head.timecnt << "\t" "typecnt: " << head.typecnt << "\t" "charcnt: " << head.charcnt); log_debug("loadData 64"); loadData(in); } } void Tz::Impl::dump(std::ostream& out) const { for (unsigned i = 0; i < head.timecnt; ++i) { const TtInfo& ttinfo = ttInfos[transitions[i].ttIndex]; out << i << ' ' << cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(transitions[i].transitionTime)).toString() << " UTC =\t" << cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(transitions[i].transitionTime + ttinfo.gmtoff)).toString() << " " << abbreviation(ttinfo.abbreviationIndex) << "\tisdst=" << (ttinfo.isdst ? '1' : '0') << " gmtoff=" << ttinfo.gmtoff << '\n'; } for (unsigned i = 0; i < leapInfos.size(); ++i) { out << cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(leapInfos[i].transitionTime)).toString() << " leap corrections: " << leapInfos[i].corrections << '\n'; } } //////////////////////////////////////////////////////////////////////// // class Tz // static const char* tzDir() { static const char* tz_dir = "/usr/share/zoneinfo"; const char* TZDIR = ::getenv("TZDIR"); return TZDIR ? TZDIR : tz_dir; } Tz::Impl::TimeZones Tz::Impl::timeZones; cxxtools::Mutex Tz::Impl::mutex; Tz::Tz(const std::string& timeZone) : _impl(0) { cxxtools::MutexLock lock(Impl::mutex); std::string timeZone2 = timeZone; if (timeZone2.empty()) timeZone2 = currentZone(); auto it = Impl::timeZones.find(timeZone2); if (it != Impl::timeZones.end()) { log_debug("take cached"); _impl = it->second.getPointer(); } else { std::string fname = tzDir(); fname += '/'; fname += timeZone2; std::ifstream in(fname); if (!in) throw TzInvalidTimeZoneFile("failed to open timezone file \"" + fname + '"'); cxxtools::SmartPtr impl(new Impl(in, timeZone2)); _impl = impl.getPointer(); Impl::timeZones.insert( Impl::TimeZones::value_type(timeZone2, std::move(impl))); } } void Tz::dump(std::ostream& out) const { _impl->dump(out); } const std::string& Tz::name() const { return _impl->name(); } TzDateTime Tz::toLocal(const UtcDateTime& dt) const { time_t t = static_cast(dt.msecsSinceEpoch().totalSeconds()); uint8_t ttIndex = 0; for (unsigned i = 0; i < _impl->transitions.size(); ++i) { if (_impl->transitions[i].transitionTime > t) break; ttIndex = _impl->transitions[i].ttIndex; } const auto& tt = _impl->ttInfos[ttIndex]; std::string tzName = _impl->abbreviations.data() + tt.abbreviationIndex; cxxtools::Timespan gmtoff = cxxtools::Seconds(tt.gmtoff); bool isdst = tt.isdst; uint32_t leapSeconds = 0; for (unsigned i = 0; i < _impl->leapInfos.size(); ++i) { if (_impl->leapInfos[i].transitionTime > t) break; leapSeconds = _impl->leapInfos[i].corrections; } return TzDateTime(dt + gmtoff, tzName, gmtoff, isdst, leapSeconds); } static std::string timeT2s(time_t t) { return cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(t)).toString(); } UtcDateTime Tz::toUtc(const LocalDateTime& dt) const { log_debug("toUtc(" << dt.toString() << ')'); if (_impl->transitions.empty()) return UtcDateTime(dt); time_t t = static_cast(dt.msecsSinceEpoch().totalSeconds()); unsigned i; for (i = 0; i < _impl->transitions.size() - 1; ++i) { const auto& tt = _impl->ttInfos[_impl->transitions[i].ttIndex]; if (_impl->transitions[i + 1].transitionTime > t - tt.gmtoff) { // This is the first transition range, which is still valid. log_debug(i << " transitionTime: " << timeT2s(_impl->transitions[i + 1].transitionTime) << ' ' << (tt.isdst ? "dst" : "nodst")); if (_impl->transitions[i].transitionTime > t - tt.gmtoff) throw TzInvalidLocalTime(dt); const auto& tt2 = _impl->ttInfos[_impl->transitions[i + 1].ttIndex]; // Check whether the next range is already valid log_debug(timeT2s(_impl->transitions[i + 1].transitionTime) << ", " << timeT2s(t) << ", " << tt2.gmtoff << ", " << timeT2s(t - tt2.gmtoff)); if (_impl->transitions[i + 1].transitionTime <= t - tt2.gmtoff) { log_debug("next transition is also valid; gmtoff=" << tt2.gmtoff); throw TzAmbiguousLocalTime(dt); } log_debug("next transition is not valid; gmtoff=" << tt.gmtoff); return UtcDateTime(dt - cxxtools::Seconds(tt.gmtoff)); } } const auto& tt = _impl->ttInfos[_impl->transitions[i].ttIndex]; return UtcDateTime(dt - cxxtools::Seconds(tt.gmtoff)); } UtcDateTime Tz::toUtc(const LocalDateTime& dt, bool early) const { log_debug("toUtc(" << dt.toString() << ", " << early << ')'); if (_impl->transitions.empty()) return UtcDateTime(dt); time_t t = static_cast(dt.msecsSinceEpoch().totalSeconds()); unsigned i; for (i = 0; i < _impl->transitions.size() - 1; ++i) { const auto& tt = _impl->ttInfos[_impl->transitions[i].ttIndex]; if (_impl->transitions[i + 1].transitionTime > t - tt.gmtoff) { // This is the first transition range, which is still valid. log_debug(i << " transitionTime: " << timeT2s(_impl->transitions[i + 1].transitionTime) << ' ' << (tt.isdst ? "dst" : "nodst")); if (_impl->transitions[i].transitionTime > t - tt.gmtoff) throw TzInvalidLocalTime(dt); if (early) { log_debug("take earliest; gmtoff=" << tt.gmtoff); return UtcDateTime(dt - cxxtools::Seconds(tt.gmtoff)); } const auto& tt2 = _impl->ttInfos[_impl->transitions[i + 1].ttIndex]; // Check whether the next range is already valid log_debug(timeT2s(_impl->transitions[i + 1].transitionTime) << ", " << timeT2s(t) << ", " << tt2.gmtoff << ", " << timeT2s(t - tt2.gmtoff)); if (_impl->transitions[i + 1].transitionTime <= t - tt2.gmtoff) { log_debug("next transition is also valid; gmtoff=" << tt2.gmtoff); return UtcDateTime(dt - cxxtools::Seconds(tt2.gmtoff)); } else { log_debug("next transition is not valid; gmtoff=" << tt.gmtoff); return UtcDateTime(dt - cxxtools::Seconds(tt.gmtoff)); } } } const auto& tt = _impl->ttInfos[_impl->transitions[i].ttIndex]; return UtcDateTime(dt - cxxtools::Seconds(tt.gmtoff)); } UtcDateTime Tz::previousChange(const cxxtools::DateTime& dt, bool local) const { log_debug("previousChange(" << dt.toString() << ')'); if (!_impl->transitions.empty()) { time_t t = static_cast(dt.msecsSinceEpoch().totalSeconds()); for (unsigned i = 0; i < _impl->transitions.size() - 1; ++i) { if (_impl->transitions[i + 1].transitionTime > t) { int32_t gmtoff = local ? _impl->ttInfos[_impl->transitions[i].ttIndex].gmtoff : 0; return UtcDateTime(cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(_impl->transitions[i].transitionTime + gmtoff))); } } } return UtcDateTime(0, 1, 1, 0, 0, 0); } UtcDateTime Tz::nextChange(const cxxtools::DateTime& dt, bool local) const { log_debug("nextChange(" << dt.toString() << ')'); if (!_impl->transitions.empty()) { time_t t = static_cast(dt.msecsSinceEpoch().totalSeconds()); for (unsigned i = 0; i < _impl->transitions.size() - 1; ++i) { if (_impl->transitions[i + 1].transitionTime > t) { int32_t gmtoff = local ? _impl->ttInfos[_impl->transitions[i].ttIndex].gmtoff : 0; return UtcDateTime(cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(_impl->transitions[i + 1].transitionTime + gmtoff))); } } } return UtcDateTime(9999, 12, 31, 23, 59, 59, 999, 999); } cxxtools::Timespan Tz::offset(const UtcDateTime& gmtDt) const { time_t t = static_cast(gmtDt.msecsSinceEpoch().totalSeconds()); uint8_t ttIndex = 0; for (unsigned i = 0; i < _impl->transitions.size(); ++i) { if (_impl->transitions[i].transitionTime > t) break; ttIndex = _impl->transitions[i].ttIndex; } const auto& tt = _impl->ttInfos[ttIndex]; return cxxtools::Seconds(tt.gmtoff); } std::string Tz::currentZone() { const char* TZ = ::getenv("TZ"); if (TZ) return TZ; // copied from Howad Hinnant: https://github.com/HowardHinnant/date/blob/master/tz.cpp // On some OS's a file called /etc/localtime may // exist and it may be either a real file // containing time zone details or a symlink to such a file. // On MacOS and BSD Unix if this file is a symlink it // might resolve to a path like this: // "/usr/share/zoneinfo/America/Los_Angeles" // If it does, we try to determine the current // timezone from the remainder of the path by removing the prefix // and hoping the rest resolves to valid timezone. // It may not always work though. If it doesn't then an // exception will be thrown by local_timezone. // The path may also take a relative form: // "../usr/share/zoneinfo/America/Los_Angeles". struct stat sb; static const char timezone[] = "/etc/localtime"; if (lstat(timezone, &sb) == 0 && S_ISLNK(sb.st_mode) && sb.st_size > 0) { using namespace std; string result; char rp[PATH_MAX]; if (realpath(timezone, rp)) result = string(rp); else throw SystemError("realpath"); const size_t pos = result.find(tzDir()); if (pos != result.npos) result.erase(0, strlen(tzDir())+1+pos); return result; } { // On some versions of some linux distro's (e.g. Ubuntu), // the current timezone might be in the first line of // the /etc/timezone file. std::ifstream timezone_file("/etc/timezone"); if (timezone_file.is_open()) { std::string result; std::getline(timezone_file, result); if (!result.empty()) return result; } // Fall through to try other means. } { // On some versions of some linux distro's (e.g. Red Hat), // the current timezone might be in the first line of // the /etc/sysconfig/clock file as: // ZONE="US/Eastern" std::ifstream timezone_file("/etc/sysconfig/clock"); std::string result; while (timezone_file) { std::getline(timezone_file, result); auto p = result.find("ZONE=\""); if (p != std::string::npos) { result.erase(p, p+6); result.erase(result.rfind('"')); return result; } } // Fall through to try other means. } throw std::runtime_error("Could not get current timezone"); } static void addTimezones(std::vector& result, const std::string& basepath) { cxxtools::Directory dir(basepath); static unsigned tzDirLen = strlen(tzDir()); for (auto d = dir.begin(); d != dir.end(); ++d) { cxxtools::FileInfo fi(d.path()); if (*d == "." || *d == ".." || *d == "right" || *d == "posix") { log_debug("skip " << d.path()); } else if (fi.isDirectory()) { log_debug("recurse into directory " << d.path()); addTimezones(result, d.path()); } else { try { auto name = d.path().substr(tzDirLen + 1); log_debug("candidate \"" << name << '"'); Tz tz(name); log_debug("found timezone \"" << name << '"'); result.emplace_back(name); } catch (const TzInvalidTimeZoneFile&) { log_debug("no time zone file"); } } } } const std::vector& Tz::getTimeZones() { static std::vector ret; static cxxtools::Mutex mutex; cxxtools::MutexLock lock(mutex); if (ret.empty()) { addTimezones(ret, tzDir()); std::sort(ret.begin(), ret.end()); } return ret; } } cxxtools-3.0/src/fileinfoimpl.h0000664000175000017500000000517213644433072013612 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/fileinfo.h" #include #include #include #include #include namespace cxxtools { class FileInfoImpl { public: static FileInfo::Type getType(const std::string& path) { struct stat st; if( 0 != ::lstat(path.c_str(), &st) ) { return FileInfo::Invalid; } if( S_ISDIR(st.st_mode) ) { return FileInfo::Directory; } else if( S_ISCHR(st.st_mode) ) { return FileInfo::Chardev; } else if( S_ISBLK(st.st_mode) ) { return FileInfo::Blockdev; } else if( S_ISFIFO(st.st_mode) ) { return FileInfo::Fifo; } else if( S_ISLNK(st.st_mode) ) { return FileInfo::Symlink; } else if( S_ISSOCK(st.st_mode) ) { return FileInfo::Socket; } return FileInfo::File; } }; } // namespace cxxtools cxxtools-3.0/src/utf8codec.cpp0000664000175000017500000002641413657752560013370 00000000000000/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/utf8codec.h" #include #define byteMask 0xBF #define byteMark 0x80 namespace cxxtools { const Char ReplacementChar = Char(0x0000FFFD); const Char MaxBmp = Char(0x0000FFFF); const Char MaxUtf16 = Char(0x0010FFFF); const Char MaxUtf32 = Char(0x7FFFFFFF); const Char MaxLegalUtf32 = Char(0x0010FFFF); const Char SurHighStart = Char(0xD800); const Char SurHighEnd = Char(0xDBFF); const Char SurLowStart = Char(0xDC00); const Char SurLowEnd = Char(0xDFFF); const Char ByteOrderMark = Char(0xFEFF); const Char ByteOrderSwapped = Char(0xFFFE); /* * Index into the table below with the first byte of a UTF-8 sequence to * get the number of trailing bytes that are supposed to follow it. * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is * left as-is for anyone who may want to do such conversion, which was * allowed in earlier algorithms. */ const char trailingBytesForUTF8[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* * Magic values subtracted from a buffer value during UTF8 conversion. * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ const Char::value_type offsetsFromUTF8[6] = { Char::value_type(0x00000000), Char::value_type(0x00003080), Char::value_type(0x000E2080), Char::value_type(0x03C82080), Char::value_type(0xFA082080), Char::value_type(0x82082080) }; /* * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed * into the first byte, depending on how many bytes follow. There are * as many entries in this table as there are UTF-8 sequence types. * (I.e., one byte sequence, two byte... etc.). Remember that sequencs * for *legal* UTF-8 will be 4 or fewer bytes total. */ const uint8_t firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; /** * @brief Checks if the given character sequence is a valid UTF-8 character. * * The given array 8-bit-values is "parsed" and tried to be converted into a * Unicode-character using UTF-decoding. If this is not possible $false$ is returned * as the 8-bit-sequence is not a valid UTF-8 character. Otherwise $true$ is * returned. Only the first number of characters as specified in 'length' is * tried to converted. * * @param source An array of 8-bit values containing raw UTF-8 character data. * @param length Number of characters of source which are checked if they are * a valid UTF-8 character. * @return $true$ if the given sequence is a UTF-8-encoded character, $false$ * otherwise. */ inline bool isLegalUTF8(const uint8_t *source, int length) { uint8_t a; const uint8_t *srcptr = source + length; switch (length) { default: return false; // Everything else falls through when "true"... case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 2: if ((a = (*--srcptr)) > 0xBF) return false; switch (*source) { // no fall-through in this inner switch case 0xE0: if (a < 0xA0) return false; break; case 0xED: if (a > 0x9F) return false; break; case 0xF0: if (a < 0x90) return false; break; case 0xF4: if (a > 0x8F) return false; break; default: if (a < 0x80) return false; } case 1: if (*source >= 0x80 && *source < 0xC2) return false; } if (*source > 0xF4) return false; return true; } Utf8Codec::Utf8Codec(size_t ref) : TextCodec(ref) {} namespace { inline unsigned short numBytes(const MBState& s, const char* fromBegin, const char* fromEnd) { return fromEnd - fromBegin + s.n; } inline char getByte(const MBState& s, const char* fromBegin, const char* fromEnd, unsigned short n) { if (n < s.n) return s.value.mbytes[n]; else return fromBegin[n - s.n]; } } Utf8Codec::result Utf8Codec::do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, Char* toBegin, Char* toEnd, Char*& toNext) const { fromNext = fromBegin; toNext = toBegin; // check for empty input if (fromEnd == fromBegin) return ok; // check for incomplete byte order mark: if (numBytes(s, fromBegin, fromEnd) < 3) { if (getByte(s, fromBegin, fromEnd, 0) == '\xef') { while (fromNext < fromEnd) s.value.mbytes[s.n++] = *fromNext++; return ok; } } else { // skip byte order mark if (getByte(s, fromBegin, fromEnd, 0) == '\xef' && getByte(s, fromBegin, fromEnd, 1) == '\xbb' && getByte(s, fromBegin, fromEnd, 2) == '\xbf') { if (s.n <= 3) { fromNext += 3 - s.n; s.n = 0; } else { std::memmove(s.value.mbytes, s.value.mbytes + 3, s.n - 3); s.n -= 3; } } } Utf8Codec::result retstat = ok; while (fromNext < fromEnd) { if (toNext >= toEnd) { retstat = partial; break; } if (s.n < sizeof(s.value.mbytes)) { s.value.mbytes[s.n++] = *fromNext++; } uint8_t* fnext = reinterpret_cast(&s.value.mbytes[0]); uint8_t* fend = fnext + s.n; const size_t extraBytesToRead = trailingBytesForUTF8[*fnext]; if (fnext + extraBytesToRead >= fend) { retstat = partial; continue; } if( !isLegalUTF8( fnext, extraBytesToRead + 1 ) ) { retstat = error; break; } *toNext = Char(0); switch (extraBytesToRead) { case 5: *toNext = Char((toNext->value() + *fnext++) << 6); // We should never get this for legal UTF-8 case 4: *toNext = Char((toNext->value() + *fnext++) << 6); // We should never get this for legal UTF-8 case 3: *toNext = Char((toNext->value() + *fnext++) << 6); case 2: *toNext = Char((toNext->value() + *fnext++) << 6); case 1: *toNext = Char((toNext->value() + *fnext++) << 6); case 0: *toNext = Char((toNext->value() + *fnext++)); } *toNext = Char(toNext->value() - offsetsFromUTF8[extraBytesToRead]); // UTF-16 surrogate values are illegal in UTF-32, and anything // over Plane 17 (> 0x10FFFF) is illegal. if (*toNext > MaxLegalUtf32) { *toNext = ReplacementChar; } else if(*toNext >= SurHighStart && *toNext <= SurLowEnd) { *toNext = ReplacementChar; } s.n = 0; ++toNext; retstat = ok; } return retstat; } Utf8Codec::result Utf8Codec::do_out(MBState& /*s*/, const Char* fromBegin, const Char* fromEnd, const Char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { result retstat = ok; fromNext = fromBegin; toNext = toBegin; Char ch; size_t bytesToWrite; while(fromNext < fromEnd) { ch = *fromNext; if (ch >= SurHighStart && ch <= SurLowEnd) { retstat = error; break; } // Figure out how many bytes the result will require. Turn any // illegally large UTF32 things (> Plane 17) into replacement chars. if (ch < Char(0x80)) { bytesToWrite = 1; } else if (ch < Char(0x800)) { bytesToWrite = 2; } else if (ch < Char(0x10000)) { bytesToWrite = 3; } else if (ch <= MaxLegalUtf32) { bytesToWrite = 4; } else { bytesToWrite = 3; ch = ReplacementChar; } uint8_t* current = (uint8_t*)(toNext + bytesToWrite); if( current >= (uint8_t*)(toEnd) ) { retstat = partial; break; } Char::value_type chValue = ch.value(); switch(bytesToWrite) { // note: everything falls through... case 4: *--current = static_cast((chValue | byteMark) & byteMask); chValue >>= 6; case 3: *--current = static_cast((chValue | byteMark) & byteMask); chValue >>= 6; case 2: *--current = static_cast((chValue | byteMark) & byteMask); chValue >>= 6; case 1: *--current = static_cast (chValue | firstByteMark[bytesToWrite]); } toNext += bytesToWrite; ++fromNext; } return retstat; } int Utf8Codec::do_length(MBState& /*s*/, const char* fromBegin, const char* fromEnd, size_t max) const { const char* fromNext = fromBegin; size_t counter = 0; while(fromNext < fromEnd && counter <= max) { int extraBytesToRead = trailingBytesForUTF8[ (unsigned char)*fromNext ]; // NOTE: check again... if(fromNext + extraBytesToRead >= fromEnd) { break; } if(!isLegalUTF8( (const uint8_t*) fromNext, extraBytesToRead + 1 ) ) { break; } fromNext += extraBytesToRead + 1; counter += extraBytesToRead + 1; } return fromNext - fromBegin; } int Utf8Codec::do_max_length() const throw() { return 4; } bool Utf8Codec::do_always_noconv() const throw() { return false; } } // namespace cxxtools cxxtools-3.0/src/selectorimpl.cpp0000664000175000017500000001703113644433072014167 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "selectorimpl.h" #include "selectableimpl.h" #include "cxxtools/ioerror.h" #include "cxxtools/systemerror.h" #include "cxxtools/selector.h" #include "cxxtools/log.h" #include #include #include #include #include #include #include "config.h" #include "poll.h" log_define("cxxtools.selector.impl") namespace cxxtools { const short SelectorImpl::POLL_ERROR_MASK= POLLERR | POLLHUP | POLLNVAL; SelectorImpl::SelectorImpl() : _isDirty(true) { _current = _devices.end(); //Open a pipe to send wake up message. if( ::pipe( _wakePipe ) ) throwSystemError("pipe"); int flags = ::fcntl(_wakePipe[0], F_GETFL); if(-1 == flags) throwSystemError("fcntl"); int ret = ::fcntl(_wakePipe[0], F_SETFL, flags|O_NONBLOCK); if(-1 == ret) throwSystemError("fcntl"); flags = ::fcntl(_wakePipe[1], F_GETFL); if(-1 == flags) throwSystemError("fcntl"); ret = ::fcntl(_wakePipe[1], F_SETFL, flags|O_NONBLOCK); if(-1 == ret) throwSystemError("fcntl"); } SelectorImpl::~SelectorImpl() { std::set::iterator it; while( _devices.size() ) { it = _devices.begin(); (*it)->setSelector(0); } if( _wakePipe[0] != -1 && _wakePipe[1] != -1 ) { ::close(_wakePipe[0]); ::close(_wakePipe[1]); } } void SelectorImpl::add(Selectable& dev) { _devices.insert(&dev); _isDirty = true; } void SelectorImpl::remove(Selectable& dev) { std::set::iterator it = _devices.find( &dev ); if( it == _devices.end() ) return; if (_current == _devices.end()) { _devices.erase(it); } else if (*_current == *it) { _devices.erase(_current++); } else { _devices.erase(it); } _isDirty = true; } void SelectorImpl::changed( Selectable& s ) { if( s.avail() ) { _avail.insert(&s); } else { _avail.erase(&s); } } bool SelectorImpl::waitUntil(Timespan until) { if (!_avail.empty()) until = Timespan(0); if (_isDirty) { _pollfds.clear(); // recalculate size size_t pollSize= 1; std::set::iterator iter; for( iter= _devices.begin(); iter != _devices.end(); ++iter) { if( (*iter)->enabled() ) pollSize+= (*iter)->simpl().pollSize(); } pollfd pfd; pfd.fd = -1; pfd.events = 0; pfd.revents = 0; _pollfds.assign(pollSize, pfd); // add entries pollfd* pCurr= &_pollfds[0]; // insert event pipe pCurr->fd = _wakePipe[0]; pCurr->events = POLLIN; ++pCurr; for( iter= _devices.begin(); iter != _devices.end(); ++iter) { if( (*iter)->enabled() ) { const size_t availableSpace= &_pollfds.back() - pCurr + 1; size_t required = (*iter)->simpl().pollSize(); assert( required <= availableSpace); pCurr+= (*iter)->simpl().initializePoll( pCurr, required); } } _isDirty= false; } #ifdef HAVE_PPOLL struct timespec pollTimeout = { 0, 0 }; struct timespec* pollTimeoutP = 0; if (until >= Timespan(0)) pollTimeoutP = &pollTimeout; #else int pollTimeout = until == Timespan(0) ? 0 : -1; #endif int ret = -1; while (true) { if (until > Timespan(0)) { Timespan remaining = until - Timespan::gettimeofday(); if (remaining < Timespan(0)) remaining = Timespan(0); #ifdef HAVE_PPOLL pollTimeout.tv_sec = remaining.totalUSecs() / 1000000; pollTimeout.tv_nsec = (remaining.totalUSecs() % 1000000) * 1000; #else if (Milliseconds(remaining) >= std::numeric_limits::max()) pollTimeout = std::numeric_limits::max(); else pollTimeout = Milliseconds(remaining).ceil(); #endif log_debug("remaining " << remaining); } else log_debug("no timeout"); #ifdef HAVE_PPOLL log_debug("ppoll with " << _pollfds.size() << " fds, timeout=" << pollTimeout.tv_sec << "s " << pollTimeout.tv_nsec << "ns"); ret = ::ppoll(&_pollfds[0], _pollfds.size(), pollTimeoutP, 0); log_debug("ppoll returns " << ret); #else log_debug("poll with " << _pollfds.size() << " fds, timeout=" << pollTimeout << "ms"); ret = ::poll(&_pollfds[0], _pollfds.size(), pollTimeout); log_debug("poll returns " << ret); #endif if( ret != -1 ) break; if( errno != EINTR ) throw IOError("Could not poll on file descriptors"); } if( ret == 0 && _avail.empty() ) return false; bool avail = false; try { if (_pollfds[0].revents != 0) { if ( _pollfds[0].revents & POLL_ERROR_MASK) { throw IOError("poll error on event pipe"); } static char buffer[1024]; while(true) { int ret = ::read(_wakePipe[0], buffer, sizeof(buffer)); if(ret > 0) { avail = true; continue; } if (ret == -1) { if(errno == EINTR) continue; if(errno == EAGAIN) break; } throw IOError("Could not read from pipe"); } } for( _current = _devices.begin(); _current != _devices.end(); ) { Selectable* dev = *_current; if ( dev->enabled() && dev->simpl().checkPollEvent() ) { avail = true; } if (_current != _devices.end()) { if (*_current == dev) { ++_current; } } } } catch (...) { _current = _devices.end(); throw; } return avail; } void SelectorImpl::wake() { ::write( _wakePipe[1], "W", 1); } } //namespace cxxtools cxxtools-3.0/src/signal.cpp0000664000175000017500000002221013644433072012735 00000000000000/* * Copyright (C) 2005 by Dr. Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/signal.h" namespace cxxtools { SignalBase::Sentry::Sentry(const SignalBase* signal) : _signal(signal) { _signal->_sentry = this; _signal->_sending = true; _signal->_dirty = false; } SignalBase::Sentry::~Sentry() { if( _signal ) this->detach(); } void SignalBase::Sentry::detach() { _signal->_sending = false; if( _signal->_dirty == false ) { _signal->_sentry = 0; _signal = 0; return; } std::list::iterator it = _signal->_connections.begin(); while( it != _signal->_connections.end() ) { if( it->valid() ) { ++it; } else { it = _signal->_connections.erase(it); } } _signal->_dirty = false; _signal->_sentry = 0; _signal = 0; } SignalBase::SignalBase() : _sentry(0) , _sending(false) , _dirty(false) { } SignalBase::~SignalBase() { if(_sentry) { _sentry->detach(); } } SignalBase& SignalBase::operator=(const SignalBase& other) { this->clear(); std::list::const_iterator it = other.connections().begin(); std::list::const_iterator end = other.connections().end(); for( ; it != end; ++it) { const Connectable& signal = it->sender(); if( &signal == &other) { const Slot& slot = it->slot(); Connection connection( *this, slot.clone() ); } } return *this; } void SignalBase::onConnectionOpen(const Connection& c) { Connectable::onConnectionOpen(c); } void SignalBase::onConnectionClose(const Connection& c) { // if the signal is currently calling its slots, do not // remove the connection now, but only set the cleanup flag // Any invalid connection objects will be removed after // the signal has finished calling its slots by the Sentry. if( _sending ) { _dirty = true; } else { Connectable::onConnectionClose(c); } } void SignalBase::disconnectSlot(const Slot& slot) { std::list::iterator it = Connectable::connections().begin(); std::list::iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( it->slot().equals(slot) ) { it->close(); return; } } } bool CompareEventTypeInfo::operator()(const std::type_info* t1, const std::type_info* t2) const { if(t2 == 0) return false; if(t1 == 0) return true; return t1->before(*t2) != 0; } Signal::Sentry::Sentry(const Signal* signal) : _signal(signal) { _signal->_sentry = this; _signal->_sending = true; _signal->_dirty = false; } Signal::Sentry::~Sentry() { if( _signal ) this->detach(); } void Signal::Sentry::detach() { _signal->_sending = false; if( _signal->_dirty == false ) { _signal->_sentry = 0; _signal = 0; return; } Signal::RouteMap::iterator it = _signal->_routes.begin(); while( it != _signal->_routes.end() ) { if( it->second->valid() ) { ++it; } else { delete it->second; _signal->_routes.erase(it++); } } _signal->_dirty = false; _signal->_sentry = 0; _signal = 0; } Signal::Signal() : _sentry(0) , _sending(false) , _dirty(false) {} Signal::~Signal() { if(_sentry) _sentry->detach(); while( ! _routes.empty() ) { IEventRoute* route = _routes.begin()->second; route->connection().close(); } } void Signal::send(const cxxtools::Event& ev) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. Signal::Sentry sentry(this); RouteMap::iterator it = _routes.begin(); while( true ) { if( it == _routes.end() ) return; if(it->first != 0) break; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot IEventRoute* route = it->second; if( route->valid() ) route->route(ev); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; ++it; } const std::type_info& ti = ev.typeInfo(); it = _routes.lower_bound( &ti ); while(it != _routes.end() && *(it->first) == ti) { IEventRoute* route = it->second; if(route) route->route(ev); ++it; // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } void Signal::onConnectionOpen(const Connection& c) { const Connectable& sender = c.sender(); if(&sender != this) { return Connectable::onConnectionOpen(c); } } void Signal::onConnectionClose(const Connection& c) { // if the signal is currently calling its slots, do not // remove the connection now, but only set the cleanup flag // Any invalid connection objects will be removed after // the signal has finished calling its slots by the Sentry. if( _sending ) { _dirty = true; } else { RouteMap::iterator it; for(it = _routes.begin(); it != _routes.end(); ++it ) { IEventRoute* route = it->second; if(route->connection() == c ) { delete route; _routes.erase(it++); return; } } Connectable::onConnectionClose(c); } } void Signal::addRoute(const std::type_info* ti, IEventRoute* route) { RouteMap::value_type elem(ti, route); _routes.insert( elem ); } void Signal::removeRoute(const Slot& slot) { RouteMap::iterator it = _routes.begin(); while( it != _routes.end() && it->first == 0 ) { IEventRoute* route = it->second; if(route->connection().slot().equals(slot) ) { route->connection().close(); break; } } } void Signal::removeRoute(const std::type_info* ti, const Slot& slot) { RouteMap::iterator it = _routes.lower_bound( ti ); while(it != _routes.end() && *(it->first) == *ti) { IEventRoute* route = it->second; if(route->connection().slot().equals(slot) ) { route->connection().close(); break; } } } } cxxtools-3.0/src/jsonformatter.cpp0000664000175000017500000003017113644433072014362 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include log_define("cxxtools.json.formatter") namespace cxxtools { namespace { bool isplain(const std::string& str) { if (str.empty()) return false; if (!std::isalpha(str[0])) return false; for (std::string::size_type n = 1; n < str.size(); ++n) if (!std::isalnum(str[n])) return false; return true; } } void JsonFormatter::begin(std::ostream& out) { _os = &out; _level = 0; _lastLevel = std::numeric_limits::max(); } void JsonFormatter::finish() { log_trace("finish"); if (_beautify) *_os << '\n'; _level = 0; _lastLevel = std::numeric_limits::max(); } void JsonFormatter::addValueString(const std::string& name, const std::string& type, const String& value) { log_trace("addValueString name=\"" << name << "\", type=\"" << type << "\", value=\"" << value << '"'); if (type == "bool") { addValueBool(name, type, convert(value)); } else { beginValue(name); if (type == "bool" || type == "int" || type == "long" || type == "float" || type == "double" || type == "microseconds" || type == "milliseconds" || type == "seconds" || type == "minutes" || type == "hours" || type == "days" || type == "decimal") { stringOut(value); } else if (type == "json") { *_os << value; } else if (type == "null") { *_os << "null"; } else { *_os << '"'; stringOut(value); *_os << '"'; } finishValue(); } } void JsonFormatter::addValueStdString(const std::string& name, const std::string& type, const std::string& value) { log_trace("addValueStdString name=\"" << name << "\", type=\"" << type << "\", \" value=\"" << value << '"'); if (type == "bool") { addValueBool(name, type, convert(value)); } else { beginValue(name); if (type == "bool" || type == "int" || type == "long" || type == "float" || type == "double" || type == "microseconds" || type == "milliseconds" || type == "seconds" || type == "minutes" || type == "hours" || type == "days" || type == "decimal") { stringOut(value); } else if (type == "json") { *_os << value; } else if (type == "null") { *_os << "null"; } else { *_os << '"'; stringOut(value); *_os << '"'; } finishValue(); } } void JsonFormatter::addValueBool(const std::string& name, const std::string& type, bool value) { log_trace("addValueBool name=\"" << name << "\", type=\"" << type << "\", \" value=\"" << value << '"'); beginValue(name); *_os << (value ? "true" : "false"); finishValue(); } void JsonFormatter::addValueInt(const std::string& name, const std::string& type, int_type value) { log_trace("addValueInt name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (type == "bool") *_os << (value ? "true" : "false"); else putInt(std::ostreambuf_iterator(*_os), value); finishValue(); } void JsonFormatter::addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value) { log_trace("addValueUnsigned name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (type == "bool") *_os << (value ? "true" : "false"); else putInt(std::ostreambuf_iterator(*_os), value); finishValue(); } void JsonFormatter::addValueFloat(const std::string& name, const std::string& type, float value) { log_trace("addValueFloat name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (value != value // check for nan || value == std::numeric_limits::infinity() || value == -std::numeric_limits::infinity()) { *_os << "null"; } else { putFloat(std::ostreambuf_iterator(*_os), value); } finishValue(); } void JsonFormatter::addValueDouble(const std::string& name, const std::string& type, double value) { log_trace("addValueDouble name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (value != value // check for nan || value == std::numeric_limits::infinity() || value == -std::numeric_limits::infinity()) { *_os << "null"; } else { putFloat(std::ostreambuf_iterator(*_os), value); } finishValue(); } void JsonFormatter::addValueLongDouble(const std::string& name, const std::string& type, long double value) { log_trace("addValueLongDouble name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (value != value // check for nan || value == std::numeric_limits::infinity() || value == -std::numeric_limits::infinity()) { *_os << "null"; } else { putFloat(std::ostreambuf_iterator(*_os), value); } finishValue(); } void JsonFormatter::addNull(const std::string& name, const std::string& /*type*/) { beginValue(name); *_os << "null"; finishValue(); } void JsonFormatter::beginArray(const std::string& name, const std::string& /*type*/) { if (_level == _lastLevel) { *_os << ','; if (_beautify) *_os << '\n'; } else _lastLevel = _level; if (_beautify) indent(); ++_level; if (!name.empty()) { if (_plainkey && isplain(name)) { *_os << name; } else { *_os << '"'; stringOut(name); *_os << '"'; } *_os << ':'; if (_beautify) *_os << ' '; } *_os << '['; if (_beautify) *_os << '\n'; } void JsonFormatter::finishArray() { --_level; _lastLevel = _level; if (_beautify) { *_os << '\n'; indent(); } *_os << ']'; } void JsonFormatter::beginObject(const std::string& name, const std::string& /*type*/) { log_trace("beginObject name=\"" << name << '"'); if (_level == _lastLevel) { *_os << ','; if (_beautify) *_os << '\n'; } else _lastLevel = _level; if (_beautify) indent(); ++_level; if (!name.empty()) { if (_plainkey && isplain(name)) { *_os << name; } else { *_os << '"'; stringOut(name); *_os << '"'; } *_os << ':'; if (_beautify) *_os << ' '; } *_os << '{'; if (_beautify) *_os << '\n'; } void JsonFormatter::beginMember(const std::string& /*name*/) { } void JsonFormatter::finishMember() { } void JsonFormatter::finishObject() { log_trace("finishObject"); --_level; _lastLevel = _level; if (_beautify) { *_os << '\n'; indent(); } *_os << '}'; } void JsonFormatter::indent() { for (unsigned n = 0; n < _level; ++n) *_os << '\t'; } void JsonFormatter::stringOut(const std::string& str) { for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == '"') *_os << "\\\""; else if (*it == '\\') *_os << "\\\\"; else if (*it == '\b') *_os << "\\b"; else if (*it == '\f') *_os << "\\f"; else if (*it == '\n') *_os << "\\n"; else if (*it == '\r') *_os << "\\r"; else if (*it == '\t') *_os << "\\t"; else if (static_cast(*it) >= 0x80 || static_cast(*it) < 0x20) { *_os << "\\u"; static const char hex[] = "0123456789abcdef"; uint32_t v = static_cast(*it); for (uint32_t s = 16; s > 0; s -= 4) { *_os << hex[(v >> (s - 4)) & 0xf]; } } else *_os << *it; } } void JsonFormatter::stringOut(const cxxtools::String& str) { static const char hex[] = "0123456789abcdef"; for (cxxtools::String::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == L'"') *_os << "\\\""; else if (*it == L'\\') *_os << "\\\\"; else if (*it == L'\b') *_os << "\\b"; else if (*it == L'\f') *_os << "\\f"; else if (*it == L'\n') *_os << "\\n"; else if (*it == L'\r') *_os << "\\r"; else if (*it == L'\t') *_os << "\\t"; else if (it->value() >= 0x10000) { uint32_t v = it->value() - 0x10000; uint32_t hi = (v >> 10) | 0xd800; uint32_t lo = (v & 0x3ff) | 0xdc00; *_os << "\\u"; for (uint32_t s = 16; s > 0; s -= 4) *_os << (hex[(hi >> (s - 4)) & 0xf]); *_os << "\\u"; for (uint32_t s = 16; s > 0; s -= 4) *_os << (hex[(lo >> (s - 4)) & 0xf]); } else if (it->value() >= 0x80 || it->value() < 0x20) { *_os << "\\u"; uint32_t v = it->value(); for (uint32_t s = 16; s > 0; s -= 4) *_os << (hex[(v >> (s - 4)) & 0xf]); } else *_os << *it; } } void JsonFormatter::beginValue(const std::string& name) { if (_level == _lastLevel) { *_os << ','; if (_beautify) { *_os << '\n'; indent(); } } else { _lastLevel = _level; if (_beautify) indent(); } if (!name.empty()) { if (_plainkey && isplain(name)) { *_os << name; } else { *_os << '"'; stringOut(name); *_os << '"'; } *_os << ':'; if (_beautify) *_os << ' '; } ++_level; } void JsonFormatter::finishValue() { --_level; } } cxxtools-3.0/src/md5.c0000664000175000017500000002416713644433072011622 00000000000000/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include "md5.h" #include #define MD5_CTX struct cxxtools_MD5_CTX /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform PROTO_LIST ((UINT4 [4], const unsigned char [64])); static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); static void Decode PROTO_LIST ((UINT4 *, const unsigned char *, unsigned int)); /* static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); */ #define MD5_memcpy memcpy #define MD5_memset memset static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void cxxtools_MD5Init (MD5_CTX* context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void cxxtools_MD5Update ( MD5_CTX *context, const unsigned char *input, /* input block */ unsigned int inputLen) /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ void cxxtools_MD5Final ( unsigned char digest[16], /* message digest */ MD5_CTX *context) /* context */ { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); cxxtools_MD5Update (context, PADDING, padLen); /* Append length (before padding) */ cxxtools_MD5Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ MD5_memset ((POINTER)context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform ( UINT4 state[4], const unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ MD5_memset ((POINTER)x, 0, sizeof (x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode ( unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ static void Decode ( UINT4 *output, const unsigned char *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } #if 0 /* Note: Replace "for loop" with standard memcpy if possible. */ static void MD5_memcpy ( POINTER output, POINTER input, unsigned int len) { unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } /* Note: Replace "for loop" with standard memset if possible. */ static void MD5_memset ( POINTER output, int value, unsigned int len) { unsigned int i; for (i = 0; i < len; i++) ((char *)output)[i] = (char)value; } #endif cxxtools-3.0/src/error.h0000664000175000017500000000334413644433072012265 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef ERROR_H #define ERROR_H #include #include namespace cxxtools { std::string getErrnoString(int err, const char* fn); std::string getErrnoString(int err); inline std::string getErrnoString(const char* fn) { return getErrnoString(errno, fn); } inline std::string getErrnoString() { return getErrnoString(errno); } } #endif cxxtools-3.0/src/serializationinfo.cpp0000664000175000017500000006464713666667450015252 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include log_define("cxxtools.serializationinfo") namespace cxxtools { SerializationInfo::SerializationInfo(const SerializationInfo& si) : _category(si._category), _name(si._name), _type(si._type), _u(si._u), _t(si._t), _nodes(0) { switch (_t) { case t_string: new (_StringPtr()) String(si._String()); break; case t_string8: new (_String8Ptr()) std::string(si._String8()); break; default: ; } if (si._nodes) _nodes = new Nodes(*si._nodes); } SerializationInfo& SerializationInfo::operator=(const SerializationInfo& si) { if (this == &si) return *this; assignData(si); _name = si._name; return *this; } #if __cplusplus >= 201103L SerializationInfo::SerializationInfo(SerializationInfo&& si) noexcept : _category(si._category), _name(std::move(si._name)), _type(std::move(si._type)), _u(si._u), _t(si._t), _nodes(si._nodes) { if (si._t == t_string) { new (_StringPtr()) String(std::move(*si._StringPtr())); } else if (si._t == t_string8) { new (_String8Ptr()) std::string(std::move(*si._String8Ptr())); } si._nodes = 0; } SerializationInfo& SerializationInfo::operator=(SerializationInfo&& si) { _category = si._category; _name = std::move(si._name); _type = std::move(si._type); _nodes = si._nodes; si._nodes = 0; if (si._t == t_string) { if (_t != t_string) { _releaseValue(); new (_StringPtr()) String(); _t = t_string; } _String().swap(si._String()); } else if (si._t == t_string8) { if (_t != t_string8) { _releaseValue(); new (_String8Ptr()) std::string(); _t = t_string8; } _String8().swap(si._String8()); } else { _releaseValue(); _t = si._t; _u = si._u; } return *this; } #endif SerializationInfo::~SerializationInfo() { _releaseValue(); delete _nodes; } SerializationInfo& SerializationInfo::addMember(const std::string& name) { log_debug("addMember(\"" << name << "\")"); Nodes& n = nodes(); n.push_back(SerializationInfo()); n.back().setName(name); // category Array overrides Object // This is needed for xmldeserialization. In the xml file the root node of a array // has a category attribute. When the serializationinfo of the array is created // it is known, that it is of category Array. When the members of the array are read, // they should not make an object out of the array. if (_category != Array && _category != Object) _category = name.empty() ? Array : Object; return n.back(); } const SerializationInfo& SerializationInfo::getMember(const std::string& name) const { log_debug("getMember(\"" << name << "\")"); const Nodes& n = nodes(); for (Nodes::const_iterator it = n.begin(); it != n.end(); ++it) { if( it->name() == name ) return *it; } throw SerializationMemberNotFound(*this, name); } SerializationInfo& SerializationInfo::getMember(const std::string& name) { log_debug("getMember(\"" << name << "\")"); Nodes& n = nodes(); for (Nodes::iterator it = n.begin(); it != n.end(); ++it) { if( it->name() == name ) return *it; } throw SerializationMemberNotFound(*this, name); } const SerializationInfo& SerializationInfo::getMember(unsigned idx) const { log_debug("getMember(" << idx << ')'); const Nodes& n = nodes(); if (idx >= n.size()) throw SerializationMemberNotFound(*this, idx); return n[idx]; } SerializationInfo& SerializationInfo::getMember(unsigned idx) { log_debug("getMember(" << idx << ')'); Nodes& n = nodes(); if (idx >= n.size()) throw SerializationMemberNotFound(*this, idx); return n[idx]; } const SerializationInfo* SerializationInfo::findMember(const std::string& name) const { log_debug("findMember(\"" << name << "\")"); const Nodes& n = nodes(); for (Nodes::const_iterator it = n.begin(); it != n.end(); ++it) { if( it->name() == name ) return &(*it); } return 0; } SerializationInfo* SerializationInfo::findMember(const std::string& name) { log_debug("findMember(\"" << name << "\")"); Nodes& n = nodes(); for (Nodes::iterator it = n.begin(); it != n.end(); ++it) { if( it->name() == name ) return &(*it); } return 0; } void SerializationInfo::clear() { _category = Void; _name.clear(); _type.clear(); nodes().clear(); _releaseValue(); } void SerializationInfo::swap(SerializationInfo& si) { if (this == &si) return; std::swap(_category, si._category); std::swap(_name, si._name); std::swap(_type, si._type); if (_t == t_string) { if (si._t == t_string) { // this: String, other: String _String().swap(si._String()); } else if (si._t == t_string8) { // this: String, other: std::string std::string s; si._String8().swap(s); si.setValue(String()); si._String().swap(_String()); setValue(s); } else { // this: String, other: something U u = si._u; T t = si._t; si.setValue(String()); _String().swap(si._String()); _releaseValue(); _u = u; _t = t; } } else if (_t == t_string8) { if (si._t == t_string) { // this: std::string, other: String String s; si._String().swap(s); si.setValue(std::string()); _String8().swap(si._String8()); setValue(s); } else if (si._t == t_string8) { // this: std::string, other: std::string _String8().swap(si._String8()); } else { // this: std::string, other: something U u = si._u; T t = si._t; si.setValue(_String8()); _releaseValue(); _u = u; _t = t; } } else { if (si._t == t_string) { // this: something, other: String U u = _u; T t = _t; setValue(si._String()); si._releaseValue(); si._u = u; si._t = t; } else if (si._t == t_string8) { // this: something, other: std::string U u = _u; T t = _t; setValue(si._String8()); si._releaseValue(); si._u = u; si._t = t; } else { // this: something, other: something std::swap(_u, si._u); std::swap(_t, si._t); } } std::swap(_nodes, si._nodes); } void SerializationInfo::dump(std::ostream& out, const std::string& prefix) const { if (!_name.empty()) out << prefix << "name = \"" << _name << "\"\n"; if (_t != t_none) { out << prefix << "type = " << (_t == t_none ? "none" : _t == t_string ? "string" : _t == t_string8 ? "string8" : _t == t_char ? "char" : _t == t_bool ? "bool" : _t == t_int ? "int" : _t == t_uint ? "uint" : _t == t_ldouble ? "double" : "?") << '\n'; out << prefix << "value = "; switch (_t) { case t_none: out << '-'; break; case t_string: out << '"' << _String().narrow() << '"'; break; case t_string8: out << '"' << _String8() << '"'; break; case t_char: out << '\'' << _u._c << '\''; break; case t_bool: out << _u._b; break; case t_int: out << _u._i; break; case t_uint: out << _u._u; break; case t_float: out << _u._f; break; case t_double: out << _u._d; break; case t_ldouble: out << _u._ld; break; } out << '\n'; } if (!_type.empty()) out << prefix << "typeName = " << _type << '\n'; out << prefix << "category = " << static_cast(_category) << '\n'; const Nodes& n = nodes(); if (!n.empty()) { std::string p = prefix + '\t'; for (Nodes::size_type i = 0; i < n.size(); ++i) { out << prefix << "node[" << i << "]\n"; n[i].dump(out, p); } } } void SerializationInfo::_releaseValue() { switch (_t) { case t_string: _String().~String(); break; case t_string8: { // I don't know how to call the destructor without 'using' so that // both gcc and xlc understand it. using std::string; _String8().~string(); break; } default: ; } _t = t_none; } void SerializationInfo::setNull() { _releaseValue(); _t = t_none; _category = Value; } void SerializationInfo::_setString(const String& value) { if (_t != t_string) { _releaseValue(); new (_StringPtr()) String(value); _t = t_string; } else { _String().assign(value); } _category = Value; } void SerializationInfo::_setString8(const std::string& value) { if (_t != t_string8) { _releaseValue(); new (_String8Ptr()) std::string(value); _t = t_string8; } else { _String8().assign(value); } _category = Value; } void SerializationInfo::_setString8(const char* value) { if (_t != t_string8) { _releaseValue(); new (_String8Ptr()) std::string(value); _t = t_string8; } else { _String8().assign(value); } _category = Value; } void SerializationInfo::_setChar(char value) { if (_t != t_char) { _releaseValue(); _t = t_char; } _u._c = value; _category = Value; } void SerializationInfo::_setBool(bool value) { if (_t != t_bool) { _releaseValue(); _t = t_bool; } _u._b = value; _category = Value; } void SerializationInfo::_setInt(int_type value) { if (_t != t_int) { _releaseValue(); _t = t_int; } _u._i = value; _category = Value; } void SerializationInfo::_setUInt(unsigned_type value) { if (_t != t_uint) { _releaseValue(); _t = t_uint; } _u._u= value; _category = Value; } void SerializationInfo::_setFloat(float value) { if (_t != t_float) { _releaseValue(); _t = t_float; } _u._f = value; _category = Value; } void SerializationInfo::_setDouble(double value) { if (_t != t_double) { _releaseValue(); _t = t_double; } _u._d = value; _category = Value; } void SerializationInfo::_setLongDouble(long double value) { if (_t != t_ldouble) { _releaseValue(); _t = t_ldouble; } _u._ld = value; _category = Value; } void SerializationInfo::getValue(String& value) const { switch (_t) { case t_none: value.clear(); break; case t_string: value.assign(_String()); break; case t_string8: value.assign(_String8()); break; case t_char: value.assign(1, _u._c); break; case t_bool: convert(value, _u._b); break; case t_int: convert(value, _u._i); break; case t_uint: convert(value, _u._u); break; case t_float: convert(value, _u._f); break; case t_double: convert(value, _u._d); break; case t_ldouble: convert(value, _u._ld); break; } } void SerializationInfo::getValue(std::string& value) const { switch (_t) { case t_none: value.clear(); break; case t_string: value = _String().narrow(); break; case t_string8: value.assign(_String8()); break; case t_char: value.assign(1, _u._c); break; case t_bool: convert(value, _u._b); break; case t_int: convert(value, _u._i); break; case t_uint: convert(value, _u._u); break; case t_float: convert(value, _u._f); break; case t_double: convert(value, _u._d); break; case t_ldouble: convert(value, _u._ld); break; } } namespace { inline bool isFalse(char c) { return c == '\0' || c == '0' || c == 'f' || c == 'F' || c == 'n' || c == 'N'; } } bool SerializationInfo::_getBool() const { switch (_t) { case t_none: return false; case t_string: return !_String().empty() && !isFalse((_String())[0].narrow()); case t_string8: return !_String8().empty() && !isFalse((_String8())[0]); case t_char: return !isFalse(_u._c); case t_bool: return _u._b; case t_int: return _u._i; case t_uint: return _u._u; case t_float: return _u._f; case t_double: return _u._d; case t_ldouble: return _u._ld; } // never reached return false; } wchar_t SerializationInfo::_getWChar() const { switch (_t) { case t_none: return L'\0'; case t_string: return _String().empty() ? L'\0' : _String()[0].toWchar(); case t_string8: return _String8().empty() ? '\0' : _String8()[0]; case t_char: return _u._c; case t_bool: return _u._b; case t_int: return _u._i; case t_uint: return _u._u; case t_float: return static_cast(_u._f); case t_double: return static_cast(_u._d); case t_ldouble: return static_cast(_u._ld); } // never reached return 0; } char SerializationInfo::_getChar() const { switch (_t) { case t_none: return '\0'; break; case t_string: return _String().empty() ? '\0' : (_String())[0].narrow(); break; case t_string8: return _String8().empty() ? '\0' : (_String8())[0]; break; case t_char: return _u._c; break; case t_bool: return _u._b; break; case t_int: return _u._i; break; case t_uint: return _u._u; break; case t_float: return static_cast(_u._f); break; case t_double: return static_cast(_u._d); break; case t_ldouble: return static_cast(_u._ld); break; } // never reached return 0; } SerializationInfo::int_type SerializationInfo::_getInt(const char* type, int_type min, int_type max) const { int_type ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert(_String()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, type, "String", _String().narrow()); } break; case t_string8: try { ret = convert(_String8()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, type, "string", _String8()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: ret = _u._i; break; case t_uint: if (_u._u > static_cast(std::numeric_limits::max())) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } ret = _u._u; break; case t_float: ret = static_cast(_u._f); break; case t_double: ret = static_cast(_u._d); break; case t_ldouble: ret = static_cast(_u._ld); break; } if (ret < min || ret > max) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } return ret; } SerializationInfo::unsigned_type SerializationInfo::_getUInt(const char* type, unsigned_type max) const { unsigned_type ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert(_String()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, type, "String", _String().narrow()); } break; case t_string8: try { ret = convert(_String8()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, type, "string", _String8()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: if (_u._i < 0) throw std::range_error(std::string("negative values do not fit into ") + type); ret = _u._i; break; case t_uint: ret = _u._u; break; case t_float: ret = static_cast(_u._f); break; case t_double: ret = static_cast(_u._d); break; case t_ldouble: ret = static_cast(_u._ld); break; } if (ret > max) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } return ret; } float SerializationInfo::_getFloat() const { float ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert(_String()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, "float", "String", _String().narrow()); } break; case t_string8: try { ret = convert(_String8()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, "float", "string", _String8()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: ret = _u._i; break; case t_uint: ret = _u._u; break; case t_float: ret = _u._f; break; case t_double: if (_u._d == std::numeric_limits::infinity()) ret = std::numeric_limits::infinity(); else if (_u._d == -std::numeric_limits::infinity()) ret = -std::numeric_limits::infinity(); else if (_u._d != _u._d) // NaN ret = _u._d; else if (_u._d > std::numeric_limits::max() || _u._d < -std::numeric_limits::max()) { std::ostringstream msg; msg << "value " << _u._d << " does not fit into float"; throw std::range_error(msg.str()); } else ret = static_cast(_u._d); break; case t_ldouble: if (_u._ld == std::numeric_limits::infinity()) ret = std::numeric_limits::infinity(); else if (_u._ld == -std::numeric_limits::infinity()) ret = -std::numeric_limits::infinity(); else if (_u._ld != _u._ld) // NaN ret = _u._ld; else if (_u._ld > std::numeric_limits::max() || _u._ld < -std::numeric_limits::max()) { std::ostringstream msg; msg << "value " << _u._ld << " does not fit into float"; throw std::range_error(msg.str()); } else ret = static_cast(_u._ld); break; } return ret; } double SerializationInfo::_getDouble() const { double ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert(_String()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, "double", "String", _String().narrow()); } break; case t_string8: try { ret = convert(_String8()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, "double", "string", _String8()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: ret = _u._i; break; case t_uint: ret = _u._u; break; case t_float: ret = _u._f; break; case t_double: ret = _u._d; break; case t_ldouble: if (_u._ld == std::numeric_limits::infinity()) ret = std::numeric_limits::infinity(); else if (_u._ld == -std::numeric_limits::infinity()) ret = -std::numeric_limits::infinity(); else if (_u._ld != _u._ld) // NaN ret = _u._ld; else if (_u._ld > std::numeric_limits::max() || _u._ld < -std::numeric_limits::max()) { std::ostringstream msg; msg << "value " << _u._ld << " does not fit into double"; throw std::range_error(msg.str()); } else ret = static_cast(_u._ld); break; } return ret; } long double SerializationInfo::_getLongDouble() const { long double ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert(_String()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, "long double", "String", _String().narrow()); } break; case t_string8: try { ret = convert(_String8()); } catch (const ConversionError&) { SerializationConversionError::doThrow(*this, "long double", "string", _String8()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: ret = _u._i; break; case t_uint: ret = _u._u; break; case t_float: ret = _u._f; break; case t_double: ret = _u._d; break; case t_ldouble: ret = _u._ld; break; } return ret; } SerializationInfo::Nodes& SerializationInfo::nodes() { if (!_nodes) _nodes = new Nodes; return *_nodes; } const SerializationInfo::Nodes& SerializationInfo::nodes() const { static const Nodes emptyNodes; if (_nodes) return *_nodes; else return emptyNodes; } void SerializationInfo::assignData(const SerializationInfo& si) { _category = si._category; _type = si._type; delete _nodes; _nodes = 0; if (si._nodes) _nodes = new Nodes(*si._nodes); if (si._t == t_string) _setString( si._String() ); else if (si._t == t_string8) _setString8( si._String8() ); else { _releaseValue(); _u = si._u; _t = si._t; } } void operator <<=(SerializationInfo& si, const SerializationInfo& ssi) { si.assignData(ssi); } } // namespace cxxtools cxxtools-3.0/src/jsonparser.cpp0000664000175000017500000005102413644433072013653 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include log_define("cxxtools.json.parser") namespace cxxtools { inline Char fromUtf16(uint32_t lo, uint32_t hi) { return Char((((hi & 0x3ff) << 10) | (lo & 0x3ff)) + 0x10000); } const char* JsonParserError::what() const throw() { if (_msg.empty()) { try { std::ostringstream s; s << "parsing json failed in line " << _lineNo << ": " << SerializationError::what(); _msg = s.str(); } catch (...) { return SerializationError::what(); } } return _msg.c_str(); } void JsonParser::doThrow(const std::string& msg) { throw JsonParserError(msg, _lineNo); } void JsonParser::throwInvalidCharacter(Char ch) { log_debug("invalid character '" << ch << "' in state " << _state); doThrow((std::string("invalid character '") + ch.narrow() + '\'')); } bool JsonParser::JsonStringParser::advance(Char ch) { switch (_state) { case state_0: if (ch == '\\') _state = state_esc; else if (ch == '"') return true; else _str += ch; break; case state_esc: _state = state_0; if (ch == '"' || ch == '\\' || ch == '/') _str += ch; else if (ch == 'b') _str += '\b'; else if (ch == 'f') _str += '\f'; else if (ch == 'n') _str += '\n'; else if (ch == 'r') _str += '\r'; else if (ch == 't') _str += '\t'; else if (ch == 'u') { _value = 0; _count = 4; _state = state_hex; } else _jsonParser->doThrow(std::string("invalid character '") + ch.narrow() + "' in string"); break; case state_hex: case state_highsurrogate_hex: case state_lowsurrogate_hex: if (ch >= '0' && ch <= '9') _value = (_value << 4) | (ch.value() - '0'); else if (ch >= 'a' && ch <= 'f') _value = (_value << 4) | (ch.value() - 'a' + 10); else if (ch >= 'A' && ch <= 'F') _value = (_value << 4) | (ch.value() - 'A' + 10); else _jsonParser->doThrow(std::string("invalid character '") + ch.narrow() + "' in hex sequence"); if (--_count == 0) { switch (_state) { case state_hex: // check for surrogate if ((_value & 0xfc00) == 0xd800) { _state = state_lowsurrogate0; _surrogateValue = _value; } else if ((_value & 0xfc00) == 0xdc00) { _state = state_highsurrogate0; _surrogateValue = _value; } else { _str += Char(static_cast(_value)); _state = state_0; } break; case state_highsurrogate_hex: if ((_value & 0xfc00) != 0xd800) _jsonParser->doThrow("expecting surrogate value \\ud8xx " + std::to_string(_value)); _str += fromUtf16(_surrogateValue, _value); _state = state_0; break; case state_lowsurrogate_hex: if ((_value & 0xfc00) != 0xdc00) _jsonParser->doThrow("expecting surrogate value \\uddxx " + std::to_string(_value)); _str += fromUtf16(_value, _surrogateValue); _state = state_0; break; } } break; case state_highsurrogate0: case state_lowsurrogate0: if (ch != '\\') _jsonParser->doThrow("expecting start of surrogate pair"); _state = (_state == state_highsurrogate0 ? state_highsurrogate_esc : state_lowsurrogate_esc); break; case state_highsurrogate_esc: case state_lowsurrogate_esc: if (ch != 'u') _jsonParser->doThrow("expecting unicode mark \\u"); _value = 0; _count = 4; _state = (_state == state_highsurrogate_esc ? state_highsurrogate_hex : state_lowsurrogate_hex); break; } return false; } JsonParser::JsonParser() : _deserializer(0), _stringParser(this), _next(0), _lineNo(1) { } JsonParser::~JsonParser() { delete _next; } int JsonParser::advance(Char ch) { int ret; if (ch == '\n') ++_lineNo; try { switch (_state) { case state_0: if (ch == '{') { _state = state_object; _deserializer->setCategory(SerializationInfo::Object); } else if (ch == '[') { _state = state_array; _deserializer->setCategory(SerializationInfo::Array); } else if (ch == '"') { _state = state_string; _deserializer->setCategory(SerializationInfo::Value); } else if ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-') { _token = ch; _state = state_number; _deserializer->setCategory(SerializationInfo::Value); } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) { _token = ch; _state = state_token; } break; case state_object: if (ch == '"') { _state = state_object_name; _stringParser.clear(); } else if (ch == '}') { _state = state_end; return 1; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (std::isalpha(ch.value())) { _token = ch; _state = state_object_plainname; } else if (!std::isspace(ch.value())) throwInvalidCharacter(ch); break; case state_object_plainname: if (std::isalnum(ch.value()) || ch == 'l') _token += ch; else if (std::isspace(ch.value())) { _stringParser.str(_token); _state = state_object_after_name; } else if (ch == ':') { _stringParser.str(_token); if (_next == 0) _next = new JsonParser(); log_debug("begin object member " << _stringParser.str()); _deserializer->beginMember(Utf8Codec::encode(_stringParser.str()), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _stringParser.clear(); _state = state_object_value; } else throwInvalidCharacter(ch); break; case state_object_name: if (_stringParser.advance(ch)) _state = state_object_after_name; break; case state_object_after_name: if (ch == ':') { if (_next == 0) _next = new JsonParser(); log_debug("begin object member " << _stringParser.str()); _deserializer->beginMember(Utf8Codec::encode(_stringParser.str()), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _stringParser.clear(); _state = state_object_value; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) throwInvalidCharacter(ch); break; case state_object_value: ret = _next->advance(ch); if (ret != 0) { log_debug("leave object member"); _deserializer->leaveMember(); _state = state_object_e; } if (ret != -1) break; case state_object_e: if (ch == ',') _state = state_object_next_member0; else if (ch == '}') { _state = state_end; return 1; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) throwInvalidCharacter(ch); break; case state_object_next_member0: if (ch == '}') { _state = state_end; return 1; } else if (std::isspace(ch.value())) { return 0; } _state = state_object_next_member; // no break case state_object_next_member: if (ch == '"') { _state = state_object_name; _stringParser.clear(); } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (std::isalpha(ch.value())) { _token = ch; _state = state_object_plainname; } else if (!std::isspace(ch.value())) throwInvalidCharacter(ch); break; case state_array: if (ch == ']') { _state = state_end; return 1; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) { if (_next == 0) _next = new JsonParser(); log_debug("begin array member"); _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _next->advance(ch); _state = state_array_value; } break; case state_array_value0: if (ch == ']') { _state = state_end; return 1; } else if (std::isspace(ch.value())) { return 0; } log_debug("begin array member"); _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _state = state_array_value; // no break case state_array_value: ret = _next->advance(ch); if (ret != 0) _state = state_array_e; if (ret != -1) break; case state_array_e: if (ch == ']') { log_debug("leave array member"); _deserializer->leaveMember(); _state = state_end; return 1; } else if (ch == ',') { log_debug("leave array member"); _deserializer->leaveMember(); _state = state_array_value0; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) throwInvalidCharacter(ch); break; case state_string: if (_stringParser.advance(ch)) { log_debug("set string value \"" << _stringParser.str() << '"'); _deserializer->setValue(_stringParser.str()); _deserializer->setTypeName("string"); _stringParser.clear(); _state = state_end; return 1; } break; case state_number: if (std::isspace(ch.value())) { log_debug("set int value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("int"); _token.clear(); return 1; } else if (ch == '.' || ch == 'e' || ch == 'E') { _token += ch; _state = state_float; } else if (ch >= '0' && ch <= '9') { _token += ch; } else { log_debug("set int value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("int"); _token.clear(); return -1; } break; case state_float: if (std::isspace(ch.value())) { log_debug("set double value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("double"); _token.clear(); return 1; } else if ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E') _token += ch; else { log_debug("set double value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("double"); _token.clear(); return -1; } break; case state_token: if (std::isalpha(ch.value())) _token += Char(std::tolower(ch)); else { if (_token == "true" || _token == "false") { log_debug("set bool value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("bool"); _token.clear(); } else if (_token == "null") { log_debug("set null value \"" << _token << '"'); _deserializer->setTypeName("null"); _deserializer->setNull(); _token.clear(); } return -1; } break; case state_comment0: if (ch == '/') _state = state_commentline; else if (ch == '*') _state = state_comment; else throwInvalidCharacter(ch); break; case state_commentline: if (ch == '\n') _state = _nextState; break; case state_comment: if (ch == '*') _state = state_comment_e; break; case state_comment_e: if (ch == '/') _state = _nextState; else if (ch != '*') _state = state_comment; break; case state_end: if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) doThrow(std::string("unexpected character '") + ch.narrow() + "\' after end in json parser"); break; } } catch (JsonParserError& e) { e._lineNo = _lineNo; throw; } return 0; } void JsonParser::finish() { if (_state == state_commentline) _state = _nextState; switch (_state) { case state_0: case state_object: case state_object_plainname: case state_object_name: case state_object_after_name: case state_object_value: case state_object_e: case state_object_next_member0: case state_object_next_member: case state_array: case state_array_value0: case state_array_value: case state_array_e: case state_string: case state_comment0: case state_commentline: case state_comment: case state_comment_e: log_warn("unexpected end of json; state=" << _state); doThrow("unexpected end of json"); case state_number: _deserializer->setValue(_token); _deserializer->setTypeName("int"); _token.clear(); break; case state_float: _deserializer->setValue(_token); _deserializer->setTypeName("double"); _token.clear(); break; case state_token: if (_token == "true" || _token == "false") { _deserializer->setValue(_token); _deserializer->setTypeName("bool"); _token.clear(); } else if (_token == "null") { _deserializer->setTypeName("null"); _deserializer->setNull(); _token.clear(); } break; case state_end: break; } } } cxxtools-3.0/src/selectorimpl.h0000664000175000017500000000423413644433072013635 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_POSIX_SELECTORIMPL_H #define CXXTOOLS_SYSTEM_POSIX_SELECTORIMPL_H #include #include #include #include #include #include namespace cxxtools { class SelectorImpl { public: SelectorImpl(); ~SelectorImpl(); void add( Selectable& dev ); void remove( Selectable& dev ); void changed( Selectable& dev ); bool waitUntil(Timespan timeout); void wake(); private: static const short POLL_ERROR_MASK; int _wakePipe[2]; bool _isDirty; std::vector _pollfds; std::set::iterator _current; std::set _devices; std::set _avail; }; }//namespace xpr #endif cxxtools-3.0/src/charmapcodec.cpp0000664000175000017500000000644213644433072014102 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/charmapcodec.h" #include "cxxtools/log.h" log_define("cxxtools.charmapcodec") namespace cxxtools { namespace { typedef Char::value_type CharMap[256]; inline Char toUChar(const CharMap& charMap, char ch) { return Char(charMap[static_cast(ch)]); } char toChar(const CharMap& charMap, Char ch) { // for optimization look up identity mapping first if (ch.value() < 256 && charMap[ch.value()] == ch.value()) return static_cast(ch.value()); for (unsigned n = 0; n < 256; ++n) { if (charMap[n] == ch.value()) return static_cast(n); } return ' '; } } CharMapCodec::result CharMapCodec::do_in(MBState& /*s*/, const char* fromBegin, const char* fromEnd, const char*& fromNext, Char* toBegin, Char* toEnd, Char*& toNext) const { fromNext = fromBegin; toNext = toBegin; while (fromNext < fromEnd && toNext < toEnd) { *toNext = toUChar(_charMap, *fromNext); ++fromNext; ++toNext; } return ok; } CharMapCodec::result CharMapCodec::do_out(MBState& /*s*/, const Char* fromBegin, const Char* fromEnd, const Char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { fromNext = fromBegin; toNext = toBegin; while (fromNext < fromEnd && toNext < toEnd) { *toNext = toChar(_charMap, *fromNext); log_debug(fromNext->value() << " => " << static_cast(static_cast(*toNext))); ++fromNext; ++toNext; } return ok; } int CharMapCodec::do_length(MBState& /*s*/, const char* /*fromBegin*/, const char* /*fromEnd*/, size_t max) const { return max; } int CharMapCodec::do_max_length() const throw() { return 1; } bool CharMapCodec::do_always_noconv() const throw() { return false; } } // namespace cxxtools cxxtools-3.0/src/connection.cpp0000664000175000017500000000572613644433072013634 00000000000000/* * Copyright (C) 2004-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/connectable.h" namespace cxxtools { Connection::Connection() { _data = new ConnectionData(); } Connection::Connection(Connectable& sender, Slot* slot) { _data = new ConnectionData(sender, slot); try { _data->setValid(false); sender.onConnectionOpen(*this); slot->onConnect(*this); _data->setValid(true); } catch (...) { delete _data; throw; } } Connection::Connection(const Connection& connection) : _data(connection._data) { if (_data) _data->addRef(); } Connection::~Connection() { if( !_data || _data->release() > 0) { return; } // close the connection if its still valid this->close(); // delete the shared data delete _data; } void Connection::close() { if( !this->valid() ) return; Connection c(_data); c._data->slot().onDisconnect( *this ); // We set the valid flag here to false since the call above may // fail for any reason. If setting the valid flag before, a // connection may pretend to be closed but it is not and it // may reside e.g. in the list of connections of the // Connectable class and then provoke an infinite loop. c._data->setValid(false); c._data->sender().onConnectionClose( c ); } Connection& Connection::operator=(const Connection& connection) { if (_data == connection._data) return *this; if (_data && _data->release() == 0) { close(); delete _data; } _data = connection._data; if (_data) _data->addRef(); return (*this); } } //namespace cxxtools cxxtools-3.0/src/textstream.cpp0000664000175000017500000000407413644433072013670 00000000000000/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/textstream.h" namespace cxxtools { TextIStream::TextIStream(std::istream& is, Codec* codec) : BasicTextIStream(is, codec) { } TextIStream::TextIStream(Codec* codec) : BasicTextIStream(codec) { } TextIStream::~TextIStream() { } TextOStream::TextOStream(std::ostream& os, Codec* codec) : BasicTextOStream(os, codec) { } TextOStream::TextOStream(Codec* codec) : BasicTextOStream(codec) { } TextOStream::~TextOStream() { } TextStream::TextStream(std::iostream& ios, Codec* codec) : BasicTextStream(ios, codec) { } TextStream::TextStream(Codec* codec) : BasicTextStream(codec) { } TextStream::~TextStream() { } } // namespace cxxtools cxxtools-3.0/src/directory.cpp0000664000175000017500000001213013644433072013464 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "directoryimpl.h" #include "cxxtools/directory.h" namespace cxxtools { DirectoryIterator::DirectoryIterator() : _impl(0) { } DirectoryIterator::DirectoryIterator(const std::string& path, bool skipHidden) { _impl = new DirectoryIteratorImpl( path.c_str(), skipHidden ); } DirectoryIterator::DirectoryIterator(const DirectoryIterator& it) : _impl(0) { _impl = it._impl; if (_impl) _impl->ref(); } DirectoryIterator::~DirectoryIterator() { if (_impl && 0 == _impl->deref()) { delete _impl; } } DirectoryIterator& DirectoryIterator::operator++() { if (_impl && !_impl->advance()) { if (0 == _impl->deref()) delete _impl; _impl = 0; } return *this; } DirectoryIterator& DirectoryIterator::operator=(const DirectoryIterator& it) { if (_impl == it._impl) return *this; if (_impl && 0 == _impl->deref()) { delete _impl; } _impl = it._impl; if (_impl) _impl->ref(); return *this; } const std::string& DirectoryIterator::path() const { return _impl->path(); } const std::string& DirectoryIterator::operator*() const { return _impl->name(); } const std::string* DirectoryIterator::operator->() const { return &_impl->name(); } Directory::Directory() { } Directory::Directory(const std::string& path) : _path(path) { if (! exists(_path) ) throw DirectoryNotFound(path); } Directory::Directory(const FileInfo& fi) : _path( fi.path() ) { if (!exists(_path)) throw DirectoryNotFound(fi.path()); } Directory::Directory(const Directory& dir) : _path(dir._path) { } Directory::~Directory() { } Directory& Directory::operator=(const Directory& dir) { _path = dir._path; return *this; } std::size_t Directory::size() const { return 0; } Directory::const_iterator Directory::begin(bool skipHidden) const { return DirectoryIterator( path(), skipHidden ); } Directory::const_iterator Directory::end() const { return DirectoryIterator(); } void Directory::remove() { DirectoryImpl::remove( path() ); } void Directory::move(const std::string& to) { DirectoryImpl::move(path(), to); _path = to; } std::string Directory::dirName() const { // Find last slash. This separates the last path segment from the rest of the path std::string::size_type separatorPos = path().find_last_of( this->sep() ); // If there is no separator, this directory is relative to the current current directory. // So an empty path is returned. if (separatorPos == std::string::npos) { return ""; } // Include trailing separator to be able to distinguish between no path ("") and a path // which is relative to the root ("/"), for example. return path().substr(0, separatorPos + 1); } std::string Directory::name() const { std::string::size_type separatorPos = path().rfind( this->sep() ); if (separatorPos != std::string::npos) { return path().substr(separatorPos + 1); } else { return path(); } } Directory Directory::create(const std::string& path) { DirectoryImpl::create( path ); return Directory(path); } bool Directory::exists(const std::string& path) { return DirectoryImpl::exists(path); } void Directory::chdir(const std::string& path) { DirectoryImpl::chdir(path); } std::string Directory::cwd() { return DirectoryImpl::cwd(); } std::string Directory::curdir() { return DirectoryImpl::curdir(); } std::string Directory::updir() { return DirectoryImpl::updir(); } std::string rootdir() { return DirectoryImpl::rootdir(); } std::string tmpdir() { return DirectoryImpl::tmpdir(); } std::string Directory::sep() { return DirectoryImpl::sep(); } } // namespace cxxtools cxxtools-3.0/src/error.cpp0000664000175000017500000000636313644433072012624 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "error.h" #include #include #include namespace cxxtools { namespace { // XSI compliant strerror_r inline void errorOut(int (*errfn)(int, char*, size_t), std::ostream& out, int errnum) { std::vector buffer(512); while (errfn(errnum, &buffer[0], buffer.size()) != 0) { if (errno != ERANGE) { out << "Unknown error " << errnum; return; } buffer.resize(buffer.size() * 2); } out << &buffer[0]; } // GNU specific strerror_r inline void errorOut(char* (*errfn)(int, char*, size_t), std::ostream& out, int errnum) { std::vector buffer(512); while (true) { char* f = errfn(errnum, &buffer[0], buffer.size()); if (f != &buffer[0]) { out << f; return; } if (strlen(&buffer[0]) < buffer.size() - 1) break; buffer.resize(buffer.size() * 2); } out << &buffer[0]; } inline void errorOut(std::ostream& out, int errnum) { errorOut(strerror_r, out, errnum); } } std::string getErrnoString(int errnum) { std::ostringstream msg; msg << "errno " << errnum << ": "; errorOut(msg, errnum); return msg.str(); } std::string getErrnoString(int errnum, const char* fn) { if (errnum != 0) { std::ostringstream msg; if (fn && fn[0]) msg << "error " << errnum << " in function " << fn << ": "; else msg << "error " << errnum << ": "; errorOut(msg, errnum); return msg.str(); } else if (fn && fn[0]) { std::ostringstream msg; msg << "function " << fn << " failed with unknown error"; return msg.str(); } else { return "unknown error"; } } } cxxtools-3.0/src/iconvwrap.cpp0000664000175000017500000000420013644433072013467 00000000000000/* * Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iconvwrap.h" namespace cxxtools { iconvwrap::iconvwrap() : cd(iconv_t(-1)) { } iconvwrap::iconvwrap(const char *tocode, const char *fromcode) { open(tocode, fromcode); } bool iconvwrap::close() { if (cd != iconv_t(-1)) { int ret; ret = ::iconv_close(cd); cd = iconv_t(-1); return (ret != -1); } return true; } bool iconvwrap::convert(char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft) != size_t(-1)); } bool iconvwrap::is_open() { return (cd != iconv_t(-1)); } bool iconvwrap::open(const char *tocode, const char *fromcode) { close(); cd = ::iconv_open(tocode, fromcode); return (cd != iconv_t(-1)); } iconvwrap::~iconvwrap() { close(); } } cxxtools-3.0/src/win1252codec.cpp0000664000175000017500000000724513644433072013600 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { namespace { static const Char::value_type win1252CharMap[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF }; } Win1252Codec::Win1252Codec(size_t ref) : CharMapCodec(win1252CharMap, ref) { } } cxxtools-3.0/src/uri.cpp0000664000175000017500000001705013644433072012265 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace cxxtools { namespace net { namespace { void throwInvalid(const std::string& uri) { throw std::runtime_error("invalid uri <" + uri + '>'); } } void Uri::parse(const char* uri) { enum { state_0, state_protocol, state_postprotocol, state_postprotocol2, state_postprotocol3, state_user_or_host, state_password_or_port, state_password, state_host, state_ipv6, state_ipv6ok, state_ipv6end, state_port, state_path, state_query, state_fragment } state = state_0; bool hasPort = false; for (const char* p = uri; *p; ++p) { char ch = *p; switch (state) { case state_0: if (std::isalpha(ch)) { _protocol = ch; state = state_protocol; } else if (!std::isspace(ch)) throwInvalid(uri); break; case state_protocol: if (std::isalpha(ch)) _protocol += ch; else if (ch == ':') state = state_postprotocol; else throwInvalid(uri); break; case state_postprotocol: if (ch == '/') state = state_postprotocol2; else throwInvalid(uri); break; case state_postprotocol2: if (ch == '/') state = state_postprotocol3; else throwInvalid(uri); break; case state_postprotocol3: if (ch == '[') { _ipv6 = true; state = state_ipv6; } else { _user = ch; state = state_user_or_host; } break; case state_user_or_host: if (ch == ':') state = state_password_or_port; else if (ch == '/') { _host = _user; _user.clear(); _path = ch; state = state_path; } else if (ch == '@') state = state_host; else _user += ch; break; case state_password_or_port: if (ch == '@') { _port = 0; state = state_host; } else if (ch == '/') { _host = _user; _user.clear(); _password.clear(); _path = ch; state = state_path; } else if (std::isdigit(ch)) { hasPort = true; _password += ch; _port = _port * 10 + ch - '0'; } else { _port = 0; hasPort = false; _password += ch; state = state_password; } break; case state_password: if (ch == '@') state = state_host; else _password += ch; break; case state_host: if (ch == '/') { _path = ch; state = state_path; } else if (ch == ':') state = state_port; else if (_host.empty() && ch == '[') { _ipv6 = true; state = state_ipv6; } else _host += ch; break; case state_ipv6: if (ch == ':') { _host += ch; state = state_ipv6ok; } else if (std::isdigit(ch) || (ch >= 'a' && ch <= 'f') || (ch >= 'F' && ch <= 'F')) _host += ch; else throwInvalid(uri); break; case state_ipv6ok: if (ch == ']') state = state_ipv6end; else if (std::isdigit(ch) || (ch >= 'a' && ch <= 'f') || (ch >= 'F' && ch <= 'F') || ch == ':') _host += ch; else throwInvalid(uri); break; case state_ipv6end: if (ch == ':') { hasPort = true; state = state_port; } else if (ch == '/') { _path = ch; state = state_path; } else throwInvalid(uri); break; case state_port: if (ch == '/') { _path = ch; state = state_path; } else if (std::isdigit(ch)) { hasPort = true; _port = _port * 10 + ch - '0'; } else throwInvalid(uri); break; case state_path: if (ch == '?') state = state_query; else if (ch == '#') state = state_fragment; else _path += ch; break; case state_query: if (ch == '#') state = state_fragment; else _query += ch; break; case state_fragment: _fragment += ch; break; } } switch (state) { case state_port: case state_host: case state_path: case state_query: case state_fragment: break; case state_user_or_host: _host = _user; _user.clear(); break; default: throwInvalid(uri); } if (!hasPort) { if (_protocol == "http") _port = 80; else if (_protocol == "https") _port = 443; else if (_protocol == "ftp") _port = 21; } } std::string Uri::str() const { std::ostringstream s; s << _protocol << "://"; if (!_user.empty() || !_password.empty()) { s << _user; if (!_password.empty()) s << ':' << _password; s << '@'; } if (_ipv6) s << '[' << _host << ']'; else s << _host; if (!(_port == 0 || (_protocol == "http" && _port == 80) || (_protocol == "https" && _port == 443) || (_protocol == "ftp" && _port == 21))) s << ':' << _port; s << _path; if (!_query.empty()) s << '?' << _query; if (!_fragment.empty()) s << '#' << _fragment; return s.str(); } } } cxxtools-3.0/src/string.cpp0000664000175000017500000004476213644433072013006 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace std { const basic_string::size_type basic_string::npos; #if __cplusplus >= 201103L basic_string::basic_string(basic_string&& str) noexcept : _data(str._data) { if (!isShortString()) { str._data.u.shortdata[0] = 0; str._data.u.shortdata[_shortStringSize - 1] = _shortStringSize - 1; } } basic_string& basic_string::operator=(basic_string&& str) { if (!isShortString()) { _data.deallocate(longStringData(), longStringCapacity() + 1); } _data = str._data; if (!isShortString()) { str._data.u.shortdata[0] = 0; str._data.u.shortdata[_shortStringSize - 1] = _shortStringSize - 1; } return *this; } #endif void basic_string::resize(size_t n, cxxtools::Char ch) { size_type size = this->size(); if(size < n) { this->append(n - size, ch); } else if(n < size) { this->erase(n); } } void basic_string::reserve(size_t n) { if (capacity() < n) { // since capacity is always at least shortStringCapacity, we need to use long string // to ensure the requested capacity if the current is not enough cxxtools::Char* p = reinterpret_cast(_data.allocate(n + 1)); size_type l = length(); const cxxtools::Char* oldData = privdata_ro(); traits_type::copy(p, oldData, l); if (isShortString()) markLongString(); else _data.deallocate(longStringData(), longStringCapacity() + 1); _data.u.ptr._begin = p; _data.u.ptr._end = p + l; _data.u.ptr._capacity = p + n; *_data.u.ptr._end = cxxtools::Char::null(); } } void basic_string::privreserve(size_t n) { if (capacity() < n) { size_type nn = 16; while (nn < n) nn += (nn >> 1); reserve(nn); } } void basic_string::swap(basic_string& str) { if (isShortString()) { if (str.isShortString()) { for (unsigned nn = 0; nn < _shortStringSize; ++nn) std::swap(shortStringData()[nn], str.shortStringData()[nn]); } else { Ptr p = str._data.u.ptr; for (unsigned nn = 0; nn < _shortStringSize; ++nn) str.shortStringData()[nn] = shortStringData()[nn]; markLongString(); _data.u.ptr = p; } } else { if (str.isShortString()) { Ptr p = _data.u.ptr; for (unsigned nn = 0; nn < _shortStringSize; ++nn) shortStringData()[nn] = str.shortStringData()[nn]; str.markLongString(); str._data.u.ptr = p; } else { std::swap(_data.u.ptr, str._data.u.ptr); } } } basic_string::size_type basic_string::copy(cxxtools::Char* a, size_type n, size_type pos) const { if( pos > this->size() ) { throw out_of_range("basic_string::copy"); } if(n > this->size() - pos) { n = this->size() - pos; } traits_type::copy(a, privdata_ro() + pos, n); return n; } basic_string& basic_string::assign(const basic_string& str) { // self-assignment check if (this == &str) { return *this; } privreserve(str.size()); cxxtools::Char* p = privdata_rw(); size_type l = str.length(); traits_type::copy(p, str.data(), l); setLength(l); return *this; } basic_string& basic_string::assign(const std::string& str) { size_type len = str.length(); privreserve(len); cxxtools::Char* p = privdata_rw(); for (size_type n = 0; n < len; ++n) p[n] = cxxtools::Char( str[n] ); setLength(len); return *this; } basic_string& basic_string::assign(const std::string& str, size_type pos, size_type len) { privreserve(len); cxxtools::Char* p = privdata_rw(); for (size_type n = 0; n < len; ++n) p[n] = cxxtools::Char( str[pos + n] ); setLength(len); return *this; } basic_string& basic_string::assign(const wchar_t* str) { size_type length = 0; while (str[length]) ++length; assign(str, length); return *this; } basic_string& basic_string::assign(const wchar_t* str, size_type length) { privreserve(length); cxxtools::Char* d = privdata_rw(); for (unsigned n = 0; n < length; ++n) { d[n] = str[n]; } setLength(length); return *this; } basic_string& basic_string::assign(const char* str) { size_type length = 0; while (str[length]) ++length; assign(str, length); return *this; } basic_string& basic_string::assign(const char* str, size_type length) { privreserve(length); cxxtools::Char* d = privdata_rw(); for (unsigned n = 0; n < length; ++n) { d[n] = cxxtools::Char(str[n]); } setLength(length); return *this; } basic_string& basic_string::assign(const cxxtools::Char* str, size_type length) { // self-assignment check if (str != privdata_ro()) { privreserve(length); traits_type::copy(privdata_rw(), str, length); } setLength(length); return *this; } basic_string& basic_string::assign(size_type n, cxxtools::Char ch) { privreserve(n); cxxtools::Char* p = privdata_rw(); for (size_type nn = 0; nn < n; ++nn) p[nn] = ch; setLength(n); return *this; } basic_string& basic_string::append(const cxxtools::Char* str, size_type n) { size_type l = length(); privreserve(l + n); traits_type::copy(privdata_rw() + l, str, n); setLength(l + n); return *this; } basic_string& basic_string::append(size_type n, cxxtools::Char ch) { size_type l = length(); privreserve(l + n); cxxtools::Char* p = privdata_rw(); for (size_type nn = 0; nn < n; ++nn) p[l + nn] = ch; setLength(l + n); return *this; } basic_string& basic_string::insert(size_type pos, const cxxtools::Char* str, size_type n) { size_type l = length(); privreserve(l + n); cxxtools::Char* p = privdata_rw(); traits_type::move(p + pos + n, p + pos, l - pos); traits_type::copy(p + pos, str, n); setLength(l + n); return *this; } basic_string& basic_string::insert(size_type pos, size_type n, cxxtools::Char ch) { size_type l = length(); privreserve(l + n); cxxtools::Char* p = privdata_rw(); traits_type::move(p + pos + n, p + pos, l - pos); for (size_type nn = 0; nn < n; ++nn) p[pos + nn] = ch; setLength(l + n); return *this; } basic_string& basic_string::erase(size_type pos, size_type n) { cxxtools::Char* p = privdata_rw(); size_type l = length(); if (n == npos || pos + n > l) n = l - pos; traits_type::move(p + pos, p + pos + n, l - pos - n); setLength(l - n); return *this; } basic_string& basic_string::replace(size_type pos, size_type n, const cxxtools::Char* str, size_type n2) { cxxtools::Char* p; if (n != n2) { size_type l = length(); privreserve(l - n + n2); p = privdata_rw(); traits_type::move(p + pos + n2, p + pos + n, l - pos - n); setLength(l - n + n2); } else { p = privdata_rw(); } traits_type::copy(p + pos, str, n2); return *this; } basic_string& basic_string::replace(size_type pos, size_type n, size_type n2, cxxtools::Char ch) { cxxtools::Char* p; if (n != n2) { size_type l = length(); privreserve(l - n + n2); p = privdata_rw(); traits_type::move(p + pos + n2, p + pos + n, l - pos - n); setLength(l - n + n2); } else { p = privdata_rw(); } for (size_type nn = 0; nn < n2; ++nn) p[pos + nn] = ch; return *this; } int basic_string::compare(const basic_string& str) const { const size_type size = this->size(); const size_type osize = str.size(); size_type n = min(size , osize); const int result = traits_type::compare(privdata_ro(), str.privdata_ro(), n); // unlike real life, size only matters when the quality is equal if (result == 0) { return static_cast(size - osize); } return result; } int basic_string::compare(const char* str) const { size_type size = length(); size_type n; const cxxtools::Char* p = privdata_ro(); for (n = 0; n < size && str[n]; ++n) { cxxtools::Char ch(str[n]); if (p[n] != ch) return p[n] > ch ? 1 : -1; } return n < size ? 1 : str[n] ? -1 : 0; } int basic_string::compare(const char* str, size_type len) const { size_type size = length(); size_type n; const cxxtools::Char* p = privdata_ro(); for (n = 0; n < size && n < len; ++n) { cxxtools::Char ch(str[n]); if (p[n] != ch) return p[n] > ch ? 1 : -1; } return n < size ? 1 : n < len ? -1 : 0; } int basic_string::compare(const cxxtools::Char* str, size_type osize) const { const size_type size = this->size(); size_type n = min(size , osize); const int result = traits_type::compare(privdata_ro(), str, n); // unlike real life, size only matters when the quality is equal if (result == 0) { return size > osize ? 1 : size < osize ? -1 : 0; } return result; } int basic_string::compare(const wchar_t* str) const { const cxxtools::Char* self = privdata_ro(); size_type size = this->size(); size_type n; for (n = 0; n < size && str[n] != L'\0'; ++n) { if ( self[n] != str[n] ) return traits_type::lt(self[n], cxxtools::Char(str[n])) ? -1 : 1; } return n < size ? 1 : str[n] != L'\0' ? -1 : 0; } int basic_string::compare(const wchar_t* str, size_type n) const { const cxxtools::Char* self = privdata_ro(); size_type nn; size_type size = this->size(); for (nn = 0; nn < size && nn < n; ++nn) { if (self[nn] != str[nn]) return traits_type::lt(self[nn], cxxtools::Char(str[nn])) ? -1 : 1; } return size < n ? -1 : 0; } int basic_string::compare(size_type pos, size_type n, const cxxtools::Char* str, size_type n2) const { const size_type size = n; const size_type osize = n2; size_type len = min(size , osize); const int result = traits_type::compare(privdata_ro() + pos, str, len); // unlike real life, size only matters when the quality is equal if (result == 0) { return size < osize ? -1 : size > osize ? 1 : 0; } return result; } basic_string::size_type basic_string::find(const cxxtools::Char* token, size_type pos, size_type n) const { const size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); for( ; pos + n <= size; ++pos) { if( 0 == traits_type::compare( str + pos, token, n ) ) { return pos; } } return npos; } basic_string::size_type basic_string::find(cxxtools::Char ch, size_type pos) const { const size_type size = this->size(); if(pos > size) { return npos; } const cxxtools::Char* str = privdata_ro(); const size_type n = size - pos; const cxxtools::Char* found = traits_type::find(str + pos, n, ch); if(found) { return found - str; } return npos; } basic_string::size_type basic_string::rfind(const cxxtools::Char* token, size_type pos, size_type n) const { // FIXME: check length const size_type size = this->size(); if (n > size) { return npos; } pos = min(size_type(size - n), pos); const cxxtools::Char* str = privdata_ro(); do { if (traits_type::compare(str + pos, token, n) == 0) return pos; } while (pos-- > 0); return npos; } basic_string::size_type basic_string::rfind(cxxtools::Char ch, size_type pos) const { const cxxtools::Char* str = privdata_ro(); size_type size = this->size(); if(size == 0) return npos; if(--size > pos) size = pos; for(++size; size-- > 0; ) { if( traits_type::eq(str[size], ch) ) return size; } return npos; } basic_string::size_type basic_string::find_first_of(const cxxtools::Char* s, size_type pos, size_type n) const { // check length os s against n const cxxtools::Char* str = privdata_ro(); const size_type size = this->size(); for (; n && pos < size; ++pos) { if( traits_type::find(s, n, str[pos]) ) return pos; } return npos; } basic_string::size_type basic_string::find_last_of(const cxxtools::Char* s, size_type pos, size_type n) const { // check length os s against n size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); if (size == 0 || n == 0) { return npos; } if (--size > pos) { size = pos; } do { if( traits_type::find(s, n, str[size]) ) return size; } while (size-- != 0); return npos; } basic_string::size_type basic_string::find_first_not_of(const cxxtools::Char* tok, size_type pos, size_type n) const { const cxxtools::Char* str = privdata_ro(); for (; pos < this->size(); ++pos) { if ( !traits_type::find(tok, n, str[pos]) ) return pos; } return npos; } basic_string::size_type basic_string::find_first_not_of(const cxxtools::Char ch, size_type pos) const { const cxxtools::Char* str = privdata_ro(); for (; pos < this->size(); ++pos) { if ( !traits_type::eq(str[pos], ch) ) { return pos; } } return npos; } basic_string::size_type basic_string::find_last_not_of(const cxxtools::Char* tok, size_type pos, size_type n) const { size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); if(size) { if (--size > pos) size = pos; do { if ( !traits_type::find(tok, n, str[size]) ) { return size; } } while(size--); } return npos; } basic_string::size_type basic_string::find_last_not_of(cxxtools::Char ch, size_type pos) const { size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); if (size) { if (--size > pos) size = pos; do { if( !traits_type::eq(str[size], ch) ) { return size; } } while (size--); } return npos; } std::string basic_string::narrow(char dfault) const { std::string ret; size_type len = this->length(); const cxxtools::Char* s = privdata_ro(); ret.reserve(len); for (size_type n = 0; n < len; ++n) ret.append( 1, s[n].narrow(dfault) ); return ret; } basic_string basic_string::widen(const char* str) { std::basic_string ret; size_type len = std::char_traits::length(str); ret.privreserve(len); for (size_type n = 0; n < len; ++n) ret += cxxtools::Char( str[n] ); return ret; } basic_string basic_string::widen(const std::string& str) { std::basic_string ret; size_type len = str.length(); ret.privreserve(len); for (size_type n = 0; n < len; ++n) ret += cxxtools::Char( str[n] ); return ret; } ostream& operator<< (ostream& out, const basic_string& str) { cxxtools::Utf8Codec codec; char to[64]; cxxtools::MBState state; cxxtools::Utf8Codec::result r; const cxxtools::Char* from = str.data(); cxxtools::String::size_type size = str.size(); do{ const cxxtools::Char* from_next; char* to_next = to; r = codec.out(state, from, from + size, from_next, to, to + sizeof(to), to_next); if (r == cxxtools::Utf8Codec::error) { out.setstate(std::ios::failbit); break; } out.write(to, to_next - to); size -= (from_next - from); from = from_next; } while (out.good() && r == cxxtools::Utf8Codec::partial); return out; } } cxxtools-3.0/src/dateutils.h0000664000175000017500000000447513644433072013140 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DATEUTILS_H #define CXXTOOLS_DATEUTILS_H #include namespace cxxtools { extern const char* weekdaynames[7]; extern const char* monthnames[12]; void skipNonDigit(std::string::const_iterator& b, std::string::const_iterator e); void skipWord(std::string::const_iterator& b, std::string::const_iterator e); unsigned getUnsigned(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits); unsigned getUnsignedF(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits); unsigned getInt(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits); unsigned getMicroseconds(std::string::const_iterator& b, std::string::const_iterator e, unsigned digits); void appendDn(std::string& s, unsigned short n, unsigned v); void appendDn(std::string& s, unsigned short n, int v); unsigned getMonthFromName(std::string::const_iterator& b, std::string::const_iterator e); } #endif // CXXTOOLS_DATEUTILS_H cxxtools-3.0/src/inideserializer.cpp0000664000175000017500000001065013644433072014647 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { namespace { struct CodecReleaser { TextCodec* _codec; CodecReleaser(TextCodec* codec) : _codec(codec) { } ~CodecReleaser() { if (_codec->refs() == 0) delete _codec; } private: CodecReleaser(const CodecReleaser&) { } void operator=(const CodecReleaser&) { } }; class Ev : public IniParser::Event { public: explicit Ev(SerializationInfo& si) : _si(si), _section(&_si) { } private: SerializationInfo& _si; SerializationInfo* _section; String _key; virtual bool onSection(const String& section); virtual bool onKey(const String& key); virtual bool onValue(const String& key); virtual bool onError(); }; bool Ev::onSection(const String& section) { _section = &_si.addMember(Utf8Codec::encode(section)); return false; } bool Ev::onKey(const String& key) { _key = key; return false; } bool Ev::onValue(const String& value) { _section->addMember(Utf8Codec::encode(_key)) <<= value; return false; } bool Ev::onError() { SerializationError::doThrow("ini deserialization failed"); return true; } } IniDeserializer::IniDeserializer(std::istream& in, TextCodec* codec) { Ev ev(si()); IniParser parser(ev); CodecReleaser r(codec); char ibuf; Char obuf; const char* fromBegin = &ibuf; const char* fromEnd = (&ibuf) + 1; const char* fromNext = fromEnd; Char* toBegin = &obuf; Char* toEnd = (&obuf) + 1; Char* toNext = &obuf; MBState mbstate; begin(); while (true) { if (fromNext > fromBegin) { if (!in.get(ibuf)) break; fromNext = fromBegin; } if (fromNext < fromEnd || toNext < toEnd) { std::codecvt_base::result r = codec->in(mbstate, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); if (r == std::codecvt_base::error) { in.setstate(std::ios::failbit); return; } } if (toNext > toBegin) { int ret = parser.parse(obuf); if (ret == -1) in.putback(ibuf); if (ret != 0) break; toNext = &obuf; } } if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("ini deserialization failed"); parser.end(); } IniDeserializer::IniDeserializer(std::basic_istream& in) { Ev ev(si()); IniParser parser(ev); begin(); Char ch; int ret; while (in.get(ch)) { ret = parser.parse(ch); if (ret == -1) in.putback(ch); if (ret != 0) break; } if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("ini deserialization failed"); parser.end(); } } cxxtools-3.0/src/ioerror.cpp0000664000175000017500000000435313644433072013151 00000000000000/* * Copyright (C) 2004 Marc Boris Duerner * Copyright (C) 2005 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/ioerror.h" #include namespace cxxtools { IOError::IOError(const std::string& what) : std::ios::failure(what) { } IOTimeout::IOTimeout() : IOError("Timeout") { } AccessFailed::AccessFailed(const std::string& resource) : IOError("could not access " + resource) { } PermissionDenied::PermissionDenied(const std::string& resource) : AccessFailed(resource) { } DeviceNotFound::DeviceNotFound(const std::string& device) : AccessFailed(device) {} FileNotFound::FileNotFound(const std::string& path) : AccessFailed(path) {} DirectoryNotFound::DirectoryNotFound(const std::string& path) : AccessFailed(path) { } IOPending::IOPending(const std::string& what) : IOError(what) { } DeviceClosed::DeviceClosed(const std::string& what) : IOError(what) { } DeviceClosed::DeviceClosed(const char* msg) : IOError(msg) { } } // namespace cxxtools cxxtools-3.0/src/unit/0000775000175000017500000000000013672344760012024 500000000000000cxxtools-3.0/src/unit/Makefile.in0000664000175000017500000005577313644433103014017 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/unit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_unit_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_libcxxtools_unit_la_OBJECTS = application.lo assertion.lo \ jsonreporter.lo reporter.lo testcase.lo testcontext.lo test.lo \ testprotocol.lo testsuite.lo libcxxtools_unit_la_OBJECTS = $(am_libcxxtools_unit_la_OBJECTS) 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 = libcxxtools_unit_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcxxtools_unit_la_LDFLAGS) \ $(LDFLAGS) -o $@ 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/application.Plo \ ./$(DEPDIR)/assertion.Plo ./$(DEPDIR)/jsonreporter.Plo \ ./$(DEPDIR)/reporter.Plo ./$(DEPDIR)/test.Plo \ ./$(DEPDIR)/testcase.Plo ./$(DEPDIR)/testcontext.Plo \ ./$(DEPDIR)/testprotocol.Plo ./$(DEPDIR)/testsuite.Plo am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(libcxxtools_unit_la_SOURCES) DIST_SOURCES = $(libcxxtools_unit_la_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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-unit.la libcxxtools_unit_la_SOURCES = \ application.cpp \ assertion.cpp \ jsonreporter.cpp \ reporter.cpp \ testcase.cpp \ testcontext.cpp \ test.cpp \ testprotocol.cpp \ testsuite.cpp libcxxtools_unit_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_unit_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/unit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/unit/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-unit.la: $(libcxxtools_unit_la_OBJECTS) $(libcxxtools_unit_la_DEPENDENCIES) $(EXTRA_libcxxtools_unit_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcxxtools_unit_la_LINK) -rpath $(libdir) $(libcxxtools_unit_la_OBJECTS) $(libcxxtools_unit_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/application.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assertion.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonreporter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reporter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcase.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcontext.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testprotocol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsuite.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/application.Plo -rm -f ./$(DEPDIR)/assertion.Plo -rm -f ./$(DEPDIR)/jsonreporter.Plo -rm -f ./$(DEPDIR)/reporter.Plo -rm -f ./$(DEPDIR)/test.Plo -rm -f ./$(DEPDIR)/testcase.Plo -rm -f ./$(DEPDIR)/testcontext.Plo -rm -f ./$(DEPDIR)/testprotocol.Plo -rm -f ./$(DEPDIR)/testsuite.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/application.Plo -rm -f ./$(DEPDIR)/assertion.Plo -rm -f ./$(DEPDIR)/jsonreporter.Plo -rm -f ./$(DEPDIR)/reporter.Plo -rm -f ./$(DEPDIR)/test.Plo -rm -f ./$(DEPDIR)/testcase.Plo -rm -f ./$(DEPDIR)/testcontext.Plo -rm -f ./$(DEPDIR)/testprotocol.Plo -rm -f ./$(DEPDIR)/testsuite.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES 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 uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/src/unit/application.cpp0000664000175000017500000001262013644433072014746 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { namespace unit { class SuccessCounter : public Reporter { public: SuccessCounter() : _success(0), _skipped(0), _errors(0) {} unsigned success() const { return _success; } unsigned skipped() const { return _skipped; } unsigned errors() const { return _errors; } virtual void reportStart(const TestContext& /*test*/) { _successCurrent = true; _skipCurrent = false; } virtual void reportFinish(const TestContext& /*test*/) { if (_skipCurrent) ++_skipped; else if (_successCurrent) ++_success; else ++_errors; } virtual void reportSkip(const TestContext& /*test*/) { _skipCurrent = true; } virtual void reportAssertion(const TestContext& /*test*/, const Assertion& /*a*/) { _successCurrent = false; } virtual void reportException(const TestContext& /*test*/, const std::exception& /*ex*/) { _successCurrent = false; } virtual void reportError(const TestContext& /*test*/) { _successCurrent = false; } private: bool _successCurrent; bool _skipCurrent; unsigned _success; unsigned _skipped; unsigned _errors; }; Application* Application::_app = 0; Application::Application() : Test(""), _success(0), _skipped(0), _errors(0) { _app = this; std::list::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { (*it)->setParent( this ); } } Application::~Application() { std::list::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { (*it)->setParent( 0 ); } } Application& Application::instance() { if( ! _app ) throw std::logic_error("application not initialized"); return *_app; } Test* Application::findTest(const std::string& testname) { std::list::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { if( (*it)->name() == testname) return *it; } return 0; } void Application::attachReporter(Reporter& r) { Test::attachReporter(r); } void Application::attachReporter(Reporter& r, const std::string& testname) { Test* test = this->findTest(testname); if( ! test ) return; test->attachReporter(r); } void Application::run(const std::string& testName) { SuccessCounter ec; this->attachReporter(ec); std::list::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { if(testName == "" || (*it)->name() == testName) (*it)->run(); } this->detachReporter(ec); _success += ec.success(); _skipped += ec.skipped(); _errors += ec.errors(); } void Application::run() { SuccessCounter ec; this->attachReporter(ec); std::list::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { (*it)->run(); } this->detachReporter(ec); _success = ec.success(); _skipped = ec.skipped(); _errors = ec.errors(); } void Application::staticRegisterTest(Test& test) { for (std::list::iterator it = Application::tests().begin(); it != Application::tests().end(); ++it) { if ((*it)->name() > test.name()) { Application::tests().insert(it, &test); return; } } Application::tests().push_back(&test); } void Application::registerTest(Test& test) { test.setParent(this); staticRegisterTest(test); } void Application::deregisterTest(Test& test) { Application::tests().remove(&test); test.setParent(0); } std::list& Application::tests() { static std::list _allTests; return _allTests; } } // namespace unit } // namespace cxxtools cxxtools-3.0/src/unit/Makefile.am0000664000175000017500000000070213644433072013771 00000000000000AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-unit.la libcxxtools_unit_la_SOURCES = \ application.cpp \ assertion.cpp \ jsonreporter.cpp \ reporter.cpp \ testcase.cpp \ testcontext.cpp \ test.cpp \ testprotocol.cpp \ testsuite.cpp libcxxtools_unit_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_unit_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ cxxtools-3.0/src/unit/jsonreporter.cpp0000664000175000017500000000576313644433072015211 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace unit { void JsonReporter::reportStart(const cxxtools::unit::TestContext& test) { current = &si.addMember(test.testName()); } void JsonReporter::reportFinish(const cxxtools::unit::TestContext& /*test*/) { } void JsonReporter::reportMessage(const std::string& msg) { current->addMember("message") <<= msg; } void JsonReporter::reportSuccess(const cxxtools::unit::TestContext& /*test*/) { current->addMember("success") <<= true; } void JsonReporter::reportAssertion(const cxxtools::unit::TestContext& /*test*/, const cxxtools::unit::Assertion& a) { current->addMember("success") <<= false; current->addMember("assertion") <<= true; current->addMember("exception") <<= false; current->addMember("file") <<= a.sourceInfo().file(); current->addMember("line") <<= a.sourceInfo().line(); current->addMember("message") <<= a.what(); } void JsonReporter::reportException(const cxxtools::unit::TestContext& /*test*/, const std::exception& ex) { current->addMember("success") <<= false; current->addMember("exception") <<= true; current->addMember("message") <<= ex.what(); } void JsonReporter::reportError(const cxxtools::unit::TestContext& /*test*/) { current->addMember("success") <<= false; current->addMember("error") <<= true; } void JsonReporter::reportSkip(const cxxtools::unit::TestContext& /*test*/) { current->addMember("success") <<= false; current->addMember("skip") <<= true; } void operator <<= (cxxtools::SerializationInfo& si, const JsonReporter& result) { si.setTypeName("JsonReporter"); si = result.si; } } } cxxtools-3.0/src/unit/testprotocol.cpp0000664000175000017500000000310413644433072015201 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testprotocol.h" #include "cxxtools/unit/testsuite.h" namespace cxxtools { namespace unit { void TestProtocol::run(TestSuite& suite) { suite.runAll(); } } // namespace Unit } // namespace cxxtools cxxtools-3.0/src/unit/reporter.cpp0000664000175000017500000000502413644433072014305 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/reporter.h" #include namespace cxxtools { namespace unit { BriefReporter::BriefReporter(std::ostream* out) : _out(out) { } BriefReporter::~BriefReporter() { } void BriefReporter::setOutput(std::ostream& out) { _out = &out; } void BriefReporter::reportStart(const TestContext& test) { *_out << test.testName() << ": "; } void BriefReporter::reportFinish(const TestContext&) { } void BriefReporter::reportMessage(const std::string& msg) { *_out << msg << std::endl; } void BriefReporter::reportSuccess(const TestContext&) { *_out << "OK" << std::endl; } void BriefReporter::reportAssertion(const TestContext&, const Assertion& a) { *_out << "ASSERTION at " << a.sourceInfo().file() << ":" << a.sourceInfo().line() << std::endl; *_out << '\t' << a.what() << std::endl; } void BriefReporter::reportException(const TestContext&, const std::exception& ex) { *_out << "EXCEPTION" << std::endl; *_out << '\t' << ex.what() << std::endl; } void BriefReporter::reportError(const TestContext&) { *_out << "ERROR" << std::endl; } void BriefReporter::reportSkip(const TestContext&) { *_out << "SKIP" << std::endl; } } } cxxtools-3.0/src/unit/assertion.cpp0000664000175000017500000000317513644433072014457 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace unit { Assertion::Assertion(const std::string& what, const SourceInfo& si) : _sourceInfo(si) , _what(what) { } const SourceInfo& Assertion::sourceInfo() const { return _sourceInfo; } } } cxxtools-3.0/src/unit/testcase.cpp0000664000175000017500000000323413644433072014257 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testcase.h" #include "cxxtools/unit/testcontext.h" namespace cxxtools { namespace unit { TestCase::TestCase(const std::string& name) : Test(name) { } void TestCase::run() { Context ctx(*this, *this); ctx.run(); } void TestCase::setUp() { } void TestCase::tearDown() { } } } cxxtools-3.0/src/unit/testcontext.cpp0000664000175000017500000000477013644433072015036 00000000000000/* * Copyright (C) 2005-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/test.h" #include "cxxtools/unit/testcontext.h" #include "cxxtools/unit/testfixture.h" #include "cxxtools/log.h" log_define("cxxtools.unit.testcontext") namespace cxxtools { namespace unit { TestContext::TestContext(TestFixture& fixture, Test& test ) : _fixture(fixture) , _test(test) , _setUp(false) { } TestContext::~TestContext() { try { if( _setUp ) _fixture.tearDown(); } catch(...) {} try { _test.reportFinish(*this); } catch(...) {} } std::string TestContext::testName() const { return _test.name(); } void TestContext::run() { try { log_debug("run test " << _test.name()); _test.reportStart(*this); _fixture.setUp(); _setUp = true; this->exec(); _test.reportSuccess(*this); } catch(const Assertion& assertion) { _test.reportAssertion(*this, assertion); } catch(const Skip& skip) { _test.reportSkip(*this); } catch(const std::exception& ex) { _test.reportException(*this, ex); } catch(...) { _test.reportError(*this); } } } } cxxtools-3.0/src/unit/test.cpp0000664000175000017500000000761513644433072013432 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { namespace unit { const std::string& Test::name() const { return _name; } void Test::reportStart(const TestContext& ctx) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportStart(ctx); } if(_parent) _parent->reportStart(ctx); } void Test::reportFinish(const TestContext& ctx) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportFinish(ctx); } if(_parent) _parent->reportFinish(ctx); } void Test::reportSuccess(const TestContext& ctx) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportSuccess(ctx); } if(_parent) _parent->reportSuccess(ctx); } void Test::reportSkip(const TestContext& ctx) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportSkip(ctx); } if(_parent) _parent->reportSkip(ctx); } void Test::reportAssertion(const TestContext& ctx, const Assertion& ass) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportAssertion(ctx, ass); } if(_parent) _parent->reportAssertion(ctx, ass); } void Test::reportException(const TestContext& ctx, const std::exception& ex) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportException(ctx, ex); } if(_parent) _parent->reportException(ctx, ex); } void Test::reportError(const TestContext& ctx) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportError(ctx); } if(_parent) _parent->reportError(ctx); } void Test::reportMessage(const std::string& msg) { std::list::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportMessage(msg); } if(_parent) _parent->reportMessage(msg); } void Test::setParent(Test* test) { _parent = test; } Test* Test::parent() { return _parent; } const Test* Test::parent() const { return _parent; } void Test::attachReporter(Reporter& r) { connect(r.destroyed, *this, &Test::detachReporter); _reporter.push_back(&r); } void Test::detachReporter(Reporter& r) { _reporter.remove(&r); } } } cxxtools-3.0/src/unit/testsuite.cpp0000664000175000017500000000575613644433072014510 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/testcontext.h" namespace cxxtools { namespace unit { TestProtocol TestSuite::defaultProtocol; TestSuite::TestSuite(const std::string& name, TestProtocol& protocol) : Test(name) , _protocol(&protocol) { } TestSuite::~TestSuite() { Tests::iterator it; for(it = _tests.begin(); it != _tests.end(); ++it) { delete it->second; } } void TestSuite::setParameter(const std::string&, const SerializationInfo&) { } void TestSuite::setProtocol(TestProtocol* protocol) { _protocol = protocol; } void TestSuite::setUp() { } void TestSuite::tearDown() { } void TestSuite::run() { _protocol->run(*this); } void TestSuite::runTest( const std::string& name, const SerializationInfo* si, size_t argCount ) { TestMethod* test = this->findTest(name); if(!test) throw std::runtime_error("No such test"); Context ctx(*this, *test, si, argCount); ctx.run(); } void TestSuite::runAll() { const SerializationInfo* si = 0; Tests::iterator it; for(it = _tests.begin(); it != _tests.end(); ++it) { TestMethod* test = it->second; Context ctx(*this, *test, si, 0); ctx.run(); } } TestMethod* TestSuite::findTest(const std::string& name) { Tests::iterator it; for (it = _tests.begin(); it != _tests.end() && it->first != name; ++it) ; if( it== _tests.end() ) return 0; return it->second; } void TestSuite::registerTest(TestMethod* test) { test->setParent(this); Tests::value_type p( test->name(), test ); _tests.push_back( p ); } } // namespace unit } // namespace cxxtools cxxtools-3.0/src/json/0000775000175000017500000000000013672344760012016 500000000000000cxxtools-3.0/src/json/httpresponder.h0000664000175000017500000000371313644433072015006 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_HTTPRESPONDER_H #define CXXTOOLS_JSON_HTTPRESPONDER_H #include #include "responder.h" namespace cxxtools { namespace json { class HttpService; class HttpResponder : public http::Responder { public: explicit HttpResponder(HttpService& service); ~HttpResponder(); void beginRequest(net::TcpSocket& socket, std::istream& in, http::Request& request); std::size_t readBody(std::istream& is); void reply(std::ostream& os, http::Request& request, http::Reply& reply); private: json::Responder _responder; }; } } #endif cxxtools-3.0/src/json/Makefile.in0000664000175000017500000005777013644433103014010 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/json ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_json_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la am_libcxxtools_json_la_OBJECTS = httpclient.lo httpclientimpl.lo \ httpresponder.lo httpservice.lo rpcclient.lo rpcclientimpl.lo \ responder.lo rpcserver.lo rpcserverimpl.lo scanner.lo \ socket.lo worker.lo libcxxtools_json_la_OBJECTS = $(am_libcxxtools_json_la_OBJECTS) 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 = libcxxtools_json_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcxxtools_json_la_LDFLAGS) \ $(LDFLAGS) -o $@ 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/httpclient.Plo \ ./$(DEPDIR)/httpclientimpl.Plo ./$(DEPDIR)/httpresponder.Plo \ ./$(DEPDIR)/httpservice.Plo ./$(DEPDIR)/responder.Plo \ ./$(DEPDIR)/rpcclient.Plo ./$(DEPDIR)/rpcclientimpl.Plo \ ./$(DEPDIR)/rpcserver.Plo ./$(DEPDIR)/rpcserverimpl.Plo \ ./$(DEPDIR)/scanner.Plo ./$(DEPDIR)/socket.Plo \ ./$(DEPDIR)/worker.Plo am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(libcxxtools_json_la_SOURCES) DIST_SOURCES = $(libcxxtools_json_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-json.la noinst_HEADERS = \ httpclientimpl.h \ httpresponder.h \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_json_la_SOURCES = \ httpclient.cpp \ httpclientimpl.cpp \ httpresponder.cpp \ httpservice.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ responder.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ socket.cpp \ worker.cpp libcxxtools_json_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_json_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/json/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/json/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-json.la: $(libcxxtools_json_la_OBJECTS) $(libcxxtools_json_la_DEPENDENCIES) $(EXTRA_libcxxtools_json_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcxxtools_json_la_LINK) -rpath $(libdir) $(libcxxtools_json_la_OBJECTS) $(libcxxtools_json_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclient.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclientimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpresponder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpservice.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclient.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclientimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserverimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/httpclient.Plo -rm -f ./$(DEPDIR)/httpclientimpl.Plo -rm -f ./$(DEPDIR)/httpresponder.Plo -rm -f ./$(DEPDIR)/httpservice.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/rpcclient.Plo -rm -f ./$(DEPDIR)/rpcclientimpl.Plo -rm -f ./$(DEPDIR)/rpcserver.Plo -rm -f ./$(DEPDIR)/rpcserverimpl.Plo -rm -f ./$(DEPDIR)/scanner.Plo -rm -f ./$(DEPDIR)/socket.Plo -rm -f ./$(DEPDIR)/worker.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/httpclient.Plo -rm -f ./$(DEPDIR)/httpclientimpl.Plo -rm -f ./$(DEPDIR)/httpresponder.Plo -rm -f ./$(DEPDIR)/httpservice.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/rpcclient.Plo -rm -f ./$(DEPDIR)/rpcclientimpl.Plo -rm -f ./$(DEPDIR)/rpcserver.Plo -rm -f ./$(DEPDIR)/rpcserverimpl.Plo -rm -f ./$(DEPDIR)/scanner.Plo -rm -f ./$(DEPDIR)/socket.Plo -rm -f ./$(DEPDIR)/worker.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES 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 uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/src/json/scanner.cpp0000664000175000017500000000474613644433072014100 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "scanner.h" #include #include #include #include #include log_define("cxxtools.json.scanner") namespace cxxtools { namespace json { void Scanner::begin(JsonDeserializer& handler, IComposer& composer) { _deserializer = &handler; _deserializer->begin(); _composer = &composer; } void Scanner::finalizeReply() { const SerializationInfo* s = _deserializer->si().findMember("error"); if (s && !s->isNull()) { log_debug("remote error detected category=" << s->category() << " type=" << s->typeName()); std::string msg; if (s->category() == SerializationInfo::Object) { int rc = 0; s->getMember("code", rc); s->getMember("message", msg); throw RemoteException(msg, rc); } else { s->getValue(msg); if (msg.empty()) msg = "remote exception"; throw RemoteException(msg); } } _composer->fixup( _deserializer->si().getMember("result")); } } } cxxtools-3.0/src/json/httpclient.cpp0000664000175000017500000001274313644433072014621 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/json/httpclient.h" #include "cxxtools/net/uri.h" #include "cxxtools/net/addrinfo.h" #include "httpclientimpl.h" #include namespace cxxtools { namespace json { HttpClientImpl* HttpClient::getImpl() { if (_impl == 0) { _impl = new HttpClientImpl(); _impl->addRef(); } return _impl; } HttpClient::HttpClient(const HttpClient& other) : _impl(other._impl) { if (_impl) _impl->addRef(); } HttpClient& HttpClient::operator= (const HttpClient& other) { if (_impl == other._impl) return *this; if (_impl && _impl->release() <= 0) delete _impl; _impl = other._impl; if (_impl) _impl->addRef(); return *this; } HttpClient::~HttpClient() { if (_impl && _impl->release() <= 0) delete _impl; } void HttpClient::prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, bool ssl) { getImpl()->prepareConnect(addrinfo, url, ssl); } void HttpClient::prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, const std::string& sslCertificate) { getImpl()->prepareConnect(addrinfo, url, sslCertificate); } void HttpClient::prepareConnect(const std::string& host, unsigned short int port, const std::string& url, bool ssl) { prepareConnect(net::AddrInfo(host, port), url, ssl); } void HttpClient::prepareConnect(const std::string& host, unsigned short int port, const std::string& url, const std::string& sslCertificate) { prepareConnect(net::AddrInfo(host, port), url, sslCertificate); } void HttpClient::prepareConnect(const net::Uri& uri) { #ifdef WITH_SSL if (uri.protocol() != "http" && uri.protocol() != "https") throw std::runtime_error("only protocols \"http\" and \"https\" are supported by http json rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.protocol() == "https", uri.path()); #else if (uri.protocol() != "http") throw std::runtime_error("only protocol \"http\" is supported by http json rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.path()); #endif } void HttpClient::prepareConnect(const net::Uri& uri, const std::string& sslCertificate) { #ifdef WITH_SSL if (uri.protocol() != "http" && uri.protocol() != "https") throw std::runtime_error("only protocols http and https are supported by http json client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.path(), sslCertificate); #else if (uri.protocol() != "http") throw std::runtime_error("only protocol \"http\" is supported by json http client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.path()); #endif } void HttpClient::connect() { getImpl()->connect(); } void HttpClient::url(const std::string& url) { getImpl()->url(url); } void HttpClient::auth(const std::string& username, const std::string& password) { getImpl()->auth(username, password); } void HttpClient::clearAuth() { getImpl()->clearAuth(); } void HttpClient::setSelector(SelectorBase* selector) { getImpl()->setSelector(selector); } void HttpClient::setSslVerify(int level, const std::string& ca) { getImpl()->setSslVerify(level, ca); } void HttpClient::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void HttpClient::endCall() { _impl->endCall(); } void HttpClient::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } Milliseconds HttpClient::timeout() const { return getImpl()->timeout(); } void HttpClient::timeout(Milliseconds t) { getImpl()->timeout(t); } Milliseconds HttpClient::connectTimeout() const { return getImpl()->connectTimeout(); } void HttpClient::connectTimeout(Milliseconds t) { getImpl()->connectTimeout(t); } const std::string& HttpClient::url() const { return getImpl()->url(); } const IRemoteProcedure* HttpClient::activeProcedure() const { return _impl == 0 ? 0 : _impl->activeProcedure(); } void HttpClient::cancel() { if (_impl) _impl->cancel(); } void HttpClient::wait(Milliseconds msecs) { _impl->wait(msecs); } } } cxxtools-3.0/src/json/rpcserverimpl.cpp0000664000175000017500000002164313644433072015337 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcserverimpl.h" #include "socket.h" #include "worker.h" #include #include #include log_define("cxxtools.json.rpcserver.impl") namespace cxxtools { namespace json { // Sent from the worker thread when a socket is idle. // The server will take that socket to the event loop. class IdleSocketEvent : public BasicEvent { Socket* _socket; public: explicit IdleSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; // Sent from the server when constructed, so that the server // knows, when the event loop is running. class ServerStartEvent : public BasicEvent { const RpcServerImpl* _server; public: explicit ServerStartEvent(const RpcServerImpl* server) : _server(server) { } const RpcServerImpl* server() const { return _server; } }; // Sent from a worker, when a job was fetched from the queue and // no further threads are left for subsequent jobs. class NoWaitingThreadsEvent : public BasicEvent { }; // Sent from the worker, when he decidid to stop, because there are // enough idle threads waiting on the queue already. class ThreadTerminatedEvent : public BasicEvent { Worker* _worker; public: explicit ThreadTerminatedEvent(Worker* worker) : _worker(worker) { } Worker* worker() const { return _worker; } }; RpcServerImpl::RpcServerImpl(EventLoopBase& eventLoop, Signal& runmodeChanged, ServiceRegistry& serviceRegistry) : _runmode(RpcServer::Stopped), _runmodeChanged(runmodeChanged), _eventLoop(eventLoop), inputSlot(slot(*this, &RpcServerImpl::onInput)), _serviceRegistry(serviceRegistry), _minThreads(5), _maxThreads(200) { _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onIdleSocket)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onNoWaitingThreads)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onThreadTerminated)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onServerStart)); connect(_eventLoop.exited, *this, &RpcServerImpl::terminate); _eventLoop.commitEvent(ServerStartEvent(this)); } RpcServerImpl::~RpcServerImpl() { if (runmode() == RpcServer::Running) { try { terminate(); } catch (const std::exception& e) { log_fatal("failed to terminate rpc server: " << e.what()); } } } void RpcServerImpl::listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) { log_info("listen on " << ip << " port " << port); net::TcpServer* listener = new net::TcpServer(ip, port, 64, net::TcpServer::DEFER_ACCEPT|net::TcpServer::REUSEADDR); try { _listener.push_back(listener); _queue.put(new Socket(*this, *listener, certificateFile, privateKeyFile, sslVerifyLevel, sslCa)); } catch (...) { delete listener; throw; } } void RpcServerImpl::start() { log_trace("start server"); runmode(RpcServer::Starting); MutexLock lock(_threadMutex); while (_threads.size() < minThreads()) { Worker* worker = new Worker(*this); _threads.insert(worker); worker->start(); } runmode(RpcServer::Running); } void RpcServerImpl::terminate() { _eventLoop.processEvents(); MutexLock lock(_threadMutex); runmode(RpcServer::Terminating); try { for (unsigned n = 0; n < _listener.size(); ++n) _listener[n]->terminateAccept(); _queue.put(0); while (!_threads.empty() || !_terminatedThreads.empty()) { if (!_threads.empty()) { _threadTerminated.wait(lock); } for (Threads::iterator it = _terminatedThreads.begin(); it != _terminatedThreads.end(); ++it) delete *it; _terminatedThreads.clear(); } for (unsigned n = 0; n < _listener.size(); ++n) delete _listener[n]; _listener.clear(); while (!_queue.empty()) delete _queue.get(); for (IdleSocket::iterator it = _idleSocket.begin(); it != _idleSocket.end(); ++it) delete *it; _idleSocket.clear(); runmode(RpcServer::Stopped); } catch (const std::exception& e) { runmode(RpcServer::Failed); } } void RpcServerImpl::noWaitingThreads() { if (runmode() == RpcServer::Running) _eventLoop.commitEvent(NoWaitingThreadsEvent()); } void RpcServerImpl::threadTerminated(Worker* worker) { MutexLock lock(_threadMutex); _threads.erase(worker); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(ThreadTerminatedEvent(worker)); } else { _terminatedThreads.insert(worker); _threadTerminated.signal(); } } void RpcServerImpl::addIdleSocket(Socket* socket) { log_debug("add idle socket " << static_cast(socket)); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(IdleSocketEvent(socket)); } else { log_debug("server not running; delete " << static_cast(socket)); delete socket; } } void RpcServerImpl::onIdleSocket(const IdleSocketEvent& event) { Socket* socket = event.socket(); log_debug("add idle socket " << static_cast(socket) << " to selector"); _idleSocket.insert(socket); socket->setSelector(&_eventLoop); socket->inputConnection = connect(socket->inputReady, inputSlot); } void RpcServerImpl::onNoWaitingThreads(const NoWaitingThreadsEvent& /*event*/) { MutexLock lock(_threadMutex); if (_threads.size() >= maxThreads()) { log_warn("thread limit " << maxThreads() << " reached"); return; } try { Worker* worker = new Worker(*this); try { log_debug("create thread " << static_cast(worker) << "; running threads=" << _threads.size()); worker->start(); _threads.insert(worker); log_debug(_threads.size() << " threads running"); } catch (const std::exception&) { delete worker; throw; } } catch (const std::exception& e) { log_warn("failed to create thread: " << e.what()); } } void RpcServerImpl::onThreadTerminated(const ThreadTerminatedEvent& event) { MutexLock lock(_threadMutex); log_debug("thread terminated (" << static_cast(event.worker()) << ") " << _threads.size() << " threads left"); try { event.worker()->join(); } catch (const std::exception& e) { log_error("failed to join thread: " << e.what()); } delete event.worker(); } void RpcServerImpl::onServerStart(const ServerStartEvent& event) { if (event.server() == this) { start(); } } void RpcServerImpl::onInput(Socket& socket) { socket.removeSelector(); log_debug("search socket " << static_cast(&socket) << " in idle socket"); _idleSocket.erase(&socket); if (socket.isConnected()) { socket.inputConnection.close(); _queue.put(&socket); } else { log_debug("onInput; delete " << static_cast(&socket)); log_info("client " << socket.getPeerAddr() << " closed connection"); delete &socket; } } } } cxxtools-3.0/src/json/httpservice.cpp0000664000175000017500000000427313644433072015002 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/json/httpservice.h" #include "cxxtools/http/request.h" #include "httpresponder.h" #include "cxxtools/log.h" #include log_define("cxxtools.json.httpservice") namespace cxxtools { namespace json { HttpService::~HttpService() { } http::Responder* HttpService::createResponder(const http::Request& request) { const char* contentType = request.header().getHeader("Content-Type"); if (contentType != 0) { if (::strncasecmp(contentType, "application/json", 16) == 0 || ::strncasecmp(contentType, "application/x-www-form-urlencoded", 33) == 0) return new HttpResponder(*this); log_warn("invalid content type " << contentType); } else log_warn("missing content type"); return 0; } void HttpService::releaseResponder(http::Responder* resp) { delete resp; } } } cxxtools-3.0/src/json/Makefile.am0000664000175000017500000000127613644433072013772 00000000000000AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-json.la noinst_HEADERS = \ httpclientimpl.h \ httpresponder.h \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_json_la_SOURCES = \ httpclient.cpp \ httpclientimpl.cpp \ httpresponder.cpp \ httpservice.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ responder.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ socket.cpp \ worker.cpp libcxxtools_json_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_json_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ cxxtools-3.0/src/json/socket.h0000664000175000017500000000556613644433072013405 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_SOCKET_H #define CXXTOOLS_JSON_SOCKET_H #include #include #include #include #include #include "responder.h" namespace cxxtools { namespace json { class RpcServerImpl; class Socket : public net::TcpSocket, public Connectable { public: Socket(RpcServerImpl& rpcServerImpl, net::TcpServer& tcpServer, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa); explicit Socket(Socket& socket); void accept(); void postAccept(); bool hasAccepted() const { return _accepted; } void setSelector(SelectorBase* s); void removeSelector(); void onIODeviceInput(IODevice& iodevice); void onInput(StreamBuffer& sb); bool onOutput(StreamBuffer& sb); bool onAcceptSslCertificate(const SslCertificate& cert); Signal inputReady; StreamBuffer& buffer() { return _stream.buffer(); } MethodSlot inputSlot; Connection inputConnection; Connection timeoutConnection; private: RpcServerImpl& _rpcServerImpl; net::TcpServer& _tcpServer; std::string _certificateFile; std::string _privateKeyFile; Responder _responder; IOStream _stream; int _sslVerifyLevel; std::string _sslCa; bool _accepted; }; } } #endif // CXXTOOLS_JSON_SOCKET_H cxxtools-3.0/src/json/httpclientimpl.h0000664000175000017500000001136013644433072015142 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_HTTPCLIENTIMPL_H #define CXXTOOLS_JSON_HTTPCLIENTIMPL_H #include #include #include #include #include #include #include #include #include #include "scanner.h" namespace cxxtools { class IRemoteProcedure; class IComposer; class IDecomposer; namespace net { class AddrInfo; } namespace json { class HttpClientImpl : public RefCounted, public Connectable { public: HttpClientImpl(); void prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, bool ssl) { _client.prepareConnect(addrinfo, ssl); _request.url(url); } void prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, const std::string& sslCertificate) { _client.prepareConnect(addrinfo, sslCertificate); _request.url(url); } void connect() { _client.connect(); } void url(const std::string& url) { _request.url(url); } void auth(const std::string& username, const std::string& password) { _client.auth(username, password); } void clearAuth() { _client.clearAuth(); } void setSelector(SelectorBase* selector) { _client.setSelector(selector); } void setSslVerify(int level, const std::string& ca) { _client.setSslVerify(level, ca); } const std::string& url() const { return _request.url(); } void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Timespan timeout() const { return _timeout; } void timeout(Timespan t) { _timeout = t; if (!_connectTimeoutSet) _connectTimeout = t; } Timespan connectTimeout() const { return _connectTimeout; } void connectTimeout(Timespan t) { _connectTimeout = t; _connectTimeoutSet = true; } const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(Timespan msecs); private: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void onReplyHeader(http::Client& client); std::size_t onReplyBody(http::Client& client); void onReplyFinished(http::Client& client); static void verifyHeader(const http::ReplyHeader& header); // connection Timespan _timeout; bool _connectTimeoutSet; Timespan _connectTimeout; http::Client _client; http::Request _request; // serialization Scanner _scanner; JsonDeserializer _deserializer; // current processing IRemoteProcedure* _proc; bool _exceptionPending; Formatter::int_type _count; }; } } #endif cxxtools-3.0/src/json/rpcclient.cpp0000664000175000017500000001250713644433072014424 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "rpcclientimpl.h" #include "config.h" namespace cxxtools { namespace json { RpcClientImpl* RpcClient::getImpl() { if (_impl == 0) { _impl = new RpcClientImpl(); _impl->addRef(); } return _impl; } RpcClient::RpcClient(const RpcClient& other) : _impl(other._impl) { if (_impl) _impl->addRef(); } RpcClient& RpcClient::operator= (const RpcClient& other) { if (_impl == other._impl) return *this; if (_impl && _impl->release() <= 0) delete _impl; _impl = other._impl; if (_impl) _impl->addRef(); return *this; } RpcClient::~RpcClient() { if (_impl && _impl->release() <= 0) delete _impl; } void RpcClient::prepareConnect(const net::AddrInfo& addrinfo, bool ssl) { getImpl()->prepareConnect(addrinfo, std::string()); getImpl()->ssl(ssl); } void RpcClient::prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { getImpl()->prepareConnect(addrinfo, sslCertificate); } void RpcClient::prepareConnect(const std::string& host, unsigned short int port, bool ssl) { prepareConnect(net::AddrInfo(host, port), ssl); } void RpcClient::prepareConnect(const std::string& host, unsigned short int port, const std::string& sslCertificate) { prepareConnect(net::AddrInfo(host, port), sslCertificate); } void RpcClient::prepareConnect(const net::Uri& uri) { #ifdef WITH_SSL if (uri.protocol() != "json" && uri.protocol() != "jsons") throw std::runtime_error("only protocols \"json\" and \"jsons\" are supported by json rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.protocol() == "jsons"); #else if (uri.protocol() != "json") throw std::runtime_error("only protocol \"json\" is supported by json rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port())); #endif } void RpcClient::prepareConnect(const net::Uri& uri, const std::string& sslCertificate) { #ifdef WITH_SSL if (uri.protocol() != "json" && uri.protocol() != "jsons") throw std::runtime_error("only protocols \"json\" and \"jsons\" are supported by json rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), sslCertificate); #else if (uri.protocol() != "json") throw std::runtime_error("only protocol \"json\" is supported by json rpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port())); #endif } void RpcClient::connect() { getImpl()->connect(); } void RpcClient::close() { if (_impl) _impl->close(); } void RpcClient::setSelector(SelectorBase* selector) { getImpl()->setSelector(selector); } void RpcClient::setSslVerify(int level, const std::string& ca) { _impl->setSslVerify(level, ca); } void RpcClient::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void RpcClient::endCall() { _impl->endCall(); } void RpcClient::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } Milliseconds RpcClient::timeout() const { return getImpl()->timeout(); } void RpcClient::timeout(Milliseconds t) { getImpl()->timeout(t); } Milliseconds RpcClient::connectTimeout() const { return getImpl()->connectTimeout(); } void RpcClient::connectTimeout(Milliseconds t) { getImpl()->connectTimeout(t); } const IRemoteProcedure* RpcClient::activeProcedure() const { return _impl == 0 ? 0 : _impl->activeProcedure(); } void RpcClient::cancel() { if (_impl) _impl->cancel(); } void RpcClient::wait(Milliseconds msecs) { _impl->wait(msecs); } const std::string& RpcClient::prefix() const { return getImpl()->prefix(); } void RpcClient::prefix(const std::string& p) { getImpl()->prefix(p); } Delegate& RpcClient::acceptSslCertificate() { return getImpl()->socket().acceptSslCertificate; } } } cxxtools-3.0/src/json/socket.cpp0000664000175000017500000001223713644433072013731 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "socket.h" #include "rpcserverimpl.h" #include log_define("cxxtools.json.socket") namespace cxxtools { namespace json { Socket::Socket(RpcServerImpl& rpcServerImpl, net::TcpServer& tcpServer, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) : inputSlot(slot(*this, &Socket::onInput)), _rpcServerImpl(rpcServerImpl), _tcpServer(tcpServer), _certificateFile(certificateFile), _privateKeyFile(privateKeyFile), _responder(rpcServerImpl._serviceRegistry), _sslVerifyLevel(sslVerifyLevel), _sslCa(sslCa), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(acceptSslCertificate, *this, &Socket::onAcceptSslCertificate); _responder.begin(); } Socket::Socket(Socket& socket) : net::TcpSocket(), Connectable(*this), inputSlot(slot(*this, &Socket::onInput)), _rpcServerImpl(socket._rpcServerImpl), _tcpServer(socket._tcpServer), _certificateFile(socket._certificateFile), _privateKeyFile(socket._privateKeyFile), _responder(_rpcServerImpl._serviceRegistry), _sslVerifyLevel(socket._sslVerifyLevel), _sslCa(socket._sslCa), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(acceptSslCertificate, *this, &Socket::onAcceptSslCertificate); _responder.begin(); } void Socket::accept() { log_debug("accept"); net::TcpSocket::accept(_tcpServer); if (!_certificateFile.empty()) { loadSslCertificateFile(_certificateFile, _privateKeyFile); setSslVerify(_sslVerifyLevel, _sslCa); beginSslAccept(); } } void Socket::postAccept() { log_trace("post accept"); if (!_certificateFile.empty()) { cxxtools::Timespan t = getTimeout(); setTimeout(cxxtools::Seconds(10)); endSslAccept(); setTimeout(t); } _accepted = true; _stream.buffer().beginRead(); log_debug("accepted"); } void Socket::setSelector(SelectorBase* s) { s->add(*this); } void Socket::removeSelector() { TcpSocket::setSelector(0); } void Socket::onIODeviceInput(IODevice& /*iodevice*/) { log_debug("onIODeviceInput"); inputReady(*this); } void Socket::onInput(StreamBuffer& sb) { log_debug("onInput"); sb.endRead(); if (sb.in_avail() == 0 || sb.device()->eof()) { close(); return; } while (sb.in_avail() > 0) { if (_responder.advance(sb.sbumpc())) { _responder.finalize(_stream); buffer().beginWrite(); onOutput(sb); return; } } sb.beginRead(); } bool Socket::onOutput(StreamBuffer& sb) { log_trace("onOutput"); log_debug("send data to " << getPeerAddr()); try { sb.endWrite(); if ( sb.out_avail() ) { sb.beginWrite(); } else if (_responder.failed()) { close(); return false; } else { _responder.begin(); if (sb.in_avail()) onInput(sb); else buffer().beginRead(); } } catch (const std::exception& e) { log_warn("exception occured when processing request: " << e.what()); close(); return false; } return true; } bool Socket::onAcceptSslCertificate(const SslCertificate& cert) { return !_rpcServerImpl.acceptSslCertificate.isConnected() || _rpcServerImpl.acceptSslCertificate(cert); } } } cxxtools-3.0/src/json/httpclientimpl.cpp0000664000175000017500000001661213644433072015502 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "httpclientimpl.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/jsonformatter.h" #include "cxxtools/http/replyheader.h" #include "cxxtools/selectable.h" #include "cxxtools/ioerror.h" #include "cxxtools/clock.h" #include "cxxtools/log.h" #include #include log_define("cxxtools.json.httpclient.impl") namespace cxxtools { namespace json { HttpClientImpl::HttpClientImpl() : _timeout(Selectable::WaitInfinite), _connectTimeoutSet(false), _connectTimeout(Selectable::WaitInfinite), _proc(0), _exceptionPending(false), _count(0) { _request.method("POST"); cxxtools::connect(_client.headerReceived, *this, &HttpClientImpl::onReplyHeader); cxxtools::connect(_client.bodyAvailable, *this, &HttpClientImpl::onReplyBody); cxxtools::connect(_client.replyFinished, *this, &HttpClientImpl::onReplyFinished); } void HttpClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_client.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); if (_proc) throw std::logic_error("asyncronous request already running"); _proc = &method; prepareRequest(method.name(), argv, argc); try { _client.beginExecute(_request); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } _scanner.begin(_deserializer, r); } void HttpClientImpl::endCall() { log_debug("end call; errorPending=" << _exceptionPending); if (_exceptionPending) { _exceptionPending = false; throw; } _client.endExecute(); } void HttpClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _proc = &method; prepareRequest(method.name(), argv, argc); _client.execute(_request, timeout(), connectTimeout()); _scanner.begin(_deserializer, r); char ch; std::istream& is = _client.in(); while (is.get(ch)) { if (_deserializer.advance(ch) != 0) { log_debug("scanner finished"); _proc = 0; _scanner.finalizeReply(); return; } } throw std::runtime_error("unexpected end of data"); } const IRemoteProcedure* HttpClientImpl::activeProcedure() const { return _proc; } void HttpClientImpl::cancel() { _client.cancel(); _proc = 0; } // private members void HttpClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { _request.clear(); _request.setHeader("Content-Type", "application/json"); _request.method("POST"); JsonFormatter formatter; formatter.begin(_request.body()); formatter.beginObject(std::string(), std::string()); formatter.addValueStdString("jsonrpc", std::string(), "2.0"); formatter.addValueString("method", std::string(), name); formatter.addValueInt("id", "int", ++_count); formatter.beginArray("params", std::string()); for(unsigned n = 0; n < argc; ++n) { argv[n]->format(formatter); } formatter.finishArray(); formatter.finishObject(); formatter.finish(); } void HttpClientImpl::onReplyHeader(http::Client& client) { verifyHeader(client.header()); } std::size_t HttpClientImpl::onReplyBody(http::Client& client) { std::size_t count = 0; char ch; std::istream& is = client.in(); while (is.rdbuf()->in_avail() && is.get(ch)) { ++count; if (_deserializer.advance(ch)) { log_debug("scanner finished"); try { _scanner.finalizeReply(); } catch (const RemoteException& e) { _proc->setFault(e.rc(), e.text()); } catch (const std::exception&) { log_warn("exception occured in finalizeReply"); _exceptionPending = true; _proc->onFinished(); } break; } } log_debug("no more data - " << count << " bytes consumed"); return count; } void HttpClientImpl::onReplyFinished(http::Client& /*client*/) { log_debug("onReplyFinished; method=" << static_cast(_proc)); try { _exceptionPending = false; endCall(); } catch (const std::exception& e) { if (!_proc) throw; _exceptionPending = true; IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); if (_exceptionPending) { _exceptionPending = false; throw; } return; } IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); } void HttpClientImpl::wait(Timespan timeout) { if (!_client.selector()) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (timeout >= Timespan(0)) clock.start(); Timespan remaining = timeout; while (activeProcedure() != 0) { if (_client.selector()->wait(remaining) == false) throw IOTimeout(); if (timeout >= Timespan(0)) { remaining = timeout - clock.stop(); if (remaining < Timespan(0)) remaining = Timespan(0); } } } void HttpClientImpl::verifyHeader(const http::ReplyHeader& header) { if (header.httpReturnCode() != 200) { std::ostringstream msg; msg << "invalid http return code " << header.httpReturnCode() << ": " << header.httpReturnText(); throw std::runtime_error(msg.str()); } const char* contentType = header.getHeader("Content-Type"); if (contentType == 0) throw std::runtime_error("missing content type header"); if (::strncasecmp(contentType, "application/json", 16) != 0) { std::ostringstream msg; msg << "invalid content type " << contentType; throw std::runtime_error(msg.str()); } } } } cxxtools-3.0/src/json/worker.h0000664000175000017500000000345113644433072013415 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_WORKER_H #define CXXTOOLS_JSON_WORKER_H #include namespace cxxtools { namespace json { class RpcServerImpl; class Worker : public AttachedThread { public: explicit Worker(RpcServerImpl& server) : AttachedThread(callable(*this, &Worker::run)), _server(server) { } private: void run(); RpcServerImpl& _server; }; } } #endif // CXXTOOLS_JSON_WORKER_H cxxtools-3.0/src/json/rpcserver.cpp0000664000175000017500000000515113644433072014451 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "rpcserverimpl.h" namespace cxxtools { namespace json { RpcServerImpl* RpcServer::newImpl(EventLoopBase& eventLoop) { return new RpcServerImpl(eventLoop, runmodeChanged, *this); } RpcServer::~RpcServer() { delete _impl; } void RpcServer::listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) { _impl->listen(ip, port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } void RpcServer::addService(const std::string& prefix, const ServiceRegistry& service) { std::vector procs = service.getProcedureNames(); for (std::vector::const_iterator it = procs.begin(); it != procs.end(); ++it) { registerProcedure(prefix + *it, service.getProcedure(*it)); } } unsigned RpcServer::minThreads() const { return _impl->minThreads(); } void RpcServer::minThreads(unsigned m) { _impl->minThreads(m); } unsigned RpcServer::maxThreads() const { return _impl->maxThreads(); } void RpcServer::maxThreads(unsigned m) { _impl->maxThreads(m); } Delegate& RpcServer::acceptSslCertificate() { return _impl->acceptSslCertificate; } } } cxxtools-3.0/src/json/rpcclientimpl.h0000664000175000017500000001102213644433072014742 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCCLIENTIMPL_H #define CXXTOOLS_JSON_RPCCLIENTIMPL_H #include #include #include #include #include #include #include #include #include #include #include "scanner.h" namespace cxxtools { class IRemoteProcedure; class IComposer; class IDecomposer; namespace json { class RpcClientImpl : public RefCounted, public Connectable { RpcClientImpl(RpcClientImpl&); void operator= (const RpcClientImpl&); public: RpcClientImpl(); net::TcpSocket& socket() { return _socket; } void setSelector(SelectorBase* selector) { _socket.setSelector(selector); } void prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { _addrInfo = addrinfo; _socket.close(); _sslCertificate = sslCertificate; _ssl = !sslCertificate.empty(); } void ssl(bool sw) { _ssl = sw; } void connect(); void close(); void setSslVerify(int level, const std::string& ca) { _sslVerifyLevel = level; _sslCa = ca; } void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Timespan timeout() const { return _timeout; } void timeout(Timespan t) { _timeout = t; if (!_connectTimeoutSet) _connectTimeout = t; } Timespan connectTimeout() const { return _connectTimeout; } void connectTimeout(Timespan t) { _connectTimeout = t; _connectTimeoutSet = true; } const IRemoteProcedure* activeProcedure() const { return _proc; } void cancel(); void wait(Timespan msecs); const std::string& prefix() const { return _prefix; } void prefix(const std::string& p) { _prefix = p; } private: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void onConnect(net::TcpSocket& socket); void onSslConnect(net::TcpSocket& socket); void onOutput(StreamBuffer& sb); void onInput(StreamBuffer& sb); // connection state net::TcpSocket _socket; IOStream _stream; net::AddrInfo _addrInfo; bool _ssl; std::string _sslCertificate; int _sslVerifyLevel; std::string _sslCa; std::string _prefix; // serialization Scanner _scanner; JsonDeserializer _deserializer; // current processing bool _exceptionPending; IRemoteProcedure* _proc; Formatter::int_type _count; Timespan _timeout; bool _connectTimeoutSet; // indicates if connectTimeout is explicitely set // when not, it follows the setting of _timeout Timespan _connectTimeout; }; } } #endif // CXXTOOLS_JSON_RPCCLIENTIMPL_H cxxtools-3.0/src/json/worker.cpp0000664000175000017500000001113613644433072013747 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "worker.h" #include "rpcserverimpl.h" #include #include #include "socket.h" log_define("cxxtools.json.worker") namespace cxxtools { namespace json { void Worker::run() { log_info("new thread running"); while (!_server.isTerminating() && _server._queue.numWaiting() < _server.minThreads()) { Socket* socket = _server._queue.get(); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } if (_server._queue.numWaiting() == 0) _server.noWaitingThreads(); try { if (!socket->hasAccepted()) { try { // do blocking accept socket->accept(); log_debug("connection accepted from " << socket->getPeerAddr()); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } // new connection arrived - create new accept socket log_info("new connection accepted from " << socket->getPeerAddr()); _server._queue.put(new Socket(*socket)); socket->postAccept(); } catch (const std::exception&) { _server._queue.put(new Socket(*socket)); throw; } } else if (socket->isConnected()) { log_debug("process available input from " << socket->getPeerAddr()); socket->onInput(socket->buffer()); } else { log_debug("socket is not connected any more; delete " << static_cast(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; continue; } Connection inputConnection = connect(socket->buffer().inputReady, socket->inputSlot); while (socket->wait(10) && socket->isConnected()) ; if (socket->isConnected()) { log_debug("timeout processing socket"); inputConnection.close(); _server.addIdleSocket(socket); } else if (_server.isTerminating()) { _server._queue.put(socket); } else { log_debug("socket is not connected any more; delete " << static_cast(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; } } catch (const net::AcceptTerminated&) { delete socket; } catch (const std::exception& e) { log_warn("error occured in device: " << e.what() << "; delete " << static_cast(socket)); delete socket; } } log_info("thread terminated"); _server.threadTerminated(this); } } } cxxtools-3.0/src/json/scanner.h0000664000175000017500000000414513644433072013536 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_SCANNER_H #define CXXTOOLS_JSON_SCANNER_H #include #include #include namespace cxxtools { class JsonDeserializer; class IComposer; namespace json { class Scanner { public: Scanner() : _deserializer(0), _composer(0) { } void begin(JsonDeserializer& handler, IComposer& composer); JsonDeserializer* deserializer() { return _deserializer; } void finalizeReply(); private: JsonDeserializer* _deserializer; IComposer* _composer; }; } } #endif // CXXTOOLS_JSON_SCANNER_H cxxtools-3.0/src/json/httpresponder.cpp0000664000175000017500000000446713644433072015350 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "httpresponder.h" #include #include #include log_define("cxxtools.json.httpresponder") namespace cxxtools { namespace json { HttpResponder::HttpResponder(HttpService& service) : Responder(service), _responder(service) { } HttpResponder::~HttpResponder() { } void HttpResponder::beginRequest(net::TcpSocket& /*socket*/, std::istream& /*in*/, http::Request& /*request*/) { log_debug("begin request"); _responder.begin(); } std::size_t HttpResponder::readBody(std::istream& is) { log_debug("begin request"); std::size_t n = 0; char ch; while (is.get(ch)) { ++n; if (_responder.advance(ch)) break; } log_debug(n << " bytes processed"); return n; } void HttpResponder::reply(std::ostream& os, http::Request& /*request*/, http::Reply& reply) { reply.setHeader("Content-Type", "application/json"); _responder.finalize(os); } } } cxxtools-3.0/src/json/responder.h0000664000175000017500000000470013644433072014103 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RESPONDER_H #define CXXTOOLS_JSON_RESPONDER_H #include #include #include #include #include namespace cxxtools { class ServiceRegistry; namespace json { class Socket; class Responder { friend class Socket; public: static const int ParseError = -32700; static const int InvalidRequest = -32600; static const int MethodNotFound = -32601; static const int InvalidParams = -32602; static const int InternalError = -32603; static const int ApplicationError = -32500; explicit Responder(ServiceRegistry& serviceRegistry); ~Responder(); void begin(); bool advance(char ch); void finalize(std::ostream& out); bool failed() const { return _failed; } private: ServiceRegistry& _serviceRegistry; JsonDeserializer _deserializer; bool _failed; int _errorCode; std::string _errorMessage; }; } } #endif // CXXTOOLS_JSON_RESPONDER_H cxxtools-3.0/src/json/rpcclientimpl.cpp0000664000175000017500000002401713644433072015305 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcclientimpl.h" #include #include #include #include #include #include log_define("cxxtools.json.rpcclient.impl") namespace cxxtools { namespace json { RpcClientImpl::RpcClientImpl() : _stream(_socket, 8192, true), _ssl(false), _sslVerifyLevel(0), _exceptionPending(false), _proc(0), _count(0), _timeout(Selectable::WaitInfinite), _connectTimeoutSet(false), _connectTimeout(Selectable::WaitInfinite) { cxxtools::connect(_socket.connected, *this, &RpcClientImpl::onConnect); cxxtools::connect(_socket.sslConnected, *this, &RpcClientImpl::onSslConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &RpcClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &RpcClientImpl::onInput); } void RpcClientImpl::connect() { _socket.setTimeout(_connectTimeout); _socket.close(); _socket.connect(_addrInfo); if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); _socket.sslConnect(); } } void RpcClientImpl::close() { _socket.close(); } void RpcClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); if (_proc) throw std::logic_error("asyncronous request already running"); _proc = &method; prepareRequest(method.name(), argv, argc); try { if (_socket.isConnected()) { try { _stream.buffer().beginWrite(); } catch (const IOError&) { log_debug("write failed, connection is not active any more"); _socket.beginConnect(_addrInfo); } } else { log_debug("not yet connected - do it now"); _socket.beginConnect(_addrInfo); } } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } _scanner.begin(_deserializer, r); } void RpcClientImpl::endCall() { _proc = 0; if (_exceptionPending) { _exceptionPending = false; throw; } } void RpcClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { try { _proc = &method; StreamBuffer& sb = _stream.buffer(); if (_socket.isConnected()) { log_debug("socket is connected"); try { prepareRequest(_proc->name(), argv, argc); _socket.setTimeout(timeout()); sb.pubsync(); // try to read from socket to check if still connected // sgetc fills the input buffer but do not consume the character int ch = sb.sgetc(); if (ch == StreamBuffer::traits_type::eof()) { log_debug("reading failed"); _socket.close(); } } catch (const std::exception& e) { log_debug("request failed: " << e.what()); _socket.close(); } } if (!_socket.isConnected()) { log_debug("socket is not connected"); _socket.setTimeout(_connectTimeout); _socket.connect(_addrInfo); if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); _socket.sslConnect(); } prepareRequest(_proc->name(), argv, argc); _socket.setTimeout(timeout()); sb.pubsync(); } _scanner.begin(_deserializer, r); while (true) { int ch = sb.sbumpc(); if (ch == StreamBuffer::traits_type::eof()) { cancel(); throw std::runtime_error("reading result failed"); } if (_deserializer.advance(ch)) { _proc = 0; _scanner.finalizeReply(); break; } } } catch (const RemoteException&) { _proc = 0; throw; } catch (const std::exception& e) { cancel(); throw; } } void RpcClientImpl::cancel() { _socket.close(); _stream.clear(); _stream.buffer().discard(); _proc = 0; } void RpcClientImpl::wait(Timespan timeout) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (timeout >= Timespan(0)) clock.start(); Timespan remaining = timeout; while (activeProcedure() != 0) { if (_socket.selector()->wait(remaining) == false) throw IOTimeout(); if (timeout >= Timespan(0)) { remaining = timeout - clock.stop(); if (remaining < Timespan(0)) remaining = Timespan(0); } } } void RpcClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { JsonFormatter formatter; formatter.begin(_stream); formatter.beginObject(std::string(), std::string()); formatter.addValueStdString("jsonrpc", std::string(), "2.0"); formatter.addValueString("method", std::string(), String(_prefix) + name); formatter.addValueInt("id", "int", ++_count); formatter.beginArray("params", std::string()); for(unsigned n = 0; n < argc; ++n) { argv[n]->format(formatter); } formatter.finishArray(); formatter.finishObject(); formatter.finish(); } void RpcClientImpl::onConnect(net::TcpSocket& socket) { try { log_trace("onConnect"); socket.endConnect(); _exceptionPending = false; if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); socket.beginSslConnect(); return; } _stream.buffer().beginWrite(); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onSslConnect(net::TcpSocket& socket) { try { log_trace("onSslConnect"); _exceptionPending = false; socket.endSslConnect(); _stream.buffer().beginWrite(); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onOutput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endWrite(); if (sb.out_avail() > 0) sb.beginWrite(); else sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onInput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endRead(); if (sb.device()->eof()) throw IOError("end of input"); while (_stream.buffer().in_avail()) { char ch = StreamBuffer::traits_type::to_char_type(_stream.buffer().sbumpc()); if (_deserializer.advance(ch)) { _scanner.finalizeReply(); IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); return; } } if (!_stream) { close(); throw std::runtime_error("reading result failed"); } sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } } } cxxtools-3.0/src/json/rpcserverimpl.h0000664000175000017500000001216513644433072015003 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCSERVERIMPL_H #define CXXTOOLS_JSON_RPCSERVERIMPL_H #include #include #include #include #include #include #include #include #include #include namespace cxxtools { class EventLoopBase; class ServiceProcedure; namespace net { class TcpServer; } namespace json { class RpcServerImpl; class Worker; class Socket; class IdleSocketEvent; class ServerStartEvent; class NoWaitingThreadsEvent; class ThreadTerminatedEvent; class ActiveSocketEvent; class RpcServerImpl : public Connectable { #if __cplusplus >= 201103L RpcServerImpl(const RpcServerImpl&) = delete; RpcServerImpl& operator=(const RpcServerImpl&) = delete; #else RpcServerImpl(const RpcServerImpl&); RpcServerImpl& operator=(const RpcServerImpl&); #endif public: RpcServerImpl(EventLoopBase& eventLoop, Signal& runmodeChanged, ServiceRegistry& serviceRegistry); ~RpcServerImpl(); void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa); unsigned minThreads() const { return _minThreads; } void minThreads(unsigned m) { _minThreads = m; } unsigned maxThreads() const { return _maxThreads; } void maxThreads(unsigned m) { _maxThreads = m; } void terminate(); RpcServer::Runmode runmode() const { return _runmode; } Delegate acceptSslCertificate; private: void runmode(RpcServer::Runmode runmode) { _runmode = runmode; _runmodeChanged(runmode); } RpcServer::Runmode _runmode; Signal& _runmodeChanged; EventLoopBase& _eventLoop; void noWaitingThreads(); void onInput(Socket& _socket); void addIdleSocket(Socket* socket); void onIdleSocket(const IdleSocketEvent& event); void onActiveSocket(const ActiveSocketEvent& event); void onNoWaitingThreads(const NoWaitingThreadsEvent& event); void onThreadTerminated(const ThreadTerminatedEvent& event); void onServerStart(const ServerStartEvent& event); void start(); friend class Worker; friend class Socket; //////////////////////////////////////////////////// MethodSlot inputSlot; ServiceRegistry& _serviceRegistry; unsigned _minThreads; unsigned _maxThreads; std::vector _listener; Queue _queue; typedef std::set IdleSocket; IdleSocket _idleSocket; Mutex _threadMutex; Condition _threadTerminated; typedef std::set Threads; Threads _threads; Threads _terminatedThreads; void threadTerminated(Worker* worker); bool isTerminating() const { return runmode() == RpcServer::Terminating; } }; } } #endif // CXXTOOLS_JSON_RPCSERVERIMPL_H cxxtools-3.0/src/json/responder.cpp0000664000175000017500000001300313644433072014432 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "responder.h" #include "rpcserverimpl.h" #include #include #include #include log_define("cxxtools.json.responder") namespace cxxtools { namespace json { const int Responder::ParseError; const int Responder::InvalidRequest; const int Responder::MethodNotFound; const int Responder::InvalidParams; const int Responder::InternalError; Responder::Responder(ServiceRegistry& serviceRegistry) : _serviceRegistry(serviceRegistry), _failed(false) { } Responder::~Responder() { } void Responder::begin() { _deserializer.begin(); _failed = false; } void Responder::finalize(std::ostream& out) { log_trace("finalize"); std::string methodName; ServiceProcedure* proc = 0; JsonFormatter formatter; formatter.begin(out); formatter.beginObject(std::string(), std::string()); formatter.addValueString("jsonrpc", "string", L"2.0"); if (_failed) { formatter.beginObject("error", std::string()); formatter.addValueInt("code", "int", _errorCode); formatter.addValueStdString("error", std::string(), _errorMessage); } else { try { _deserializer.si().getMember("method") >>= methodName; log_debug("method = " << methodName); proc = _serviceRegistry.getProcedure(methodName); if( ! proc ) throw RemoteException("Method \"" + methodName + "\" not found", MethodNotFound); // compose arguments IComposer** args = proc->beginCall(); // process args const SerializationInfo* paramsPtr = _deserializer.si().findMember("params"); // params may be ommited in request SerializationInfo emptyParams; const SerializationInfo& params = paramsPtr ? *paramsPtr : emptyParams; SerializationInfo::ConstIterator it = params.begin(); if (args) { for (int a = 0; args[a]; ++a) { if (it == params.end()) throw RemoteException("missing parameters", InvalidParams); args[a]->fixup(*it); ++it; } } if (it != params.end()) throw RemoteException("too many parameters", InvalidParams); IDecomposer::formatEach(_deserializer.si().getMember("id"), formatter); IDecomposer* result; result = proc->endCall(); formatter.beginValue("result"); result->format(formatter); formatter.finishValue(); } catch (const RemoteException& e) { log_debug("method \"" << methodName << "\" exited with RemoteException: " << e.what()); formatter.beginObject("error", std::string()); formatter.addValueInt("code", "int", static_cast(e.rc())); formatter.addValueStdString("message", std::string(), e.what()); formatter.finishObject(); } catch (const SerializationError& e) { log_debug("serialization error"); formatter.beginObject("error", std::string()); formatter.addValueInt("code", "int", InvalidRequest); formatter.addValueStdString("message", std::string(), e.what()); formatter.finishObject(); } catch (const std::exception& e) { log_debug("method \"" << methodName << "\" exited with exception: " << e.what()); formatter.beginObject("error", std::string()); formatter.addValueInt("code", "int", ApplicationError); formatter.addValueStdString("message", std::string(), e.what()); formatter.finishObject(); } } formatter.finishObject(); if (proc) _serviceRegistry.releaseProcedure(proc); } bool Responder::advance(char ch) { try { return _deserializer.advance(ch) != 0; } catch (const JsonParserError& e) { _failed = true; _errorCode = ParseError; _errorMessage = e.what(); return true; } } } } cxxtools-3.0/src/tcpstream.cpp0000664000175000017500000000475213644433072013475 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { namespace net { void TcpStream::init(cxxtools::Timespan timeout) { _socket.setTimeout(timeout); attachDevice(_socket); cxxtools::connect(_socket.inputReady, *this, &TcpStream::onInput); cxxtools::connect(_socket.outputReady, *this, &TcpStream::onOutput); cxxtools::connect(_socket.connected, *this, &TcpStream::onConnected); cxxtools::connect(_socket.closed, *this, &TcpStream::onClosed); cxxtools::connect(_socket.sslAccepted, *this, &TcpStream::onSslAccepted); cxxtools::connect(_socket.sslConnected, *this, &TcpStream::onSslConnected); cxxtools::connect(_socket.sslClosed, *this, &TcpStream::onSslClosed); } void TcpStream::onInput(IODevice&) { inputReady(*this); } void TcpStream::onOutput(IODevice&) { outputReady(*this); } void TcpStream::onConnected(TcpSocket&) { connected(*this); } void TcpStream::onClosed(TcpSocket&) { closed(*this); } void TcpStream::onSslAccepted(TcpSocket&) { sslAccepted(*this); } void TcpStream::onSslConnected(TcpSocket&) { sslConnected(*this); } void TcpStream::onSslClosed(TcpSocket&) { sslClosed(*this); } } } cxxtools-3.0/src/iodeviceimpl.cpp0000664000175000017500000002475713644433072014153 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "iodeviceimpl.h" #include "cxxtools/ioerror.h" #include "error.h" #include #include #include #include #include #include #include #include #include log_define("cxxtools.iodevice.impl") namespace cxxtools { const short IODeviceImpl::POLLERR_MASK= POLLERR | POLLHUP | POLLNVAL; const short IODeviceImpl::POLLIN_MASK= POLLIN; const short IODeviceImpl::POLLOUT_MASK= POLLOUT; IODeviceImpl::IODeviceImpl(IODevice& device) : _device(device) , _fd(-1) , _timeout(Selectable::WaitInfinite) , _pfd(0) , _sentry(0) , _errorPending(false) { } IODeviceImpl::~IODeviceImpl() { assert(_pfd == 0); if(_sentry) _sentry->detach(); } void IODeviceImpl::open(const std::string& path, IODevice::OpenMode mode, bool inherit) { int flags = O_RDONLY; if( (mode & IODevice::Read ) && (mode & IODevice::Write) ) { flags |= O_RDWR; } else if(mode & IODevice::Write) { flags |= O_WRONLY; } else if(mode & IODevice::Read ) { flags |= O_RDONLY; } if(mode & IODevice::Async) flags |= O_NONBLOCK; if(mode & IODevice::Trunc) flags |= O_TRUNC; flags |= O_NOCTTY; _fd = ::open( path.c_str(), flags ); if(_fd == -1) throw AccessFailed(getErrnoString("open")); if (!inherit) { int flags = fcntl(_fd, F_GETFD); flags |= FD_CLOEXEC ; int ret = fcntl(_fd, F_SETFD, flags); if(-1 == ret) throw IOError(getErrnoString("fcntl(FD_CLOEXEC)")); } } void IODeviceImpl::open(int fd, bool isAsync, bool inherit) { _fd = fd; if (isAsync) { int flags = fcntl(_fd, F_GETFL); if ((flags & O_NONBLOCK) == 0) { flags |= O_NONBLOCK ; int ret = fcntl(_fd, F_SETFL, flags); if(-1 == ret) throw IOError(getErrnoString("fcntl(O_NONBLOCK)")); } } if (!inherit) { int flags = fcntl(_fd, F_GETFD); flags |= FD_CLOEXEC ; int ret = fcntl(_fd, F_SETFD, flags); if(-1 == ret) throw IOError(getErrnoString("fcntl(FD_CLOEXEC)")); } } void IODeviceImpl::close() { log_debug("close device; fd=" << _fd << " pfd=" << _pfd); if (_pfd) _pfd->revents = 0; if(_fd != -1) { int fd = _fd; _fd = -1; _pfd = 0; while ( ::close(fd) != 0 ) { if( errno != EINTR ) { log_error("close of iodevice failed; errno=" << errno); throw IOError(getErrnoString("close")); } } } } size_t IODeviceImpl::beginRead(char* /*buffer*/, size_t /*n*/, bool& /*eof*/) { if(_pfd) { _pfd->events |= POLLIN; } return 0; } size_t IODeviceImpl::endRead(bool& eof) { if(_pfd) { _pfd->events &= ~POLLIN; } checkPendingException(); if (_errorPending) { _errorPending = false; throw IOError("read error"); } return this->read( _device.rbuf(), _device.rbuflen(), eof ); } size_t IODeviceImpl::read( char* buffer, size_t count, bool& eof ) { ssize_t ret = 0; while(true) { ret = ::read( _fd, (void*)buffer, count); int e = errno; if(ret > 0) { log_debug("::read(" << _fd << ", " << count << ") returned " << ret); log_finer(hexDump(buffer, ret)); break; } log_debug("::read(" << _fd << ", " << count << ") returned " << ret << " errno=" << e); if(ret == 0 || e == ECONNRESET) { eof = true; return 0; } if(e == EINTR) continue; if(e != EAGAIN) throw IOError(getErrnoString("read")); pollfd pfd; pfd.fd = this->fd(); pfd.revents = 0; pfd.events = POLLIN; bool ret = this->wait(_timeout, pfd); if(false == ret) { log_debug("timeout (" << _timeout << ')'); throw IOTimeout(); } } return ret; } size_t IODeviceImpl::beginWrite(const char* buffer, size_t n) { log_debug("::write(" << _fd << ", buffer, " << n << ')'); log_finer(hexDump(buffer, n)); try { ssize_t ret = ::write(_fd, (const void*)buffer, n); int e = errno; log_debug("write returned " << ret); if (ret > 0) return static_cast(ret); if (ret == 0 || e == ECONNRESET || e == EPIPE) throw IOError("lost connection to peer"); if (_pfd) _pfd->events |= POLLOUT; } catch (const std::exception&) { _exception = std::current_exception(); } return 0; } size_t IODeviceImpl::endWrite() { if(_pfd) { _pfd->events &= ~POLLOUT; } checkPendingException(); if (_errorPending) { _errorPending = false; throw IOError("write error"); } if (_device.wavail() > 0) { log_debug("write pending " << _device.wavail()); size_t n = _device.wavail(); return n; } return this->write( _device.wbuf(), _device.wbuflen() ); } size_t IODeviceImpl::write( const char* buffer, size_t count ) { ssize_t ret = 0; while(true) { log_debug("::write(" << _fd << ", buffer, " << count << ')'); log_finer(hexDump(buffer, count)); ret = ::write(_fd, (const void*)buffer, count); int e = errno; log_debug("write returned " << ret); if(ret > 0) break; if (ret == 0 || e == ECONNRESET || e == EPIPE) throw IOError("lost connection to peer"); if (e == EINTR) continue; if (e != EAGAIN) throw IOError(getErrnoString("write")); pollfd pfd; pfd.fd = this->fd(); pfd.revents = 0; pfd.events = POLLOUT; if (!this->wait(_timeout, pfd)) { throw IOTimeout(); } } return static_cast(ret); } void IODeviceImpl::sigwrite(int sig) { ::write(_fd, (const void*)&sig, sizeof(sig)); } void IODeviceImpl::cancel() { if(_pfd) { _pfd->events &= ~(POLLIN|POLLOUT); } } void IODeviceImpl::sync() const { } void IODeviceImpl::attach(SelectorBase& /*s*/) { } void IODeviceImpl::detach(SelectorBase& /*s*/) { _pfd = 0; } bool IODeviceImpl::wait(Timespan timeout) { if (_device.wavail() > 0) { _device.outputReady(_device); return true; } pollfd pfd; this->initWait(pfd); this->wait(timeout, pfd); return this->checkPollEvent(pfd); } bool IODeviceImpl::wait(Timespan timeout, pollfd& pfd) { int msecs = timeout < Timespan(0) ? -1 : Milliseconds(timeout) > std::numeric_limits::max() ? std::numeric_limits::max() : int(Milliseconds(timeout).ceil()); log_debug("wait " << msecs << "ms"); int ret = -1; do { ret = ::poll(&pfd, 1, msecs); } while (ret == -1 && errno == EINTR); if (ret == -1) throw IOError(getErrnoString("poll")); return ret > 0; } void IODeviceImpl::initWait(pollfd& pfd) { pfd.fd = this->fd(); pfd.revents = 0; pfd.events = 0; if( _device.reading() ) pfd.events |= POLLIN; if( _device.writing() ) pfd.events |= POLLOUT; } size_t IODeviceImpl::initializePoll(pollfd* pfd, size_t pollSize) { assert(pfd != 0); assert(pollSize >= 1); this->initWait(*pfd); _pfd = pfd; return 1; } bool IODeviceImpl::checkPollEvent() { // _pfd can be 0 if the device is just added during wait iteration if (_pfd == 0) return false; return this->checkPollEvent(*_pfd); } bool IODeviceImpl::checkPollEvent(pollfd& pfd) { log_trace("checkPollEvent " << pfd.revents); bool avail = false; DestructionSentry sentry(_sentry); if( _device.wavail() > 0 || (pfd.revents & POLLOUT_MASK) ) { outputReady(); avail = true; } if( ! _sentry ) return avail; if( pfd.revents & POLLIN_MASK ) { inputReady(); avail = true; } if( ! _sentry ) return avail; if (pfd.revents & POLLERR_MASK) { _errorPending = true; Resetter resetErrorPending(_errorPending, false); bool reading = _device.reading(); bool writing = _device.writing(); if (reading) { avail = true; _device.inputReady(_device); } if( ! _sentry ) return avail; if (writing) { avail = true; _device.outputReady(_device); } if( ! _sentry ) return avail; if (!reading && !writing) { avail = true; _device.close(); } return avail; } return avail; } void IODeviceImpl::inputReady() { log_debug("send signal inputReady"); _device.inputReady(_device); } void IODeviceImpl::outputReady() { log_debug("send signal outputReady"); _device.outputReady(_device); } } cxxtools-3.0/src/time.cpp0000664000175000017500000002353713644433072012433 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/time.h" #include "cxxtools/serializationinfo.h" #include "dateutils.h" #include #include #include namespace cxxtools { static void throwInvalidTime(const std::string& str, std::string::const_iterator p, const std::string& fmt) { throw InvalidTime("string <" + std::string(str.begin(), p) + "(*)" + std::string(p, str.end()) + "> does not match time format <" + fmt + '>'); } InvalidTime::InvalidTime() : std::invalid_argument("Invalid time") { } Time::Time(const std::string& str, const std::string& fmt) : _usecs(0) { unsigned hours = 0; unsigned minutes = 0; unsigned seconds = 0; unsigned useconds = 0; bool am = true; enum { state_0, state_fmt, state_two } state = state_0; std::string::const_iterator dit = str.begin(); try { std::string::const_iterator it; for (it = fmt.begin(); it != fmt.end(); ++it) { char ch = *it; switch (state) { case state_0: if (ch == '%') state = state_fmt; else { if (ch == '*') skipNonDigit(dit, str.end()); else if (ch == '#') skipWord(dit, str.end()); else if (dit == str.end() || (*dit != ch && ch != '?')) throwInvalidTime(str, dit, fmt); else ++dit; } break; case state_fmt: state = state_0; switch (ch) { case 'H': case 'I': hours = getUnsigned(dit, str.end(), 2); break; case 'M': minutes = getUnsigned(dit, str.end(), 2); break; case 'S': seconds = getUnsigned(dit, str.end(), 2); break; case 'j': if (dit != str.end() && *dit == '.') ++dit; useconds = getMicroseconds(dit, str.end(), 6); break; case 'J': case 'U': if (dit != str.end() && *dit == '.') { ++dit; useconds = getMicroseconds(dit, str.end(), 6); } break; case 'K': if (dit != str.end() && *dit == '.') { ++dit; useconds = getMicroseconds(dit, str.end(), 3); } break; case 'k': useconds = getMicroseconds(dit, str.end(), 3); break; case 'u': useconds = getMicroseconds(dit, str.end(), 6); break; case 'p': if (dit == str.end() || dit + 1 == str.end() || ((*dit != 'A' && *dit != 'a' && *dit != 'P' && *dit != 'p') || (*(dit + 1) != 'M' && *(dit + 1) != 'm'))) { throwInvalidTime(str, dit, fmt); } am = (*dit == 'A' || *dit == 'a'); dit += 2; break; case '2': state = state_two; break; default: throw InvalidTime("invalid time format <" + fmt + '>'); } break; case state_two: state = state_0; switch (ch) { case 'H': case 'I': hours = getUnsignedF(dit, str.end(), 2); break; case 'M': minutes = getUnsignedF(dit, str.end(), 2); break; case 'S': seconds = getUnsignedF(dit, str.end(), 2); break; default: throw InvalidTime("invalid time format <" + fmt + '>'); } } } if (it != fmt.end() || dit != str.end()) throwInvalidTime(str, dit, fmt); set(am ? hours : hours + 12, minutes, seconds, 0, useconds); } catch (const std::invalid_argument&) { throwInvalidTime(str, dit, fmt); } } std::string Time::toString(const std::string& fmt) const { unsigned hours, minutes, seconds, mseconds, useconds; get(hours, minutes, seconds, mseconds, useconds); std::string str; enum { state_0, state_fmt, state_one } state = state_0; for (std::string::const_iterator it = fmt.begin(); it != fmt.end(); ++it) { switch (state) { case state_0: if (*it == '%') state = state_fmt; else str += *it; break; case state_fmt: if (*it != '%') state = state_0; switch (*it) { case 'H': appendDn(str, 2, hours); break; case 'I': appendDn(str, 2, hours % 12); break; case 'M': appendDn(str, 2, minutes); break; case 'S': appendDn(str, 2, seconds); break; case 'j': if (useconds != 0) { str += '.'; str += (useconds / 100000 + '0'); useconds %= 100000; for (unsigned e = 10000; e > 0 && useconds > 0; e /= 10) { str += (useconds / e + '0'); useconds %= e; } } break; case 'J': str += '.'; str += (useconds / 100000 + '0'); useconds %= 100000; for (unsigned e = 10000; e > 0 && useconds > 0; e /= 10) { str += (useconds / e + '0'); useconds %= e; } break; case 'k': appendDn(str, 3, mseconds); break; case 'K': str += '.'; appendDn(str, 3, mseconds); break; case 'u': appendDn(str, 6, useconds); break; case 'U': str += '.'; appendDn(str, 6, useconds); break; case 'p': str += (hours < 12 ? "am" : "pm"); break; case 'P': str += (hours < 12 ? "AM" : "PM"); break; case '1': state = state_one; break; default: str += '%'; str += *it; } break; case state_one: state = state_0; switch (*it) { case 'H': appendDn(str, hours < 10 ? 1 : 2, hours); break; case 'I': appendDn(str, hours%12 < 10 ? 1 : 2, hours%12); break; case 'M': appendDn(str, minutes < 10 ? 1 : 2, minutes); break; case 'S': appendDn(str, seconds < 10 ? 1 : 2, seconds); break; default: str += "%1"; str += *it; if (*it == '%') state = state_fmt; break; } break; } } if (state == state_fmt) str += '%'; return str; } Time& Time::operator+=(const Timespan& ts) { double microsecs = _usecs + Microseconds(ts); if (microsecs < 0 || microsecs > USecsPerDay) { std::ostringstream s; s << "cannot add " << Microseconds(ts) << " to " << toString(); throw std::overflow_error(s.str()); } _usecs = static_cast(microsecs); return *this; } Time& Time::operator-=(const Timespan& ts) { double microsecs = _usecs - Microseconds(ts); if (microsecs < 0 || microsecs > USecsPerDay) { std::ostringstream s; s << "cannot subtract " << Microseconds(ts) << " from " << toString(); throw std::overflow_error(s.str()); } _usecs = static_cast(microsecs); return *this; } void operator >>=(const SerializationInfo& si, Time& time) { if (si.category() == cxxtools::SerializationInfo::Object) { unsigned short hour, min, sec, msec; si.getMember("hour") >>= hour; const cxxtools::SerializationInfo* p; if ((p = si.findMember("minute")) != 0) *p >>= min; else si.getMember("min") >>= min; if ((p = si.findMember("second")) != 0) *p >>= sec; else si.getMember("sec") >>= sec; if ((p = si.findMember("millisecond")) != 0 || (p = si.findMember("msec")) != 0) *p >>= msec; else msec = 0; time.set(hour, min, sec, msec); } else { std::string s; si.getValue(s); time = Time(s); } } void operator <<=(SerializationInfo& si, const Time& time) { si.setValue(time.toString()); si.setTypeName("Time"); } } // namespace cxxtools cxxtools-3.0/src/filedevice.cpp0000664000175000017500000000460313644433072013565 00000000000000/* * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "filedeviceimpl.h" namespace cxxtools { FileDevice::FileDevice() { _impl = new FileDeviceImpl(*this); } FileDevice::FileDevice(const std::string& path, IODevice::OpenMode mode, bool inherit) { _impl = new FileDeviceImpl(*this); open(path, mode, inherit); } FileDevice::~FileDevice() { try { close(); } catch(...) { } delete _impl; } void FileDevice::open( const std::string& path, IODevice::OpenMode mode, bool inherit) { close(); _impl->open(path, mode, inherit); _path = path; } size_t FileDevice::size() const { return _impl->size(); } FileDevice::pos_type FileDevice::onSeek(off_type offset, std::ios::seekdir sd) { return _impl->seek(offset, sd); } size_t FileDevice::onPeek(char* buffer, size_t count) { return _impl->peek(buffer, count); } IODeviceImpl& FileDevice::ioimpl() { return *_impl; } SelectableImpl& FileDevice::simpl() { return *_impl; } } // namespace cxxtools cxxtools-3.0/src/envsubst.cpp0000664000175000017500000001527213644433072013343 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include log_define("cxxtools.envsubst") namespace cxxtools { namespace { bool isVarChar(char ch) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_'); } class EnvSubst { // make non copyable EnvSubst(const EnvSubst&); EnvSubst& operator=(const EnvSubst&); std::string& _result; enum { state_0, state_esc, state_varbegin, state_varname, state_bvarname, state_subst0, state_subst, state_nosubst } _state; std::string _varname; EnvSubst* _next; bool isInBracket() const { return _state == state_bvarname || _state == state_subst0 || _state == state_subst || _state == state_nosubst; } public: explicit EnvSubst(std::string& result) : _result(result), _state(state_0), _next(0) { } ~EnvSubst() { delete _next; } void parse(char ch); void parseEnd(); void reset() { _state = state_0; delete _next; _next = 0; } }; void EnvSubst::parse(char ch) { switch (_state) { case state_0: if (ch == '\\') _state = state_esc; else if (ch == '$') _state = state_varbegin; else _result += ch; break; case state_esc: if (ch != '$') _result += '\\'; _result += ch; _state = state_0; break; case state_varbegin: if (isVarChar(ch)) { _varname = ch; _state = state_varname; } else if (ch == '{') { _varname.clear(); _state = state_bvarname; } else { throw EnvSubstSyntaxError( std::string("expected env variable after \'$\', got '").append(1, ch).append(1, '\'')); } break; case state_varname: if (isVarChar(ch)) _varname += ch; else { const char* e = ::getenv(_varname.c_str()); if (e) { log_debug("envvar \"" << _varname << "\": " << e); while (*e) _result += *e++; } else log_debug("envvar \"" << _varname << "\" is not set"); if (ch == '\\') _state = state_esc; else { _result += ch; _state = state_0; } } break; case state_bvarname: if (ch == '}') { const char* e = ::getenv(_varname.c_str()); if (e) { log_debug("envvar \"" << _varname << "\": " << e); while (*e) _result += *e++; } else log_debug("envvar \"" << _varname << "\" is not set"); _state = state_0; } else if (ch == ':') { _state = state_subst0; } else _varname += ch; break; case state_subst0: if (ch == '-') { const char* e = ::getenv(_varname.c_str()); if (e) { log_debug("envvar \"" << _varname << "\": " << e); while (*e) _result += *e++; _state = state_nosubst; } else { log_debug("envvar \"" << _varname << "\" is not set"); _next = new EnvSubst(_result); _state = state_subst; } } else { throw EnvSubstSyntaxError( std::string("invalid substitution operator ").append(1, ch)); } break; case state_subst: if (ch == '}' && !_next->isInBracket()) { _next->parseEnd(); delete _next; _next = 0; _state = state_0; } else _next->parse(ch); break; case state_nosubst: if (ch == '}') _state = state_0; break; } } void EnvSubst::parseEnd() { switch (_state) { case state_0: break; case state_esc: _result += '\\'; _state = state_0; break; case state_varbegin: case state_bvarname: case state_subst0: case state_subst: case state_nosubst: throw EnvSubstSyntaxError("unexpected end"); case state_varname: const char* e = ::getenv(_varname.c_str()); if (e) { log_debug("envvar \"" << _varname << "\": " << e); while (*e) _result += *e++; } else log_debug("envvar \"" << _varname << "\" is not set"); _state = state_0; break; } } } std::string envSubst(const std::string& str) { log_debug("envSubst(\"" << str << "\")"); std::string ret; try { EnvSubst es(ret); for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) es.parse(*it); es.parseEnd(); } catch (const EnvSubstSyntaxError& e) { throw EnvSubstSyntaxError( std::string("failed to parse \"") .append(str) .append("\": ") .append(e.what())); } log_debug("envSubst => \"" << ret << '"'); return ret; } EnvSubstSyntaxError::EnvSubstSyntaxError(const std::string& msg) : std::runtime_error(msg) { } } cxxtools-3.0/src/conditionimpl.cpp0000664000175000017500000000562413644433072014342 00000000000000/* * Copyright (C) 2005 - 2007 by Marc Boris Durrner * Copyright (C) 2005 - 2007 by Sebastian Pieck * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "conditionimpl.h" #include "muteximpl.h" #include "cxxtools/systemerror.h" #include "cxxtools/timespan.h" #include #include #include namespace cxxtools { ConditionImpl::ConditionImpl() { int rc = pthread_cond_init( &_cond, NULL ); if ( rc != 0) throw SystemError( rc, "pthread_cond_init failed"); } ConditionImpl::~ConditionImpl() { pthread_cond_destroy(&_cond); } void ConditionImpl::wait(Mutex& mtx) { int rc = pthread_cond_wait(&_cond, mtx.impl().handle() ); if ( rc != 0) throw SystemError( rc, "pthread_cond_wait failed"); } bool ConditionImpl::wait(Mutex& mtx, const Timespan& ts) { if (ts < Timespan(0)) { wait(mtx); return true; } int result; Timespan tt = Timespan::gettimeofday() + ts; struct timespec tv; tv.tv_sec = tt.totalUSecs() / 1000000; tv.tv_nsec = (tt.totalUSecs() % 1000000) * 1000; do { result = pthread_cond_timedwait(&_cond, mtx.impl().handle(), &tv); } while(result == EINTR); if(result != 0 && result != ETIMEDOUT) throw SystemError( result, "pthread_cond_timedwait failed"); return result != ETIMEDOUT; } void ConditionImpl::signal() { int rc = pthread_cond_signal( &_cond ); if( rc != 0 ) throw SystemError( rc, "pthread_cond_signal failed"); } void ConditionImpl::broadcast() { int rc = pthread_cond_broadcast( &_cond ); if( rc != 0 ) throw SystemError( rc, "pthread_cond_broadcast failed"); } } cxxtools-3.0/src/unicode.h0000664000175000017500000466336513644433072012605 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ const std::ctype_base::mask digit = std::ctype_base::digit; const std::ctype_base::mask xdigit = std::ctype_base::xdigit; const std::ctype_base::mask cntrl = std::ctype_base::cntrl; const std::ctype_base::mask space = std::ctype_base::space; const std::ctype_base::mask upper = std::ctype_base::upper; const std::ctype_base::mask lower = std::ctype_base::lower; const std::ctype_base::mask alpha = std::ctype_base::alpha; const std::ctype_base::mask punct = std::ctype_base::punct; const std::ctype_base::mask print = std::ctype_base::print; const std::ctype_base::mask alnum = std::ctype_base::alnum; const std::ctype_base::mask graph = std::ctype_base::graph; const std::ctype_base::mask ctype_data[13936]= { std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask(0) }; cxxtools-3.0/src/csvdeserializer.cpp0000664000175000017500000000413213644433072014661 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include namespace cxxtools { const Char CsvDeserializer::autoDelimiter = CsvParser::autoDelimiter; void CsvDeserializer::read(std::istream& in, TextCodec* codec) { TextIStream s(in, codec); doDeserialize(s); } void CsvDeserializer::read(std::basic_istream& in) { doDeserialize(in); } void CsvDeserializer::begin() { cxxtools::Deserializer::begin(); _parser.begin(*this); } void CsvDeserializer::doDeserialize(std::basic_istream& in) { begin(); Char ch; while (in.get(ch)) advance(ch); if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("csv deserialization failed"); finish(); } } cxxtools-3.0/src/stddevice.cpp0000664000175000017500000000555413644433072013446 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "iodeviceimpl.h" #include namespace cxxtools { StdinDevice::StdinDevice() { _impl = new IODeviceImpl(*this); setEnabled(true); setAsync(true); setEof(false); _impl->open(STDIN_FILENO, true, true); } StdinDevice::~StdinDevice() { _impl->detach(*selector()); setEnabled(false); delete _impl; } IODeviceImpl& StdinDevice::ioimpl() { return *_impl; } SelectableImpl& StdinDevice::simpl() { return *_impl; } size_t StdinDevice::onBeginWrite(const char* buffer, size_t n) { throw IOError("cannot write to standard input device"); } size_t StdinDevice::onWrite(const char* buffer, size_t count) { throw IOError("cannot write to standard input device"); } ODevice::ODevice() { _impl = new IODeviceImpl(*this); setEnabled(true); setAsync(true); setEof(false); } ODevice::~ODevice() { _impl->detach(*selector()); setEnabled(false); delete _impl; } IODeviceImpl& ODevice::ioimpl() { return *_impl; } SelectableImpl& ODevice::simpl() { return *_impl; } size_t ODevice::onBeginRead(char* buffer, size_t n, bool& eof) { throw IOError("cannot read from standard output device"); } size_t ODevice::onRead(char* buffer, size_t count, bool& eof) { throw IOError("cannot read from standard output device"); } StdoutDevice::StdoutDevice() { ioimpl().open(STDOUT_FILENO, true, true); } StderrDevice::StderrDevice() { ioimpl().open(STDERR_FILENO, true, true); } } // namespace cxxtools cxxtools-3.0/src/cgi.cpp0000664000175000017500000000300013644433072012216 00000000000000/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/cgi.h" #include namespace cxxtools { Cgi::Cgi() { char* q = getenv("QUERY_STRING"); if (q) parse_url(q); parse_url(std::cin); } } cxxtools-3.0/src/log.cpp0000664000175000017500000011463013644433072012251 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dateutils.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include log_define("cxxtools.log") namespace cxxtools { typedef std::atomic atomic_t; namespace { Mutex loggersMutex; Mutex logMutex; Mutex poolMutex; atomic_t mutexWaitCount(0); template class LPool { std::vector pool; Mutex mutex; LPool(const LPool&); LPool& operator=(const LPool&); public: LPool() { } ~LPool() { for (unsigned n = 0; n < pool.size(); ++n) delete pool[n]; } T* getInstance() { if (pool.empty()) { // we don't care about locking here since it is not dangerous to get a false answer return new T(); } T* impl; { MutexLock lock(poolMutex); if (pool.empty()) return new T(); impl = pool.back(); pool.pop_back(); } return impl; } void releaseInstance(T* inst) { MutexLock lock(poolMutex); if (pool.size() < MaxPoolSize) pool.push_back(inst); else delete inst; } }; class ScopedAtomicIncrementer { atomic_t& count; bool decremented; public: explicit ScopedAtomicIncrementer(atomic_t& count_) : count(count_), decremented(false) { ++count; } ~ScopedAtomicIncrementer() { if (!decremented) --count; } unsigned decrement() { decremented = true; return --count; } }; void logentry(std::string& entry, const char* level, const std::string& category) { struct timeval t; gettimeofday(&t, 0); // format date only once per second: static char date[20]; static time_t psec = 0; time_t sec = static_cast(t.tv_sec); if (sec != psec) { struct tm tt; localtime_r(&sec, &tt); int year = 1900 + tt.tm_year; int mon = tt.tm_mon + 1; date[0] = static_cast('0' + year / 1000 % 10); date[1] = static_cast('0' + year / 100 % 10); date[2] = static_cast('0' + year / 10 % 10); date[3] = static_cast('0' + year % 10); date[4] = '-'; date[5] = static_cast('0' + mon / 10); date[6] = static_cast('0' + mon % 10); date[7] = '-'; date[8] = static_cast('0' + tt.tm_mday / 10); date[9] = static_cast('0' + tt.tm_mday % 10); date[10] = ' '; date[11] = static_cast('0' + tt.tm_hour / 10); date[12] = static_cast('0' + tt.tm_hour % 10); date[13] = ':'; date[14] = static_cast('0' + tt.tm_min / 10); date[15] = static_cast('0' + tt.tm_min % 10); date[16] = ':'; date[17] = static_cast('0' + tt.tm_sec / 10); date[18] = static_cast('0' + tt.tm_sec % 10); date[19] = '.'; psec = sec; } entry.append(date, 20); entry += static_cast('0' + t.tv_usec / 100000 % 10); entry += static_cast('0' + t.tv_usec / 10000 % 10); entry += static_cast('0' + t.tv_usec / 1000 % 10); entry += static_cast('0' + t.tv_usec / 100 % 10); entry += static_cast('0' + t.tv_usec / 10 % 10); entry += ' '; entry += '['; char str[64]; char* p = putInt(str, getpid()); entry.append(str, p - str); entry += '.'; p = putInt(str, (unsigned long)pthread_self()); entry.append(str, p - str); entry += "] "; entry += level; entry += ' '; entry += category; entry += " - "; } class LogAppender : public RefCounted { public: virtual ~LogAppender() { } virtual void putMessage(const std::string& msg) = 0; virtual void finish(bool flush) = 0; }; ////////////////////////////////////////////////////////////////////// // FdAppender - writes log to a file descriptor // class FdAppender : public LogAppender { protected: int _fd; std::string _msg; public: explicit FdAppender(int fd) : _fd(fd) { } virtual void putMessage(const std::string& msg); virtual void finish(bool flush); }; void FdAppender::putMessage(const std::string& msg) { _msg += msg; _msg += '\n'; } void FdAppender::finish(bool flush) { if (!flush && _msg.size() < 8192) return; ::write(_fd, _msg.data(), _msg.size()); _msg.clear(); } ////////////////////////////////////////////////////////////////////// // FileAppender // class FileAppender : public FdAppender { std::string _fname; std::string _fpattern; time_t _nextModTime; public: explicit FileAppender(const std::string& fname); virtual void putMessage(const std::string& msg); const std::string& fname() const { return _fname; } void fname(const std::string& f) { if (f != _fname) { closeFile(); _fname = f; } } void closeFile(); void openFile(); }; FileAppender::FileAppender(const std::string& fname) : FdAppender(-1), _fname(fname), _nextModTime(0) { if (_fname.find('%') != std::string::npos) _fpattern = fname; } void FileAppender::openFile() { #ifdef O_CLOEXEC _fd = ::open( _fname.c_str(), O_WRONLY | O_APPEND | O_CLOEXEC | O_CREAT, 0666); #else _fd = ::open( _fname.c_str(), O_WRONLY | O_APPEND | O_CREAT, 0666); if (_fd >= 0) { int flags = ::fcntl(_fd, F_GETFD); flags |= FD_CLOEXEC ; ::fcntl(_fd, F_SETFD, flags); } #endif } void FileAppender::closeFile() { if (_fd != -1) { ::close(_fd); _fd = -1; } } void FileAppender::putMessage(const std::string& msg) { if (!_fpattern.empty()) { time_t t; if (_nextModTime != 0) time(&t); if (_nextModTime == 0 || _nextModTime <= t) { enum { state_0, state_p } state = state_0; /* Format codes: %Y 4 digit year %y 2 digit year %m month (1-12) %d day (1-31) %H hours (0-23) %I hours (0-11) %M minutes %S seconds %w day of week (0-6, Sunday=0) %W day of week (1-7, Sunday=7) %p am/pm %P AM/PM %L localtime %G gmtime %% single % */ DateTime localtime = DateTime::localtime(); DateTime gmtime = DateTime::gmtime(); time_t current; time(¤t); int year; unsigned month, day, hour, min, sec, msec; localtime.get(year, month, day, hour, min, sec, msec); DateTime* dt = &localtime; time_t res = 3600; std::string str; for (std::string::const_iterator it = _fpattern.begin(); it != _fpattern.end(); ++it) { char ch = *it; switch (state) { case state_0: if (ch == '%') state = state_p; else str += ch; break; case state_p: switch (ch) { case 'Y': appendDn(str, 4, year); break; case 'y': appendDn(str, 2, year % 100); break; case 'm': appendDn(str, 2, month); break; case 'd': appendDn(str, 2, day); break; case 'H': appendDn(str, 2, hour); break; case 'I': appendDn(str, 2, hour % 12); break; case 'M': appendDn(str, 2, min); if (res > 60) res = 60; break; case 'S': appendDn(str, 2, sec); res = 1; break; case 'w': appendDn(str, 1, dt->dayOfWeek()); break; case 'W': { int wday = dt->dayOfWeek(); appendDn(str, 1, wday == 0 ? 7 : wday); } break; case 'p': str += (hour >= 12 ? "pm" : "am"); break; case 'P': str += (hour >= 12 ? "PM" : "AM"); break; case '%': str += '%'; break; case 'L': dt = &localtime; dt->get(year, month, day, hour, min, sec, msec); break; case 'G': dt = &gmtime; dt->get(year, month, day, hour, min, sec, msec); break; default: str += '%'; str += ch; break; } state = state_0; break; } } if (state == state_p) str += '%'; fname(str); _nextModTime = current + res - current % res; } } if (_fd == -1) openFile(); FdAppender::putMessage(msg); } ////////////////////////////////////////////////////////////////////// // RollingFileAppender // class RollingFileAppender : public FileAppender { unsigned _maxfilesize; unsigned _maxbackupindex; unsigned _fsize; void doRotate(); std::string mkfilename(unsigned idx) const; public: RollingFileAppender(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex); virtual void putMessage(const std::string& msg); }; RollingFileAppender::RollingFileAppender(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex) : FileAppender(fname), _maxfilesize(maxfilesize), _maxbackupindex(maxbackupindex), _fsize(0) { try { _fsize = FileInfo(fname).size(); } catch (const std::exception&) { } } void RollingFileAppender::doRotate() { if (log_info_enabled()) { std::string msg; logentry(msg, "INFO", "cxxtools.log"); msg += "rotate file"; FileAppender::putMessage(msg); finish(true); } closeFile(); // ignore unlink- and rename-errors. In case of failure the // original file is reopened std::string newfilename = mkfilename(_maxbackupindex); ::unlink(newfilename.c_str()); for (unsigned idx = _maxbackupindex; idx > 0; --idx) { std::string oldfilename = mkfilename(idx - 1); ::rename(oldfilename.c_str(), newfilename.c_str()); newfilename = oldfilename; } ::rename(fname().c_str(), newfilename.c_str()); openFile(); _fsize = 0; } std::string RollingFileAppender::mkfilename(unsigned idx) const { std::string newfname(fname()); newfname += '.'; newfname += convert(idx); return newfname; } void RollingFileAppender::putMessage(const std::string& msg) { if (_fsize >= _maxfilesize) doRotate(); FileAppender::putMessage(msg); _fsize += msg.size() + 1; // FileAppender adds line feed to the message } ////////////////////////////////////////////////////////////////////// // UdpAppender // class UdpAppender : public LogAppender { net::UdpSender _loghost; std::string _msg; public: UdpAppender(const std::string& host, unsigned short int port, bool broadcast = true) : _loghost(host, port, broadcast) { } virtual void putMessage(const std::string& msg); virtual void finish(bool flush); }; void UdpAppender::putMessage(const std::string& msg) { _msg = msg; } void UdpAppender::finish(bool /*flush*/) { try { _loghost.send(_msg); } catch (const std::exception&) { } _msg.clear(); } ////////////////////////////////////////////////////////////////////// int throwInvalidLogLevel(const std::string& level, const std::string& category) { std::string msg = "unknown log level \"" + level + '\"'; if (!category.empty()) msg += " for category \"" + category + '"'; throw std::runtime_error(msg); } int compareIgnoreCase(const char* s1, const char* s2) { const char* it1 = s1; const char* it2 = s2; while (*it1 && *it2) { if (*it1 != *it2) { char c1 = std::toupper(*it1); char c2 = std::toupper(*it2); if (c1 < c2) return -1; else if (c2 < c1) return 1; } ++it1; ++it2; } return *it1 ? 1 : *it2 ? -1 : 0; } Logger::log_level_type logFlag2logLevel(Logger::log_flag_type flag) { if (flag == Logger::LOG_TRACE) return static_cast(Logger::LOG_LEVEL_DEBUG | Logger::LOG_TRACE); return static_cast((flag << 1) - 1); } Logger::log_flag_type str2logflag(const char* level) { // Converts a log level string (FATAL, ERROR, ...) to log_level_type. // When the log level is not identified, 0 is returned. if (compareIgnoreCase(level, "FATAL") == 0) return Logger::LOG_FATAL; if (compareIgnoreCase(level, "ERROR") == 0) return Logger::LOG_ERROR; if (compareIgnoreCase(level, "WARN") == 0) return Logger::LOG_WARN; if (compareIgnoreCase(level, "INFO") == 0) return Logger::LOG_INFO; if (compareIgnoreCase(level, "DEBUG") == 0) return Logger::LOG_DEBUG; if (compareIgnoreCase(level, "FINE") == 0) return Logger::LOG_FINE; if (compareIgnoreCase(level, "FINER") == 0) return Logger::LOG_FINER; if (compareIgnoreCase(level, "FINEST") == 0) return Logger::LOG_FINEST; switch (level[0]) { case 'f': case 'F': return Logger::LOG_FATAL; case 'e': case 'E': return Logger::LOG_ERROR; case 'w': case 'W': return Logger::LOG_WARN; case 'i': case 'I': return Logger::LOG_INFO; case 'd': case 'D': return Logger::LOG_DEBUG; case 't': case 'T': return Logger::LOG_TRACE; default: return static_cast(0); } } int str2logflags(const std::string& level, const std::string& category = std::string()) { /* Converts a complex log level string to log_level_type. Throws exception when level string could not be interpreted accepted log levels: * everything below level: FATAL ERROR WARN INFO DEBUG FINE FINER FINEST TRACE * everything below level with trace enabled: TFATAL ... TFINE * specific log levels: TRACE|ERROR|WARN * just one log level: |WARN */ if (level.empty()) throwInvalidLogLevel(level, category); // case "just one log level" e.g. "|WARN" if (level[0] == '|') { int ret = str2logflag(level.c_str() + 1); if (ret == 0) throwInvalidLogLevel(level, category); return ret; } // case "specific log levels" if (level.find('|') != std::string::npos) { std::vector tokens; split('|', level, std::back_inserter(tokens)); int ret = 0; for (std::vector::size_type n = 0; n < tokens.size(); ++n) { int r = str2logflag(tokens[n].c_str()); if (r == 0) throwInvalidLogLevel(level, category); ret |= r; } return ret; } // case "everything below level with trace enabled": if (level.size() > 1 && (level[0] == 'T' || level[0] == 't')) { Logger::log_flag_type r = str2logflag(level.c_str() + 1); if (r == 0) return Logger::LOG_LEVEL_DEBUG | Logger::LOG_TRACE; return logFlag2logLevel(r) | Logger::LOG_TRACE; } // case "everything below level": Logger::log_flag_type flag = str2logflag(level.c_str()); if (flag == 0) throwInvalidLogLevel(level, category); return logFlag2logLevel(flag); } const char* logLevel2Charp(int level) { return level == Logger::LOG_LEVEL_TRACE ? "TRACE" : level == Logger::LOG_LEVEL_DEBUG ? "FINEST" : level == Logger::LOG_LEVEL_DEBUG ? "FINER" : level == Logger::LOG_LEVEL_INFO ? "INFO" : level == Logger::LOG_LEVEL_WARN ? "WARN" : level == Logger::LOG_LEVEL_ERROR ? "ERROR" : "FATAL"; } } ////////////////////////////////////////////////////////////////////// // Logger // ////////////////////////////////////////////////////////////////////// // LogConfiguration::Impl // class LogConfiguration::Impl { public: typedef std::map LogFlags; private: friend void operator>>= (const SerializationInfo& si, LogConfiguration::Impl& loggerManagerConfigurationImpl); friend void operator<<= (SerializationInfo& si, const LogConfiguration::Impl& loggerManagerConfigurationImpl); std::string _fname; unsigned _maxfilesize; unsigned _maxbackupindex; std::string _loghost; unsigned short _logport; bool _broadcast; bool _tostdout; // flag for console output: true=stdout, false=stderr int _rootFlags; LogFlags _logFlags; public: typedef Logger::log_level_type log_level_type; explicit Impl(int rootFlags) : _maxfilesize(0), _maxbackupindex(0), _logport(0), _broadcast(true), _tostdout(false), _rootFlags(rootFlags) { } const std::string& fname() const { return _fname; } unsigned maxfilesize() const { return _maxfilesize; } unsigned maxbackupindex() const { return _maxbackupindex; } const std::string& loghost() const { return _loghost; } unsigned short logport() const { return _logport; } bool broadcast() const { return _broadcast; } bool tostdout() const { return _tostdout; } int rootFlags() const { return _rootFlags; } int logFlags(const std::string& category) const; const LogFlags& logLevels() const { return _logFlags; } void setRootFlags(int flags) { _rootFlags = flags; } void setLogFlags(const std::string& category, int flags) { _logFlags[category] = flags; } void unsetCategory(const std::string& category) { _logFlags.erase(category); } void setFile(const std::string& fname) { _fname = fname; _maxfilesize = 0; _maxbackupindex = 0; } void setFile(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex) { _fname = fname; _maxfilesize = maxfilesize; _maxbackupindex = maxbackupindex; } void setLoghost(const std::string& host, unsigned short port, bool broadcast) { _fname.clear(); _loghost = host; _logport = port; _broadcast = broadcast; } void setStdout() { _loghost.clear(); _logport = 0; _tostdout = true; } void setStderr() { _loghost.clear(); _logport = 0; _tostdout = false; } }; int LogConfiguration::Impl::logFlags(const std::string& category) const { // check for exact match of category in log level settings LogFlags::const_iterator lit = _logFlags.find(category); if (lit != _logFlags.end()) return lit->second; // find best match of category in log level settings std::string::size_type best_len = 0; int best_level = _rootFlags; for (LogFlags::const_iterator it = _logFlags.begin(); it != _logFlags.end(); ++it) { if (it->first.size() > best_len && it->first.size() < category.size() && category.at(it->first.size()) == '.' && category.compare(0, it->first.size(), it->first) == 0) { best_len = it->first.size(); best_level = it->second; } } return best_level; } void operator>>= (const SerializationInfo& si, LogConfiguration::Impl& impl) { if (si.getMember("file", impl._fname)) { impl._fname = envSubst(impl._fname); std::string s; if (si.getMember("maxfilesize", s)) { bool ok = true; std::string::iterator it = getInt(s.begin(), s.end(), ok, impl._maxfilesize); if (!ok) throw std::runtime_error("failed to read maxfilesize (\"" + s + "\")"); if (it != s.end()) { switch (*it) { case 'k': case 'K': impl._maxfilesize *= 1024; break; case 'm': case 'M': impl._maxfilesize *= 1024 * 1024; break; case 'g': case 'G': impl._maxfilesize *= 1024 * 1024 * 1024; break; } } si.getMember("maxbackupindex", impl._maxbackupindex); } } else if (si.getMember("logport", impl._logport)) { si.getMember("loghost", impl._loghost); si.getMember("broadcast", impl._broadcast); } else { if (!si.getMember("stdout", impl._tostdout)) impl._tostdout = false; } std::string rootFlags; if (!si.getMember("rootlogger", rootFlags)) impl._rootFlags = Logger::LOG_LEVEL_FATAL; else impl._rootFlags = str2logflags(rootFlags); const SerializationInfo* psi = si.findMember("loggers"); if (psi) { std::string category; std::string flagstr; int flags; for( SerializationInfo::ConstIterator it = psi->begin(); it != psi->end(); ++it) { it->getMember("category") >>= category; if (impl._logFlags.find(category) != impl._logFlags.end()) throw std::runtime_error("level already set for category \"" + category + '"'); it->getMember("level") >>= flagstr; if (flagstr.empty()) flags = Logger::LOG_LEVEL_FATAL; else flags = str2logflags(flagstr, category); impl._logFlags[category] = flags; } } if ((psi = si.findMember("logger")) != 0) { for( SerializationInfo::ConstIterator it = psi->begin(); it != psi->end(); ++it) { std::string category = it->name(); std::string flagstr; int flag; it->getValue(flagstr); if (!flagstr.empty()) { flag = str2logflags(flagstr, category); impl._logFlags[category] = flag; } } } } void operator<<= (SerializationInfo& si, const LogConfiguration::Impl& impl) { si.setTypeName("LogConfiguration"); si.addMember("rootlogger") <<= logLevel2Charp(impl._rootFlags); cxxtools::SerializationInfo& lsi = si.addMember("loggers"); lsi.setCategory(SerializationInfo::Array); for (LogConfiguration::Impl::LogFlags::const_iterator it = impl._logFlags.begin(); it != impl._logFlags.end(); ++it) { cxxtools::SerializationInfo& llsi = lsi.addMember(); llsi.setTypeName("logger"); llsi.addMember("category") <<= it->first; llsi.addMember("level") <<= logLevel2Charp(it->second == Logger::LOG_LEVEL_TRACE); } if (!impl._fname.empty()) { si.addMember("file") <<= impl._fname; if (impl._maxfilesize != 0) { si.addMember("maxfilesize") <<= impl._maxfilesize; si.addMember("maxbackupindex") <<= impl._maxbackupindex; } } if (impl._logport != 0) { si.addMember("loghost") <<= impl._loghost; si.addMember("logport") <<= impl._logport; if (impl._broadcast) si.addMember("broadcast") <<= true; } if (impl._tostdout) si.addMember("tostdout") <<= true; } ////////////////////////////////////////////////////////////////////// // LogConfiguration // int LogConfiguration::strToLogFlags(const std::string& level) { return str2logflags(level); } LogConfiguration::LogConfiguration() : _impl(new LogConfiguration::Impl(0)) { } LogConfiguration::LogConfiguration(const LogConfiguration& c) : _impl(new Impl(*c._impl)) { } LogConfiguration& LogConfiguration::operator=(const LogConfiguration& c) { if (this == &c) return *this; delete _impl; _impl = 0; _impl = new Impl(*c._impl); return *this; } LogConfiguration::~LogConfiguration() { delete _impl; } int LogConfiguration::rootFlags() const { return _impl->rootFlags(); } int LogConfiguration::logFlags(const std::string& category) const { return _impl->logFlags(category); } void LogConfiguration::setRootFlags(int flags) { _impl->setRootFlags(flags); } void LogConfiguration::setLogFlags(const std::string& category, int flags) { _impl->setLogFlags(category, flags); } void LogConfiguration::setLogLevel(const std::string& category, const std::string& level) { if (level.empty()) _impl->unsetCategory(category); else setLogFlags(category, strToLogFlags(level)); } void LogConfiguration::setFile(const std::string& fname) { _impl->setFile(fname); } void LogConfiguration::setFile(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex) { _impl->setFile(fname, maxfilesize, maxbackupindex); } void LogConfiguration::setLoghost(const std::string& host, unsigned short port, bool broadcast) { _impl->setLoghost(host, port, broadcast); } void LogConfiguration::setStdout() { _impl->setStdout(); } void LogConfiguration::setStderr() { _impl->setStderr(); } void operator>>= (const SerializationInfo& si, LogConfiguration& logConfiguration) { si >>= *logConfiguration.impl(); } void operator<<= (SerializationInfo& si, const LogConfiguration& logConfiguration) { si <<= *logConfiguration.impl(); } ////////////////////////////////////////////////////////////////////// // LogManager::Impl // class LogManager::Impl { SmartPtr _appender; LogConfiguration _config; typedef std::map Loggers; // map category => logger Loggers _loggers; Impl(const Impl&); Impl& operator=(const Impl&); public: explicit Impl(const LogConfiguration& config); ~Impl(); void configure(const LogConfiguration& config); const LogConfiguration& getLogConfiguration() const { return _config; } Logger* getLogger(const std::string& category); LogAppender& appender() { return *_appender; } int rootFlags() const { return _config.rootFlags(); } int logFlags(const std::string& category) const { return _config.logFlags(category); } }; LogManager::Impl::Impl(const LogConfiguration& config) { if (config.impl()->fname().empty()) { if (config.impl()->logport() != 0) { _appender = new UdpAppender(config.impl()->loghost(), config.impl()->logport(), config.impl()->broadcast()); } else { _appender = new FdAppender(config.impl()->tostdout() ? STDOUT_FILENO : STDERR_FILENO); } } else if (config.impl()->maxfilesize() == 0) { _appender = new FileAppender(config.impl()->fname()); } else { _appender = new RollingFileAppender(config.impl()->fname(), config.impl()->maxfilesize(), config.impl()->maxbackupindex()); } _config = config; } void LogManager::Impl::configure(const LogConfiguration& config) { if (config.rootFlags() == 0) return; if (config.impl()->fname().empty()) { if (config.impl()->logport() != 0) { _appender = new UdpAppender(config.impl()->loghost(), config.impl()->logport(), config.impl()->broadcast()); } else { _appender = new FdAppender(config.impl()->tostdout() ? STDOUT_FILENO : STDERR_FILENO); } } else if (config.impl()->maxfilesize() == 0) { _appender = new FileAppender(config.impl()->fname()); } else { _appender = new RollingFileAppender(config.impl()->fname(), config.impl()->maxfilesize(), config.impl()->maxbackupindex()); } _config = config; for (Loggers::iterator it = _loggers.begin(); it != _loggers.end(); ++it) it->second->setLogFlags(logFlags(it->second->getCategory())); } LogManager::Impl::~Impl() { for (Loggers::iterator it = _loggers.begin(); it != _loggers.end(); ++it) delete it->second; } ////////////////////////////////////////////////////////////////////// // LogManager // bool LogManager::_enabled = false; LogManager::LogManager() : _impl(0) { } LogManager::~LogManager() { MutexLock lock(logMutex); delete _impl; _enabled = false; } LogManager& LogManager::getInstance() { static LogManager loggerManager; return loggerManager; } void LogManager::logInit() { std::string logXml = "log.xml"; if (FileInfo::exists(logXml)) { logInit(logXml); } else { std::string logProperties = "log.properties"; if (FileInfo::exists(logProperties)) logInit(logProperties); else { std::string logJson = "log.json"; if (FileInfo::exists(logJson)) logInit(logJson); } } } void LogManager::logInit(const std::string& fname) { std::ifstream in(fname.c_str()); if (in) { try { if (fname.size() >= 11 && fname.compare(fname.size() - 11, 11, ".properties") == 0) { PropertiesDeserializer d(in); LogConfiguration config; d.deserialize(config); getInstance().configure(config); } else if (fname.size() >= 5 && fname.compare(fname.size() - 5, 5, ".json") == 0) { JsonDeserializer d(in); LogConfiguration config; d.deserialize(config); getInstance().configure(config); } else { xml::XmlDeserializer d(in, true); LogConfiguration config; d.deserialize(config); getInstance().configure(config); } } catch (const std::exception& e) { std::cerr << "failed to initialize logging: " << e.what() << std::endl; } } } void LogManager::logInit(const SerializationInfo& si) { LogConfiguration config; si >>= config; getInstance().configure(config); } void LogManager::logInit(const LogConfiguration& config) { getInstance().configure(config); } void LogManager::configure(const LogConfiguration& config) { MutexLock lock(logMutex); _enabled = false; if (_impl == 0) _impl = new Impl(config); else _impl->configure(config); _enabled = true; } LogConfiguration LogManager::getLogConfiguration() const { return _impl ? _impl->getLogConfiguration() : LogConfiguration(); } int LogManager::rootFlags() const { return _impl->rootFlags(); } int LogManager::logFlags(const std::string& category) const { return _impl->logFlags(category); } Logger* LogManager::getLogger(const std::string& category) { if (_impl == 0) return 0; return _impl->getLogger(category); } Logger* LogManager::Impl::getLogger(const std::string& category) { MutexLock lock(loggersMutex); // check for existing loggers Loggers::iterator it = _loggers.find(category); if (it != _loggers.end()) return it->second; Logger* ret = new Logger(category, logFlags(category)); _loggers[category] = ret; return ret; } ////////////////////////////////////////////////////////////////////// // LogMessage // class LogMessage::Impl { Logger* _logger; const char* _level; std::ostringstream _msg; std::ios_base::fmtflags _fmtflags; std::string _buffer; public: Impl() : _fmtflags(_msg.flags()) { } void setLogger(Logger* logger) { _logger = logger; } void setLevel(const char* level) { _level = level; } void finish(); std::ostringstream& out() { return _msg; } std::string str() { return _msg.str(); } void clear() { _msg.clear(); _msg.str(std::string()); _msg.flags(_fmtflags); } }; namespace { LPool logMessageImplPool; } LogMessage::LogMessage(Logger* logger, const char* level) : _impl(logMessageImplPool.getInstance()) { _impl->setLogger(logger); _impl->setLevel(level); } LogMessage::LogMessage(Logger* logger, Logger::log_level_type level) : _impl(logMessageImplPool.getInstance()) { _impl->setLogger(logger); _impl->setLevel(logLevel2Charp(level)); } LogMessage::~LogMessage() { if (_impl) { _impl->finish(); logMessageImplPool.releaseInstance(_impl); } } void LogMessage::finish() { _impl->finish(); logMessageImplPool.releaseInstance(_impl); _impl = 0; } void LogMessage::Impl::finish() { try { if (!LogManager::isEnabled()) return; ScopedAtomicIncrementer inc(mutexWaitCount); MutexLock lock(logMutex); logentry(_buffer, _level, _logger->getCategory()); _buffer += _msg.str(); LogAppender& appender = LogManager::getInstance().impl()->appender(); appender.putMessage(_buffer); appender.finish(inc.decrement() == 0); _buffer.clear(); } catch (const std::exception&) { } clear(); } std::ostream& LogMessage::out() { return _impl->out(); } std::string LogMessage::str() const { return _impl->str(); } ////////////////////////////////////////////////////////////////////// // LogTracer // class LogTracer::Impl { std::ostringstream _msg; Logger* _logger; void putmessage(const char* state) const; public: explicit Impl(Logger* logger) : _logger(logger) { } void setLogger(Logger* logger) { _logger = logger; } std::ostream& out() { return _msg; } void enter() const { putmessage("ENTER "); } void exit() const { putmessage("EXIT "); } }; LogTracer::LogTracer() : _impl(0) { } LogTracer::~LogTracer() { if (_impl) { _impl->exit(); delete _impl; } } void LogTracer::setLogger(Logger* l) { if (_impl) _impl->setLogger(l); else _impl = new Impl(l); } std::ostream& LogTracer::out() { return _impl->out(); } void LogTracer::enter() { if (_impl) _impl->enter(); } void LogTracer::exit() { if (_impl) { _impl->exit(); delete _impl; _impl = 0; } } void LogTracer::Impl::putmessage(const char* state) const { try { if (!LogManager::isEnabled()) return; ScopedAtomicIncrementer inc(mutexWaitCount); MutexLock lock(logMutex); std::string msg; logentry(msg, "TRACE", _logger->getCategory()); msg += state; msg += _msg.str(); LogAppender& appender = LogManager::getInstance().impl()->appender(); appender.putMessage(msg); appender.finish(inc.decrement() == 0); } catch (const std::exception&) { } } } cxxtools-3.0/src/serializationerror.cpp0000664000175000017500000000766213644433072015425 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace cxxtools { SerializationError::SerializationError(const std::string& msg) : std::runtime_error(msg) { } void SerializationError::doThrow(const std::string& msg) { throw SerializationError(msg); } static void addNodeInfo(std::string& message, const SerializationInfo& si) { if (!si.name().empty()) { message += " in node \""; message += si.name(); message += '"'; } if (!si.typeName().empty()) { message += " of type \""; message += si.typeName(); message += '"'; } } static std::string buildMemberNotFoundMessage(const SerializationInfo& si, const std::string& member) { std::string message; message = "Member \""; message += member; message += "\" not found"; addNodeInfo(message, si); return message; } static std::string buildMemberNotFoundMessage(const SerializationInfo& si, unsigned idx) { std::ostringstream msg; msg << "requested member index " << idx << " exceeds number of members " << si.memberCount(); std::string message = msg.str(); addNodeInfo(message, si); return msg.str(); } static std::string buildConversionErrorMessage(const SerializationInfo& si, const std::string& typefrom, const std::string& typeto, const std::string& valuefrom) { std::string message = "conversion from type "; message += typefrom; if (!valuefrom.empty()) { message += " (\""; message += valuefrom; message += "\")"; } message += " to type "; message += typeto; message += " failed"; addNodeInfo(message, si); return message; } SerializationMemberNotFound::SerializationMemberNotFound(const std::string& member) : SerializationError("Missing info for '" + member + "'"), _member(member) { } SerializationMemberNotFound::SerializationMemberNotFound(const SerializationInfo& si, const std::string& member) : SerializationError(buildMemberNotFoundMessage(si, member)), _member(member) { } SerializationMemberNotFound::SerializationMemberNotFound(const SerializationInfo& si, unsigned idx) : SerializationError(buildMemberNotFoundMessage(si, idx)), _member(cxxtools::convert(idx)) { } void SerializationConversionError::doThrow(const SerializationInfo& si, const std::string& typefrom, const std::string& typeto, const std::string& value) { throw SerializationConversionError(buildConversionErrorMessage(si, typefrom, typeto, value)); } } // namespace cxxtools cxxtools-3.0/src/stringstream.cpp0000664000175000017500000000471413644433072014213 00000000000000/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/stringstream.h" namespace cxxtools { StringStreamBuffer::StringStreamBuffer(std::ios::openmode mode) : std::basic_stringbuf(mode) { } StringStreamBuffer::StringStreamBuffer(const cxxtools::String& str, std::ios::openmode mode) : std::basic_stringbuf(str, mode) { } } // namespace cxxtools namespace std { basic_stringstream::basic_stringstream(ios_base::openmode mode) : basic_iostream(0) , _buffer(mode) { init(&_buffer); } basic_stringstream::basic_stringstream(const cxxtools::String& str, std::ios_base::openmode mode) : basic_iostream(0) , _buffer(str, mode) { init(&_buffer); } basic_stringstream::~basic_stringstream() { } basic_stringbuf* basic_stringstream::rdbuf() const { return (basic_stringbuf*)(&_buffer); } cxxtools::String basic_stringstream::str() const { return _buffer.str(); } void basic_stringstream::str(const cxxtools::String& str) { _buffer.str(str); } } // namespace std cxxtools-3.0/src/udpstream.cpp0000664000175000017500000000414413644433072013472 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/net/udpstream.h" namespace cxxtools { namespace net { void UdpStreambuf::sendBuffer() { try { sender.send(pbase(), pptr() - pbase(), flags); } catch (...) { } } std::streambuf::int_type UdpStreambuf::overflow(std::streambuf::int_type ch) { if (pptr() != pbase()) sendBuffer(); setp(message, message + msgsize); if (ch != traits_type::eof()) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type UdpStreambuf::underflow() { return traits_type::eof(); } int UdpStreambuf::sync() { if (pptr() != pbase()) sendBuffer(); setp(message, message + msgsize); return 0; } } // namespace net } // namespace cxxtools cxxtools-3.0/src/base64codec.cpp0000664000175000017500000002243113644433072013547 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace { inline char toBase64(uint8_t n) { static const char b64enc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; return b64enc[n]; } inline uint8_t fromBase64(char b64) { static const uint8_t b64dec[] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63, 52,53,54,55,56,57,58,59,60,61,255,255,255,64,255,255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, 15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255, 255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49,50,51,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 }; return b64dec[(int)b64]; } // returns number of available non space bytes up to N unsigned short numBytesN(unsigned short N, const MBState& s, const char* fromBegin, const char* fromEnd) { unsigned short count = s.n; while (count < N && fromBegin < fromEnd) if (!std::isspace(*fromBegin++)) ++count; return count; } // returns the next non space byte char readByte(MBState& s, const char*& fromNext) { if (s.n > 0) { char ret = s.value.mbytes[0]; std::memmove(s.value.mbytes, s.value.mbytes + 1, s.n - 1); --s.n; return ret; } else { while (std::isspace(*fromNext)) ++fromNext; return *fromNext++; } } } Base64Codec::Base64Codec(size_t ref) : TextCodec(ref), _maxcol(76), _lineend("\r\n"), _padding(true) {} Base64Codec::result Base64Codec::do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { fromNext = fromBegin; toNext = toBegin; while ( numBytesN(4, s, fromNext, fromEnd) >= 4 && (toEnd - toNext) >= 3 ) { uint8_t first = fromBase64(readByte(s, fromNext)); uint8_t second = fromBase64(readByte(s, fromNext)); uint8_t third = fromBase64(readByte(s, fromNext)); uint8_t fourth = fromBase64(readByte(s, fromNext)); *(toNext++) = (first << 2) + (second >> 4); if (third != 64) *(toNext++) = (second << 4) + (third >> 2); if (fourth != 64) *(toNext++) = (third << 6) + (fourth); } while (fromNext < fromEnd && s.n < 4) { while (fromNext < fromEnd && std::isspace(*fromNext)) ++fromNext; if (fromNext < fromEnd) s.value.mbytes[s.n++] = *fromNext++; } return numBytesN(1, s, fromNext, fromEnd) > 0 ? std::codecvt_base::partial : std::codecvt_base::ok; } Base64Codec::result Base64Codec::do_out(cxxtools::MBState& state, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { fromNext = fromBegin; toNext = toBegin; unsigned char& col = reinterpret_cast(state.value.mbytes[15]); if (state.n == 0) { state.n = 1; col = 0; } while (fromEnd - fromNext > 0) { if (state.n == 4) { if (toEnd - toNext < 4) return std::codecvt_base::partial; if (_maxcol > 0 && static_cast(col) + 4 > _maxcol) { if (toEnd - toNext < static_cast(4 + _lineend.size())) return std::codecvt_base::partial; for (unsigned n = 0; n < _lineend.size(); ++n) *toNext++ = _lineend[n]; col = 0; } col += 4; *toNext++ = toBase64( (static_cast(state.value.mbytes[0]) >> 2) & 0x3f ); *(toNext++) = toBase64( ((static_cast(state.value.mbytes[0]) << 4) + (static_cast(state.value.mbytes[1]) >> 4)) & 0x3f ); *(toNext++) = toBase64( (static_cast(state.value.mbytes[1] << 2) + (static_cast(state.value.mbytes[2]) >> 6)) & 0x3f ); *(toNext++) = toBase64( static_cast(state.value.mbytes[2]) & 0x3f ); state.n = 1; } state.value.mbytes[state.n-1] = *fromNext++; ++state.n; } return std::codecvt_base::ok; } Base64Codec::result Base64Codec::do_unshift(MBState& state, char* toBegin, char* toEnd, char*& toNext) const { toNext = toBegin; unsigned char& col = reinterpret_cast(state.value.mbytes[15]); if (state.n == 0) { state.n = 1; col = 0; } if (_maxcol > 0 && static_cast(col) + 4 > _maxcol) { if (toEnd - toNext < static_cast(4 + _lineend.size())) return std::codecvt_base::partial; for (unsigned n = 0; n < _lineend.size(); ++n) *toNext++ = _lineend[n]; col = 0; } col += 4; if (toEnd - toBegin < 4) return std::codecvt_base::partial; switch(state.n) { case 4: *toNext++ = toBase64( (static_cast(state.value.mbytes[0]) >> 2) & 0x3f ); *(toNext++) = toBase64( ((static_cast(state.value.mbytes[0]) << 4) + (static_cast(state.value.mbytes[1]) >> 4)) & 0x3f ); *(toNext++) = toBase64( (static_cast(state.value.mbytes[1] << 2) + (static_cast(state.value.mbytes[2]) >> 6)) & 0x3f ); *(toNext++) = toBase64( static_cast(state.value.mbytes[2]) & 0x3f ); break; case 3: *toNext++ = toBase64( (static_cast(state.value.mbytes[0]) >> 2) & 0x3f ); *(toNext++) = toBase64( ((static_cast(state.value.mbytes[0]) << 4) + (static_cast(state.value.mbytes[1]) >> 4)) & 0x3f ); *(toNext++) = toBase64( (static_cast(state.value.mbytes[1]) << 2) & 0x3f ); if (_padding) *(toNext++) = '='; break; case 2: *toNext++ = toBase64( (static_cast(state.value.mbytes[0]) >> 2) & 0x3f ); *(toNext++) = toBase64( (static_cast(state.value.mbytes[0]) << 4) & 0x3f ); if (_padding) { *(toNext++) = '='; *(toNext++) = '='; } break; default: return std::codecvt_base::noconv; } state = MBState(); return std::codecvt_base::ok; } } cxxtools-3.0/src/streambuffer.cpp0000664000175000017500000002433713644433072014161 00000000000000/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/streambuffer.h" #include #include #include #include log_define("cxxtools.streambuffer") namespace cxxtools { StreamBuffer::StreamBuffer(IODevice& ioDevice, size_t bufferSize, bool extend) : _ioDevice(&ioDevice), _ibufferSize(bufferSize+4), _ibuffer(0), _obufferSize(bufferSize), _obuffer(0), _pbmax(4), _oextend(extend) { setg(0, 0, 0); setp(0, 0); attach(ioDevice); } StreamBuffer::StreamBuffer(size_t bufferSize, bool extend) : _ioDevice(0), _ibufferSize(bufferSize+4), _ibuffer(0), _obufferSize(bufferSize), _obuffer(0), _pbmax(4), _oextend(extend) { setg(0, 0, 0); setp(0, 0); } StreamBuffer::~StreamBuffer() { delete[] _ibuffer; delete[] _obuffer; } void StreamBuffer::attach(IODevice& ioDevice) { if (ioDevice.busy()) throw IOPending("IODevice in use"); if (_ioDevice) { if (_ioDevice->busy()) throw IOPending("IODevice in use"); disconnect(ioDevice.inputReady, *this, &StreamBuffer::onRead); disconnect(ioDevice.outputReady, *this, &StreamBuffer::onWrite); } _ioDevice = &ioDevice; connect(ioDevice.inputReady, *this, &StreamBuffer::onRead); connect(ioDevice.outputReady, *this, &StreamBuffer::onWrite); } void StreamBuffer::beginRead() { if (_ioDevice == 0 || _ioDevice->reading()) return; if (! _ibuffer) { _ibuffer = new char[_ibufferSize]; } size_t putback = _pbmax; size_t leftover = 0; // keep chars for putback if (gptr()) { putback = std::min( gptr() - eback(), _pbmax); char* to = _ibuffer + _pbmax - putback; char* from = gptr() - putback; leftover = egptr() - gptr(); std::memmove( to, from, putback + leftover ); } size_t used = _pbmax + leftover; if (_ibufferSize == used) throw std::logic_error("StreamBuffer is full"); _ioDevice->beginRead( _ibuffer + used, _ibufferSize - used ); setg( _ibuffer + (_pbmax - putback), // start of get area _ibuffer + putback, // gptr position _ibuffer + used ); // end of get area } void StreamBuffer::onRead(IODevice& /*dev*/) { inputReady.send(*this); } void StreamBuffer::endRead() { size_t readSize = _ioDevice->endRead(); setg(eback(), // start of get area gptr(), // gptr position egptr() + readSize); // end of get area } StreamBuffer::int_type StreamBuffer::underflow() { log_trace("underflow"); if (!_ioDevice) return traits_type::eof(); if (_ioDevice->reading()) endRead(); if (gptr() < egptr()) return traits_type::to_int_type( *(gptr()) ); if (_ioDevice->eof()) return traits_type::eof(); if (! _ibuffer) { _ibuffer = new char[_ibufferSize]; } size_t putback = _pbmax; if (gptr()) { putback = std::min(gptr() - eback(), _pbmax); std::memmove( _ibuffer + (_pbmax - putback), gptr() - putback, putback ); } size_t readSize = _ioDevice->read( _ibuffer + _pbmax, _ibufferSize - _pbmax ); setg( _ibuffer + _pbmax - putback, // start of get area _ibuffer + _pbmax, // gptr position _ibuffer + _pbmax + readSize ); // end of get area if (_ioDevice->eof()) return traits_type::eof(); return traits_type::to_int_type( *(gptr()) ); } size_t StreamBuffer::beginWrite() { log_trace("beginWrite; out_avail=" << out_avail()); if (_ioDevice == 0) return 0; if (_ioDevice->writing()) { log_debug("device already in write mode - nothing done"); return 0; } if (pptr()) { size_t avail = pptr() - pbase(); if (avail > 0) { return _ioDevice->beginWrite(_obuffer, avail); } } return 0; } void StreamBuffer::discard() { if (_ioDevice && (_ioDevice->reading() || _ioDevice->writing())) throw IOPending("discard failed - streambuffer is in use"); if (gptr()) setg(_ibuffer, _ibuffer + _ibufferSize, _ibuffer + _ibufferSize); if (pptr()) setp(_obuffer, _obuffer + _obufferSize); } void StreamBuffer::onWrite(IODevice& /*dev*/) { outputReady.send(*this); } size_t StreamBuffer::endWrite() { log_trace("endWrite; out_avail=" << out_avail()); size_t leftover = 0; size_t written = 0; if (pptr()) { size_t avail = pptr() - pbase(); written = _ioDevice->endWrite(); leftover = avail - written; log_debug(written << " bytes written; " << leftover << " left in buffer"); if (leftover > 0) { traits_type::move(_obuffer, _obuffer + written, leftover); } } setp(_obuffer, _obuffer + _obufferSize); pbump( leftover ); return written; } StreamBuffer::int_type StreamBuffer::overflow(int_type ch) { log_trace("overflow(" << ch << ')'); if (!_ioDevice) return traits_type::eof(); if (!_obuffer) { _obuffer = new char[_obufferSize]; setp(_obuffer, _obuffer + _obufferSize); } else if (_oextend && !traits_type::eq_int_type( ch, traits_type::eof() )) { // break asyncronous I/O if any active bool pendingWrite = _ioDevice->writing(); bool pendingRead = false; if (pendingWrite) { if (_ioDevice->wavail()) { log_debug("finish writing"); endWrite(); } else { pendingRead = _ioDevice->reading(); log_debug("cancel asyncronous operations"); _ioDevice->cancel(); } } // `endWrite` may have freed some data in the buffer, in which case a // expand is not needed any more. if (epptr() == pptr()) { // if the buffer area is extensible and overflow is not called by // sync/flush we copy the output buffer to a larger one size_t bufsize = _obufferSize + (_obufferSize/2); log_debug("extend buffer from " << _obufferSize << " to " << bufsize); char* buf = new char[ bufsize ]; traits_type::copy(buf, _obuffer, _obufferSize); std::swap(_obuffer, buf); setp(_obuffer, _obuffer + bufsize); pbump( _obufferSize ); _obufferSize = bufsize; delete [] buf; } // restart asyncronous I/O if (pendingWrite) { beginWrite(); if (pendingRead) beginRead(); } } else if (_ioDevice->writing()) // beginWrite is unfinished { log_debug("finish writing"); endWrite(); } else { // normal blocking overflow case log_debug("blocking overflow"); size_t avail = pptr() - _obuffer; size_t written = _ioDevice->write(_obuffer, avail); size_t leftover = avail - written; if (leftover > 0) { traits_type::move(_obuffer, _obuffer + written, leftover); } setp(_obuffer, _obuffer + _obufferSize); pbump( leftover ); } // if the overflow char is not EOF put it in buffer if (traits_type::eq_int_type(ch, traits_type::eof()) == false) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return traits_type::not_eof(ch); } StreamBuffer::int_type StreamBuffer::pbackfail(StreamBuffer::int_type) { return traits_type::eof(); } int StreamBuffer::sync() { log_trace("sync"); if (! _ioDevice) return 0; if (pptr()) { while (pptr() > pbase()) { const int_type ch = overflow( traits_type::eof() ); if (ch == traits_type::eof()) { return -1; } _ioDevice->sync(); } } return 0; } std::streamsize StreamBuffer::xspeekn(char* buffer, std::streamsize size) { if (traits_type::eof() == underflow()) return 0; const std::streamsize avail = egptr() - gptr(); size = std::min(avail, size); if (size == 0) return 0; std::memcpy(buffer, gptr(), sizeof(char) * size); return size; } StreamBuffer::pos_type StreamBuffer::seekoff(off_type off, std::ios::seekdir dir, std::ios::openmode) { pos_type ret = pos_type( off_type(-1) ); if (! _ioDevice || ! _ioDevice->enabled() || ! _ioDevice->seekable() || off == 0) { return ret; } if (_ioDevice->writing()) { endWrite(); } if (_ioDevice->reading()) { endRead(); } ret = _ioDevice->seek(off, dir); // eliminate currently buffered sequence discard(); return ret; } StreamBuffer::pos_type StreamBuffer::seekpos(pos_type p, std::ios::openmode mode) { return seekoff(p, std::ios::beg, mode); } } cxxtools-3.0/src/multifstream.cpp0000664000175000017500000000605013644433072014200 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/multifstream.h" namespace cxxtools { multifstreambuf::multifstreambuf() : current(0) { mglob.gl_pathv = 0; } multifstreambuf::multifstreambuf(const char* pattern, int flags) : current(0) { int ret = glob(pattern, flags, 0, &mglob); if (ret == 0 && mglob.gl_pathv && mglob.gl_pathv[current]) file.open(mglob.gl_pathv[current], std::ios::in); else mglob.gl_pathv = 0; } multifstreambuf::~multifstreambuf() { if (mglob.gl_pathv) globfree(&mglob); } std::streambuf::int_type multifstreambuf::overflow(std::streambuf::int_type /*c*/) { return traits_type::eof(); } std::streambuf::int_type multifstreambuf::underflow() { if (mglob.gl_pathv == 0 || mglob.gl_pathv[current] == 0) open_next(); int_type r; do { r = file.sbumpc(); } while (r == traits_type::eof() && open_next()); if (r != traits_type::eof()) { ch = static_cast(r); setg(&ch, &ch, &ch + 1); } return r; } int multifstreambuf::sync() { return 0; } bool multifstreambuf::open_next() { if (file.is_open()) file.close(); if (mglob.gl_pathv && mglob.gl_pathv[current + 1]) { ++current; file.open(mglob.gl_pathv[current], std::ios::in); // error-handling is done in underflow() return true; } else { if (mglob.gl_pathv) globfree(&mglob); if (!patterns.empty()) { glob(patterns.front().first.c_str(), patterns.front().second, 0, &mglob); current = 0; if (mglob.gl_pathv && mglob.gl_pathv[0]) file.open(mglob.gl_pathv[0], std::ios::in); patterns.pop(); // error-handling is done in underflow() return true; } else { mglob.gl_pathv = 0; return false; } } } } cxxtools-3.0/src/iodevice.cpp0000664000175000017500000001460413644433072013257 00000000000000/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iodevice.h" #include "iodeviceimpl.h" namespace cxxtools { IODevice::IODevice() : _eof(false) , _async(false) , _rbuf(0) , _rbuflen(0) , _ravail(0) , _wbuf(0) , _wbuflen(0) , _wavail(0) { } size_t IODevice::onBeginRead(char* buffer, size_t n, bool& eof) { return ioimpl().beginRead(buffer, n, eof); } size_t IODevice::onEndRead(bool& eof) { return ioimpl().endRead(eof); } size_t IODevice::onRead(char* buffer, size_t count, bool& eof) { return ioimpl().read( buffer, count, eof ); } size_t IODevice::onBeginWrite(const char* buffer, size_t n) { return ioimpl().beginWrite(buffer, n); } size_t IODevice::onEndWrite() { return ioimpl().endWrite(); } size_t IODevice::onWrite(const char* buffer, size_t count) { return ioimpl().write(buffer, count); } void IODevice::onClose() { cancel(); ioimpl().close(); } void IODevice::onCancel() { ioimpl().cancel(); } void IODevice::onSync() { ioimpl().sync(); } void IODevice::onAttach(SelectorBase& s) { ioimpl().attach(s); } void IODevice::onDetach(SelectorBase& s) { ioimpl().detach(s); } void IODevice::beginRead(char* buffer, size_t n) { if (!async()) throw std::logic_error("Device not in async mode"); if (!enabled()) throw DeviceClosed("Device closed"); if (_rbuf) throw IOPending("read operation pending"); size_t r = this->onBeginRead(buffer, n, _eof); if (r > 0 || _eof || _wavail) this->setState(Selectable::Avail); else this->setState(Selectable::Busy); _rbuf = buffer; _rbuflen = n; _ravail = r; } size_t IODevice::endRead() { if ( ! _rbuf ) return 0; size_t n; try { n = this->onEndRead(_eof); } catch (...) { _rbuf = 0; _rbuflen = 0; _ravail = 0; throw; } if (_wavail > 0) this->setState(Selectable::Avail); else if (_wbuf) this->setState(Selectable::Busy); else this->setState(Selectable::Idle); _rbuf = 0; _rbuflen = 0; _ravail = 0; return n; } size_t IODevice::read(char* buffer, size_t n) { if (async()) { if ( _rbuf ) throw IOPending("read operation pending"); try // TODO pass buffer pointer/length to onEndRead { this->beginRead(buffer, n); size_t n = this->onEndRead(_eof); _rbuf = 0; _rbuflen = 0; _ravail = 0; return n; } catch(...) { _rbuf = 0; _rbuflen = 0; _ravail = 0; throw; } } return this->onRead(buffer, n, _eof); } size_t IODevice::beginWrite(const char* buffer, size_t n) { if (!async()) throw std::logic_error("Device not in async mode"); if (!enabled()) throw std::logic_error("Device not enabled"); if (_wbuf) throw IOPending("write operation pending"); size_t r = this->onBeginWrite(buffer, n); if (r > 0 || _ravail) this->setState(Selectable::Avail); else this->setState(Selectable::Busy); _wbuf = buffer; _wbuflen = n; _wavail = r; return r; } size_t IODevice::endWrite() { if ( ! _wbuf ) return 0; size_t n; try { n = onEndWrite(); } catch (...) { _wbuf = 0; _wbuflen = 0; _wavail = 0; throw; } if (_ravail > 0 || (_rbuf && _eof) ) this->setState(Selectable::Avail); else if (_rbuf) this->setState(Selectable::Busy); else this->setState(Selectable::Idle); _wbuf = 0; _wbuflen = 0; _wavail = 0; return n; } size_t IODevice::write(const char* buffer, size_t n) { if ( async() ) { if ( _wbuf ) { throw IOPending("write operation pending"); } try { this->beginWrite(buffer, n); size_t c = endWrite(); _wbuf = 0; _wbuflen = 0; _wavail = 0; return c; } catch(...) { _wbuf = 0; _wbuflen = 0; _wavail = 0; throw; } } return this->onWrite(buffer, n); } void IODevice::cancel() { onCancel(); setState(Selectable::Idle); _rbuf = 0; _rbuflen = 0; _ravail = 0; _wbuf = 0; _wbuflen = 0; _wavail = 0; } bool IODevice::seekable() const { return onSeekable(); } IODevice::pos_type IODevice::seek(off_type offset, std::ios::seekdir sd) { off_type ret = this->onSeek(offset, sd); if ( ret != off_type(-1) ) setEof(false); return ret; } size_t IODevice::peek(char* buffer, size_t n) { return this->onPeek(buffer, n); } void IODevice::sync() { return this->onSync(); } IODevice::pos_type IODevice::position() { return this->seek(0, std::ios::cur); } bool IODevice::eof() const { return _eof; } bool IODevice::async() const { return _async; } void IODevice::setEof(bool eof) { _eof = eof; } void IODevice::setAsync(bool async) { _async = async; } void IODevice::setTimeout(Milliseconds timeout) { ioimpl().setTimeout(timeout); } } cxxtools-3.0/src/thread.cpp0000664000175000017500000000524613644433072012741 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * Copyright (C) 2006-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "threadimpl.h" #include "cxxtools/thread.h" namespace cxxtools { Thread::Thread() : _state(Thread::Ready) , _impl(0) { _impl = new ThreadImpl(); } Thread::Thread(const Callable& cb) : _state(Thread::Ready) , _impl(0) { _impl = new ThreadImpl(); _impl->init(cb); } Thread::~Thread() { delete _impl; } void Thread::init(const Callable& cb) { _impl->init(cb); } void Thread::start() { if( this->state() == Ready || this->state() == Finished ) { _state = Thread::Running; _impl->start(); } } void Thread::exit() { ThreadImpl::exit(); } void Thread::yield() { ThreadImpl::yield(); } void Thread::sleep(const Milliseconds& ts) { ThreadImpl::sleep(ts); } void Thread::detach() { _impl->detach(); } void Thread::join() { if( this->state() == Running ) { _impl->join(); _state = Thread::Finished; } } bool Thread::joinNoThrow() { bool ret = true; if( this->state() == Running ) { try { _impl->join(); } catch(...) { ret = false; } _state = Thread::Finished; } return ret; } void Thread::terminate() { _impl->terminate(); _state = Thread::Finished; } } // !namespace cxxtools cxxtools-3.0/src/tee.cpp0000664000175000017500000000462113644433072012243 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/tee.h" namespace cxxtools { std::streambuf::int_type Teestreambuf::overflow(std::streambuf::int_type ch) { if(ch != traits_type::eof()) { if(streambuf1 && streambuf1->sputc(ch) == traits_type::eof()) return traits_type::eof(); if(streambuf2 && streambuf2->sputc(ch) == traits_type::eof()) return traits_type::eof(); } return 0; } std::streambuf::int_type Teestreambuf::underflow() { return traits_type::eof(); } int Teestreambuf::sync() { if(streambuf1 && streambuf1->pubsync() == traits_type::eof()) return traits_type::eof(); if(streambuf2 && streambuf2->pubsync() == traits_type::eof()) return traits_type::eof(); return 0; } ///////////////////////////////////////////////////////////////////////////// void Tee::assign(std::ostream& s1, std::ostream& s2) { Teestreambuf* buf = dynamic_cast(rdbuf()); if(buf) buf->tie(s1.rdbuf(), s2.rdbuf()); } void Tee::assign_single(std::ostream& s) { Teestreambuf* buf = dynamic_cast(rdbuf()); if(buf) buf->tie(s.rdbuf()); } } cxxtools-3.0/src/selectable.cpp0000664000175000017500000000631113644433072013567 00000000000000/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/selectable.h" #include "selectableimpl.h" namespace cxxtools { Selectable::~Selectable() { } void Selectable::setSelector(SelectorBase* parent) { if(_parent) { this->onDetach(*_parent); if( this->enabled() ) _parent->onRemove(*this); _parent = 0; } if(parent) { this->onAttach(*parent); if( this->enabled() ) parent->onAdd(*this); } _parent = parent; } SelectorBase* Selectable::selector() const { return _parent; } void Selectable::close() { if( this->enabled() ) { this->onClose(); this->setEnabled(false); } } bool Selectable::wait(Milliseconds msecs) { return this->onWait(msecs); } bool Selectable::enabled() const { return _state != Disabled; } bool Selectable::idle() const { return _state == Idle; } bool Selectable::busy() const { return _state == Busy; } bool Selectable::avail() const { return _state == Avail; } Selectable::Selectable() : _parent(0) , _state(Disabled) { } void Selectable::setEnabled(bool isEnabled) { if(isEnabled) { if(_state == Disabled) this->setState(Idle); else { this->setState(_state); if(_parent) _parent->onReinit(*this); } } else { this->setState(Disabled); } } void Selectable::setState(State state) { if(state == Disabled) { if(_parent) _parent->onRemove(*this); } else if(_state == Disabled) { if(_parent) _parent->onAdd(*this); } //State prev = _state; _state = state; if(_parent) { _parent->onChanged(*this /*, prev */); } } void Selectable::onClose() { simpl().close(); } bool Selectable::onWait(Timespan timeout) { return simpl().wait(timeout); } } cxxtools-3.0/src/textcodec.cpp0000664000175000017500000000370413644433072013451 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/textcodec.h" #ifdef CXXTOOLS_WITH_STD_LOCALE namespace std { // // codecvt facet for Char/char // std::locale::id codecvt::id; codecvt::codecvt(size_t ref) : locale::facet(ref) {} codecvt::~codecvt() {} // // codecvt facet for char/char // std::locale::id codecvt::id; codecvt::codecvt(size_t ref) : locale::facet(ref) {} codecvt::~codecvt() {} } // namespace std #endif cxxtools-3.0/src/deserializer.cpp0000664000175000017500000000414713644433072014153 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/deserializer.h" #include namespace cxxtools { void Deserializer::begin() { clear(); _current.push(&_si); } void Deserializer::clear() { while (!_current.empty()) _current.pop(); _si.clear(); } void Deserializer::beginMember(const std::string& name, const std::string& type, SerializationInfo::Category category) { SerializationInfo& child = current()->addMember(name); child.setTypeName(type); child.setCategory(category); _current.push(&child); } void Deserializer::leaveMember() { if (_current.size() <= 1) SerializationError::doThrow("invalid member"); _current.pop(); } } // namespace cxxtools cxxtools-3.0/src/iostream.cpp0000664000175000017500000000652113644433072013312 00000000000000/* * Copyright (C) 2005 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iostream.h" namespace cxxtools { IStream::IStream(size_t bufferSize) : _buffer(bufferSize) { attachBuffer(&_buffer); connect(_buffer.inputReady, *this, &IStream::onInput); } IStream::IStream(IODevice& device, size_t bufferSize) : _buffer(device, bufferSize) { attachBuffer(&_buffer); } IStream::~IStream() { } IODevice* IStream::attachDevice(IODevice& device) { IODevice* ret = attachedDevice(); _buffer.attach(device); return ret; } void IStream::endRead() { buffer().endRead(); if (buffer().in_avail() == 0) setstate(std::ios::eofbit); } void IStream::onInput(StreamBuffer&) { inputReady(*this); } OStream::OStream(size_t bufferSize, bool extend) : _buffer(bufferSize, extend) { attachBuffer(&_buffer); connect(_buffer.outputReady, *this, &OStream::onOutput); } OStream::OStream(IODevice& device, size_t bufferSize, bool extend) : _buffer(device, bufferSize, extend) { attachBuffer(&_buffer); } OStream::~OStream() { } IODevice* OStream::attachDevice(IODevice& device) { IODevice* ret = attachedDevice(); _buffer.attach(device); return ret; } void OStream::onOutput(StreamBuffer&) { outputReady(*this); } IOStream::IOStream(size_t bufferSize, bool extend) : _buffer(bufferSize, extend) { attachBuffer(&_buffer); connect(_buffer.inputReady, *this, &IOStream::onInput); connect(_buffer.outputReady, *this, &IOStream::onOutput); } IOStream::~IOStream() { } IOStream::IOStream(IODevice& device, size_t bufferSize, bool extend) : _buffer(device, bufferSize, extend) { attachBuffer(&_buffer); } void IOStream::onInput(StreamBuffer&) { inputReady(*this); } void IOStream::onOutput(StreamBuffer&) { outputReady(*this); } IODevice* IOStream::attachDevice(IODevice& device) { IODevice* ret = attachedDevice(); _buffer.attach(device); return ret; } void IOStream::endRead() { buffer().endRead(); if (buffer().in_avail() == 0) setstate(std::ios::eofbit); } } // namespace cxxtools cxxtools-3.0/src/file.cpp0000664000175000017500000001064613644433072012411 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fileimpl.h" #include "cxxtools/file.h" #include "cxxtools/directory.h" namespace cxxtools { File::File() { } File::File(const std::string& path) : _path(path) { if( ! File::exists( path ) ) throw FileNotFound(path); } File::File(const FileInfo& fi) : _path( fi.path() ) { if( ! fi.isFile() ) throw FileNotFound(fi.path()); } File::File(const File& file) : _path( file.path() ) { } File::~File() { } File& File::operator=(const File& file) { _path = file.path(); return *this; } std::size_t File::size() const { return FileImpl::size( path() ); } void File::resize(std::size_t newSize) { FileImpl::resize(path(), newSize); } void File::remove() { FileImpl::remove( path() ); } void File::move(const std::string& to) { FileImpl::move(path(), to); _path = to; } void File::link(const std::string& to) { FileImpl::link(path(), to); } void File::symlink(const std::string& to) { FileImpl::symlink(path(), to); } void File::copy(const std::string& to) { FileImpl::copy(path(), to); } // TODO This should be done on a file system basis. If we'd have a relative file here, // with no path, and try to determine the parent, an empty string would be returned, // though a parent is available. // TODO This is identical to Directory::parentPath(). Maybe this should be moved into // the common base class FileSystemNode. std::string File::dirName() const { // Find last slash. This separates the file name from the path. std::string::size_type separatorPos = path().find_last_of( Directory::sep() ); // If there is no separator, the file is relative to the current directory. So an empty path is returned. if (separatorPos == std::string::npos) { return ""; } // Include trailing separator to be able to distinguish between no path ("") and a path // which is relative to the root ("/"), for example. return path().substr(0, separatorPos + 1); } std::string File::name() const { std::string::size_type separatorPos = path().rfind( Directory::sep() ); if (separatorPos != std::string::npos) { return path().substr(separatorPos + 1); } else { return path(); } } std::string File::baseName() const { std::string fileName = this->name(); std::string::size_type extensionPointPos = fileName.rfind('.'); if (extensionPointPos != std::string::npos) { return fileName.substr(0, extensionPointPos); } else { return fileName; } } std::string File::extension() const { std::string fileName = this->name(); std::string::size_type extensionPointPos = fileName.rfind('.'); if (extensionPointPos != std::string::npos) { return fileName.substr(extensionPointPos + 1); } else { return ""; } } File File::create(const std::string& path) { FileImpl::create( path ); return File(path); } bool File::exists(const std::string& path) { return FileInfo::getType( path ) == FileInfo::File || FileInfo::getType( path ) == FileInfo::Symlink; } } // namespace cxxtools cxxtools-3.0/src/conditionimpl.h0000664000175000017500000000336213644433072014004 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/mutex.h" #include namespace cxxtools { class Timespan; class ConditionImpl { public: ConditionImpl(); ~ConditionImpl(); void wait(Mutex& mtx); bool wait(Mutex& mtx, const Timespan& ts); void signal(); void broadcast(); private: pthread_cond_t _cond; }; } cxxtools-3.0/src/uuencode.cpp0000664000175000017500000000653413644433072013302 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/uuencode.h" namespace cxxtools { static char cv[65] = "`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; void Uuencode_streambuf::begin(const std::string& filename, unsigned mode) { sinksource->sputn("begin ", 6); sinksource->sputc(((mode >> 6) & 0x7) + '0'); sinksource->sputc(((mode >> 3) & 0x7) + '0'); sinksource->sputc((mode & 0x7) + '0'); sinksource->sputc(' '); sinksource->sputn(filename.data(), filename.size()); sinksource->sputc('\n'); inStream = true; } void Uuencode_streambuf::end() { if (pbase() != pptr()) { sinksource->sputc(cv[pptr() - pbase()]); for (const char* p = pbase(); p < pptr(); p += 3) { char A = p[0]; char B = p < pptr() - 1 ? p[1] : 0; char C = p < pptr() - 2 ? p[2] : 0; sinksource->sputc(cv[(A >> 2) & 0x3F]); sinksource->sputc(cv[((A << 4) | ((B >> 4) & 0xF)) & 0x3F]); sinksource->sputc(cv[((B << 2) | ((C >> 6) & 0x3)) & 0x3F]); sinksource->sputc(cv[( C ) & 0x3F]); } sinksource->sputn("\n`\n", 3); setp(obuffer, obuffer + length); } if (inStream) { sinksource->sputn("end\n", 4); inStream = false; } } std::streambuf::int_type Uuencode_streambuf::overflow(std::streambuf::int_type ch) { if (pbase() != epptr()) { sinksource->sputc(cv[pptr() - pbase()]); for (const char* p = pbase(); p < pptr(); p += 3) { char A = p[0]; char B = p[1]; char C = p[2]; sinksource->sputc(cv[(A >> 2) & 0x3F]); sinksource->sputc(cv[((A << 4) | ((B >> 4) & 0xF)) & 0x3F]); sinksource->sputc(cv[((B << 2) | ((C >> 6) & 0x3)) & 0x3F]); sinksource->sputc(cv[( C ) & 0x3F]); } sinksource->sputc('\n'); } setp(obuffer, obuffer + length); if (ch != traits_type::eof()) { *pptr() = (char_type)ch; pbump(1); } return 0; } std::streambuf::int_type Uuencode_streambuf::underflow() { return traits_type::eof(); } int Uuencode_streambuf::sync() { return 0; } } cxxtools-3.0/src/clock.cpp0000664000175000017500000000433313644433072012561 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "clockimpl.h" #include "cxxtools/clock.h" namespace cxxtools { Clock::Clock() { _impl = new ClockImpl(); _impl->addRef(); } Clock::Clock(const Clock& cl) : _impl(cl._impl) { if (_impl) _impl->addRef(); } Clock& Clock::operator=(const Clock& cl) { if (_impl != cl._impl) { if (_impl && _impl->release() == 0) delete _impl; _impl = cl._impl; if (_impl) _impl->addRef(); } return *this; } Clock::~Clock() { if (_impl && _impl->release() == 0) delete _impl; } Timespan Clock::start() { return _impl->start(); } Timespan Clock::stop() const { return _impl->stop(); } UtcDateTime Clock::getSystemTime() { return ClockImpl::getSystemTime(); } LocalDateTime Clock::getLocalTime() { return ClockImpl::getLocalTime(); } Timespan Clock::getSystemTicks() { return ClockImpl::getSystemTicks(); } } //namespace cxxtools cxxtools-3.0/src/sslcertificateimpl.cpp0000664000175000017500000001134713644433072015357 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "sslcertificateimpl.h" #include "config.h" #include #include #ifndef HAVE_ASN1_TIME_diff #include #endif namespace cxxtools { static String str(X509_NAME* a) { class MemBIO { BIO* _out; MemBIO(const MemBIO&) { } MemBIO& operator=(const MemBIO&) { return *this; } public: MemBIO() : _out(BIO_new(BIO_s_mem())) { } ~MemBIO() { BIO_free(_out); } operator BIO* () { return _out; } }; MemBIO out; X509_NAME_print_ex(out, a, 0, XN_FLAG_RFC2253 & ~ASN1_STRFLGS_ESC_MSB); std::vector buf(BIO_number_written(out)); BIO_read(out, &buf[0], buf.size()); return Utf8Codec::decode(&buf[0], buf.size()); } static std::string str(ASN1_INTEGER* a) { BIGNUM* bn = ASN1_INTEGER_to_BN(a, 0); if (bn == 0) throw std::bad_alloc(); char* ch = BN_bn2hex(bn); if (ch == 0) { BN_free(bn); throw std::bad_alloc(); } BN_free(bn); std::string ret = ch; OPENSSL_free(ch); return ret; } #ifdef HAVE_ASN1_TIME_diff static DateTime dt(ASN1_TIME* t) { class Asn1Time { ASN1_TIME* _t; Asn1Time(const Asn1Time&) { } Asn1Time& operator=(const Asn1Time&) { return *this; } public: Asn1Time(time_t t) : _t(ASN1_TIME_set(0, t)) { } ~Asn1Time() { ASN1_STRING_free(_t); } operator ASN1_TIME* () { return _t; } }; Asn1Time epoch(0); int pday, psec; ASN1_TIME_diff(&pday, &psec, epoch, t); int secs = pday * (24*60*60) + psec; return DateTime::fromMSecsSinceEpoch(Seconds(secs)); } #else static DateTime dt(ASN1_TIME* time) { const char* str = (const char*) time->data; size_t i = 0; int year; unsigned mon, mday, hour, min, sec; if (time->type == V_ASN1_UTCTIME) {/* two digit year */ year = (str[i++] - '0') * 10; year += (str[i++] - '0'); if (year < 70) year += 2000; else year += 1900; } else if (time->type == V_ASN1_GENERALIZEDTIME) {/* four digit year */ year = (str[i++] - '0') * 1000; year+= (str[i++] - '0') * 100; year+= (str[i++] - '0') * 10; year+= (str[i++] - '0'); } else { std::ostringstream msg; msg << "unknown time format in ssl certificate; type=" << time->type << " str=\"" << str << '"'; throw std::runtime_error(msg.str()); } mon = (str[i++] - '0') * 10; mon += (str[i++] - '0'); mday = (str[i++] - '0') * 10; mday+= (str[i++] - '0'); hour = (str[i++] - '0') * 10; hour+= (str[i++] - '0'); min = (str[i++] - '0') * 10; min += (str[i++] - '0'); sec = (str[i++] - '0') * 10; sec += (str[i++] - '0'); return DateTime(year, mon, mday, hour, min, sec); } #endif SslCertificateImpl::~SslCertificateImpl() { X509_free(_cert); } String SslCertificateImpl::getSubject() const { return str(X509_get_subject_name(_cert)); } String SslCertificateImpl::getIssuer() const { return str(X509_get_issuer_name(_cert)); } DateTime SslCertificateImpl::getNotBefore() const { return dt(X509_get_notBefore(_cert)); } DateTime SslCertificateImpl::getNotAfter() const { return dt(X509_get_notAfter(_cert)); } std::string SslCertificateImpl::getSerial() const { return str(X509_get_serialNumber(_cert)); } } cxxtools-3.0/src/applicationimpl.cpp0000664000175000017500000000746513644433072014664 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "applicationimpl.h" #include "cxxtools/pipe.h" #include "cxxtools/selector.h" #include "cxxtools/application.h" #include "cxxtools/systemerror.h" #include "iodeviceimpl.h" #include #include #include #include #include namespace { cxxtools::Pipe* cxxtools_signal_pipe = 0; static char _signalBuffer[128]; void initSignalPipe() { if( ! cxxtools_signal_pipe ) { cxxtools_signal_pipe = new cxxtools::Pipe(cxxtools::Pipe::Async); cxxtools_signal_pipe->out().beginRead( _signalBuffer, sizeof(_signalBuffer) ); } } void processSignal(cxxtools::IODevice& device) { try { size_t n = device.endRead(); int sigNo = 0; char* it = _signalBuffer; char* last = &_signalBuffer[ n- sizeof(sigNo) ]; while(it <= last) { memcpy(&sigNo, it, sizeof(sigNo)); cxxtools::Application::instance().systemSignal.send(sigNo); it += sizeof(sigNo); } device.beginRead( _signalBuffer, sizeof(_signalBuffer) ); } catch(...) { device.beginRead( _signalBuffer, sizeof(_signalBuffer) ); throw; } } } extern "C" void cxxtools_system_application_sighandler(int sigNo) { if (cxxtools_signal_pipe) { cxxtools_signal_pipe->in().ioimpl().sigwrite(sigNo); } } namespace cxxtools { ApplicationImpl::ApplicationImpl() { ::initSignalPipe(); } ApplicationImpl::~ApplicationImpl() { disconnect(cxxtools_signal_pipe->out().inputReady, processSignal); } void ApplicationImpl::init(SelectorBase& s) { cxxtools_signal_pipe->out().setSelector(&s); connect(cxxtools_signal_pipe->out().inputReady, processSignal); } bool ApplicationImpl::catchSystemSignal(int sig) { if (sig > 0 && sig < NSIG) { struct sigaction act; act.sa_handler = cxxtools_system_application_sighandler; sigemptyset(&act.sa_mask); act.sa_flags = SA_RESTART; if (-1 == ::sigaction(sig, &act, NULL)) { throw SystemError("sigaction failed"); } return true; } return false; } bool ApplicationImpl::raiseSystemSignal(int sig) { if (sig > 0 && sig < NSIG) { if( 0 != ::raise(sig) ) { throw SystemError("sigaction failed"); } return true; } return false; } } // namespace cxxtools cxxtools-3.0/src/clockimpl.h0000664000175000017500000000354513644433072013114 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/datetime.h" #include "cxxtools/timespan.h" #include "cxxtools/refcounted.h" #include #include #include "config.h" namespace cxxtools { class ClockImpl : public RefCounted { public: Timespan start(); Timespan stop() const; static UtcDateTime getSystemTime(); static LocalDateTime getLocalTime(); static Timespan getSystemTicks(); private: #ifdef HAVE_CLOCK_GETTIME struct timespec _startTime; #else struct timeval _startTime; #endif }; } // namespace cxxtools cxxtools-3.0/src/propertiesserializer.cpp0000664000175000017500000001426313644433072015757 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include log_define("cxxtools.propertiesserializer") namespace cxxtools { namespace { void checkTs(std::basic_ostream* _ts) { if (_ts == 0) throw std::logic_error("outputstream is not set in PropertiesSerializer"); } void stringOut(std::basic_ostream& ts, const cxxtools::String& str) { for (cxxtools::String::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == L'"') ts << L'\\' << L'\"'; else if (*it == L'\\') ts << L'\\' << L'\\'; else if (*it == L'\b') ts << L'\\' << L'b'; else if (*it == L'\f') ts << L'\\' << L'f'; else if (*it == L'\n') ts << L'\\' << L'n'; else if (*it == L'\r') ts << L'\\' << L'r'; else if (*it == L'\t') ts << L'\\' << L't'; else if (it->value() >= 0x80 || it->value() < 0x20) { ts << L'\\' << L'u'; static const char hex[] = "0123456789abcdef"; uint32_t v = it->value(); for (uint32_t s = 16; s > 0; s -= 4) { ts << Char(hex[(v >> (s - 4)) & 0xf]); } } else ts << *it; } } } PropertiesSerializer& PropertiesSerializer::begin(std::basic_ostream& ts) { finish(); _ts = &ts; delete _myts; _myts = 0; return *this; } PropertiesSerializer& PropertiesSerializer::begin(std::ostream& os, TextCodec* codec) { finish(); _ts = _myts = new TextOStream(os, codec ? codec : new Utf8Codec()); return *this; } void PropertiesSerializer::finish() { if (_ts) _ts->flush(); _ts = 0; delete _myts; _myts = 0; } void PropertiesSerializer::format(const SerializationInfo& si, const std::string& key) { checkTs(_ts); doFormat(si, key); } void PropertiesSerializer::doFormat(const SerializationInfo& si, const std::string& key) { switch (si.category()) { case SerializationInfo::Void: if (key.empty()) { if (!si.name().empty()) { *_ts << String(si.name()) << L" =\n"; } } else { *_ts << String(key); if (!si.name().empty()) *_ts << L'.' << String(si.name()); *_ts << L" =\n"; } break; case SerializationInfo::Value: { String value; si.getValue(value); log_debug("format value; key=\"" << key << "\" name=\"" << si.name() << "\" value=\"" << value << '"'); if (key.empty()) { if (!si.name().empty()) { *_ts << String(si.name()) << L" = "; } } else { *_ts << String(key); if (!si.name().empty()) *_ts << L'.' << String(si.name()); *_ts << L" = "; } stringOut(*_ts, value); *_ts << L'\n'; break; } case SerializationInfo::Object: { std::string prefix = key; if (prefix.empty()) prefix = si.name(); log_debug("format object; prefix=\"" << prefix << '"'); if (_outputSize) *_ts << L"# object " << String(prefix) << (prefix.empty() ? L"size = " : L".size = ") << si.memberCount() << L'\n'; for (SerializationInfo::const_iterator it = si.begin(); it != si.end(); ++it) doFormat(*it, prefix); break; } case SerializationInfo::Array: { std::string prefix = key; if (prefix.empty()) prefix = si.name(); else if (!si.name().empty()) { prefix += '.'; prefix += si.name(); } if (!prefix.empty()) prefix += '.'; log_debug("format array; size=" << si.memberCount() << "; prefix=\"" << prefix << '"'); if (_outputSize) *_ts << L"# array " << String(prefix) << L"size = " << si.memberCount() << L'\n'; for (unsigned n = 0; n < si.memberCount(); ++n) { doFormat(si.getMember(n), prefix + convert(n)); } break; } } } } cxxtools-3.0/src/libraryimpl.h0000664000175000017500000000445313644433072013464 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LIBRARYIMPL_H #define CXXTOOLS_LIBRARYIMPL_H #include "cxxtools/systemerror.h" #include "cxxtools/refcounted.h" #include #include namespace cxxtools { class LibraryImpl : public RefCounted { public: LibraryImpl() : RefCounted(1) , _handle(0) { } LibraryImpl(const std::string& path) : RefCounted(1) , _handle(0) { this->open(path); } ~LibraryImpl() { if(_handle) ::dlclose(_handle); } void open(const std::string& path); void close(); void* resolve(const char* symbol) const; bool failed() { return _handle == 0; } static std::string suffix() { return ".so"; } static std::string prefix() { return "lib"; } private: void* _handle; }; } // namespace cxxtools #endif cxxtools-3.0/src/date.cpp0000664000175000017500000001577713644433072012421 00000000000000/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/date.h" #include "cxxtools/convert.h" #include "cxxtools/serializationinfo.h" #include "dateutils.h" #include namespace cxxtools { static void throwInvalidDate(const std::string& str, std::string::const_iterator p, const std::string& fmt) { throw InvalidDate("string <" + std::string(str.begin(), p) + "(*)" + std::string(p, str.end()) + "> does not match date format <" + fmt + '>'); } InvalidDate::InvalidDate() : std::invalid_argument("Invalid date") { } InvalidDate::InvalidDate(const std::string& what) : std::invalid_argument(what) { } void greg2jul(unsigned& jd, int y, int m, int d) { if( ! Date::isValid(y, m, d) ) { throw InvalidDate(); } jd=(1461*(y+4800+(m-14)/12))/4+(367*(m-2-12*((m-14)/12)))/12-(3*((y+4900+(m-14)/12)/100))/4+d-32075; } void jul2greg(unsigned jd, int& y, int& m, int& d) { int l,n,i,j; l=jd+68569; n=(4*l)/146097; l=l-(146097*n+3)/4; i=(4000*(l+1))/1461001; l=l-(1461*i)/4+31; j=(80*l)/2447; d=l-(2447*j)/80; l=j/11; m=j+2-(12*l); y=100*(n-49)+i+l; } Date::Date(const std::string& str, const std::string& fmt) { unsigned year = 0; unsigned month = 1; unsigned day = 1; enum { state_0, state_fmt, state_two } state = state_0; std::string::const_iterator dit = str.begin(); try { std::string::const_iterator it; for (it = fmt.begin(); it != fmt.end() && dit != str.end(); ++it) { char ch = *it; switch (state) { case state_0: if (ch == '%') state = state_fmt; else { if (ch == '*') skipNonDigit(dit, str.end()); else if (ch == '#') skipWord(dit, str.end()); else if (*dit != ch && ch != '?') throwInvalidDate(str, dit, fmt); else ++dit; } break; case state_fmt: if (*it != '%') state = state_0; switch (ch) { case 'Y': year = getInt(dit, str.end(), 4); break; case 'y': year = getInt(dit, str.end(), 2); year += (year < 50 ? 2000 : 1900); break; case 'm': month = getUnsigned(dit, str.end(), 2); break; case 'O': month = getMonthFromName(dit, str.end()); break; case 'd': day = getUnsigned(dit, str.end(), 2); break; case '2': state = state_two; break; default: throw InvalidDate("invalid date format <" + fmt + '>'); } break; case state_two: state = state_0; switch (ch) { case 'm': month = getUnsignedF(dit, str.end(), 2); break; case 'd': day = getUnsignedF(dit, str.end(), 2); break; default: throw InvalidDate("invalid date format <" + fmt + '>'); } } } if (it != fmt.end() || dit != str.end()) throwInvalidDate(str, dit, fmt); set(year, month, day); } catch (const std::invalid_argument&) { throwInvalidDate(str, dit, fmt); } } std::string Date::toString(const std::string& fmt) const { int year; unsigned month; unsigned day; get(year, month, day); std::string str; enum { state_0, state_fmt, state_one } state = state_0; for (std::string::const_iterator it = fmt.begin(); it != fmt.end(); ++it) { switch (state) { case state_0: if (*it == '%') state = state_fmt; else str += *it; break; case state_fmt: if (*it != '%') state = state_0; switch (*it) { case 'Y': appendDn(str, 4, year); break; case 'y': appendDn(str, 2, year % 100); break; case 'm': appendDn(str, 2, month); break; case 'O': str += monthnames[month-1]; break; case 'd': appendDn(str, 2, day); break; case 'w': appendDn(str, 1, dayOfWeek()); break; case 'W': { int dow = dayOfWeek(); appendDn(str, 1, dow == 0 ? 7 : dow); } break; case 'N': str += weekdaynames[dayOfWeek()]; break; case '1': state = state_one; break; default: str += '%'; str += *it; } break; case state_one: state = state_0; switch (*it) { case 'd': appendDn(str, day < 10 ? 1 : 2, day); break; case 'm': appendDn(str, month < 10 ? 1 : 2, month); break; default: str += "%1"; str += *it; if (*it == '%') state = state_fmt; break; } break; } } if (state == state_fmt) str += '%'; return str; } bool Date::isValid(int y, int m, int d) { static const unsigned char monthDays[12]= { 31,28,31,30,31,30,31,31,30,31,30,31 }; if (m == 2 && leapYear(y) && d == 29) return true; if (m < 1 || m > 12 || d < 1 || d > monthDays[m-1]) return false; return true; } void operator>>=(const SerializationInfo& si, Date& date) { if (si.category() == cxxtools::SerializationInfo::Object) { unsigned short year, month, day; si.getMember("year") >>= year; si.getMember("month") >>= month; si.getMember("day") >>= day; date.set(year, month, day); } else { std::string s; si.getValue(s); date = Date(s); } } void operator<<=(SerializationInfo& si, const Date& date) { si.setValue(date.toString()); si.setTypeName("Date"); } } cxxtools-3.0/src/conversionerror.cpp0000664000175000017500000000403713644433072014726 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/conversionerror.h" namespace cxxtools { ConversionError::ConversionError(const std::string& msg) : std::runtime_error(msg) { } void ConversionError::doThrow(const char* typeto, const char* typefrom) { std::string msg = "conversion from type "; msg += typefrom; msg += " to type "; msg += typeto; msg += " failed"; throw ConversionError(msg); } void ConversionError::doThrow(const char* typeto, const char* typefrom, const char* valuefrom) { std::string msg = "conversion from type "; msg += typefrom; msg += " (\""; msg += valuefrom; msg += "\") to type "; msg += typeto; msg += " failed"; throw ConversionError(msg); } } cxxtools-3.0/src/iodeviceimpl.h0000664000175000017500000001074613644433072013611 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_IODEVICEIMPL_H #define CXXTOOLS_SYSTEM_IODEVICEIMPL_H #include "selectableimpl.h" #include #include #include #include #include struct pollfd; namespace cxxtools { struct DestructionSentry { DestructionSentry(DestructionSentry*& sentry) : _deleted(false) , _sentry(sentry) { sentry = this; } ~DestructionSentry() { if( ! _deleted ) this->detach(); } bool operator!() const { return _deleted; } void detach() { _sentry = 0; _deleted = true; } bool _deleted; DestructionSentry*& _sentry; }; class IODeviceImpl : public SelectableImpl { public: static const short POLLERR_MASK; static const short POLLIN_MASK; static const short POLLOUT_MASK; IODeviceImpl(IODevice&); virtual ~IODeviceImpl(); int fd() const { return _fd; } void setTimeout(Timespan timeout) { _timeout = timeout; } Timespan timeout() const { return _timeout; } virtual void open(const std::string& path, IODevice::OpenMode mode, bool inherit); virtual void open(int fd, bool isAsync, bool inherit); virtual void close(); virtual size_t beginRead(char* buffer, size_t n, bool& eof); virtual size_t endRead(bool& eof); virtual size_t read( char* buffer, size_t count, bool& eof ); virtual size_t beginWrite(const char* buffer, size_t n); virtual size_t endWrite(); virtual size_t write( const char* buffer, size_t count ); void sigwrite(int sig); virtual void cancel(); virtual void sync() const; void attach(SelectorBase& s); void detach(SelectorBase& s); virtual bool wait(Timespan timeout); virtual bool wait(Timespan timeout, pollfd& pfd); virtual void initWait(pollfd& pfd); virtual size_t pollSize() const { return 1; } virtual size_t initializePoll(pollfd* pfd, size_t pollSize); virtual bool checkPollEvent(); virtual bool checkPollEvent(pollfd& pfd); virtual void inputReady(); virtual void outputReady(); protected: IODevice& _device; int _fd; Timespan _timeout; pollfd* _pfd; DestructionSentry* _sentry; bool _errorPending; std::exception_ptr _exception; void checkPendingException() { if (_exception) { std::exception_ptr exception; _exception.swap(exception); _errorPending = false; std::rethrow_exception(exception); } } }; } //namespace cxxtools #endif cxxtools-3.0/src/quotedprintablecodec.cpp0000664000175000017500000002245413644433072015672 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace { // returns the next byte char readByte(MBState& s, const char*& fromNext) { // note, that s.n = 0 means uninitialized, hence the s.n increased by one if (s.n > 1) { char ret = s.value.mbytes[0]; std::memmove(s.value.mbytes, s.value.mbytes + 1, s.n - 2); --s.n; return ret; } else { return *fromNext++; } } char peekByte(const MBState& s, const char* fromNext) { // note, that s.n = 0 means uninitialized, hence the s.n increased by one if (s.n > 1) { return s.value.mbytes[0]; } else { return *fromNext; } } inline unsigned available(const MBState& s, const char* fromNext, const char* fromEnd) { return s.n - 1 + (fromEnd - fromNext); } inline bool isqprint(char ch) { return (ch >= 33 && ch <= 60) || (ch >= 62 && ch <= 126); } } QuotedPrintableCodec::result QuotedPrintableCodec::do_in(cxxtools::MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { fromNext = fromBegin; toNext = toBegin; enum { state_0, state_eq, state_cr, state_b1, state_b2, }; // we misuse the MBState: // s.n = 0 => uninitialized // s.value.mbytes[0] = current incomplete char // s.value.mbytes[1] = parsing state unsigned char& currentChar = reinterpret_cast(s.value.mbytes[0]); unsigned char& state = reinterpret_cast(s.value.mbytes[1]); if (s.n == 0) { s.n = 1; currentChar = 0; state = state_0; } while (fromNext < fromEnd && toEnd > toNext) { char ch = *fromNext++; switch (state) { case state_0: if (ch == '=') state = state_eq; else *toNext++ = ch; break; case state_eq: if (ch >= '0' && ch <= '9') { currentChar = (ch - '0') << 4; state = state_b1; } else if (ch >= 'A' && ch <= 'F') { currentChar = (ch - 'A' + 10) << 4; state = state_b1; } else if (ch == '\r') state = state_cr; else if (ch == '\n') state = state_0; else return std::codecvt_base::error; break; case state_cr: if (ch == '\n') state = state_0; else if (ch == '=') state = state_eq; else *toNext++ = ch; state = state_0; break; case state_b1: if (ch >= '0' && ch <= '9') currentChar |= (ch - '0') & 0xf; else if (ch >= 'A' && ch <= 'F') currentChar |= (ch - 'A' + 10) & 0xf; else return std::codecvt_base::error; *toNext++ = currentChar; state = state_0; break; } } return fromNext < fromEnd ? std::codecvt_base::partial : std::codecvt_base::ok; } // convert quoted printable into bytes QuotedPrintableCodec::result QuotedPrintableCodec::do_out(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { static const char hex[17] = "0123456789ABCDEF"; fromNext = fromBegin; toNext = toBegin; // we misuse the MBState: // s.n = 0 => uninitialized // when s.n > 0 then the last char (s.value.mbytes[15]) indicates the current column static const unsigned char maxcol = 76; unsigned char& col = reinterpret_cast(s.value.mbytes[15]); if (s.n == 0) { s.n = 1; col = 0; } while (available(s, fromNext, fromEnd) > 0 && toEnd > toNext) { if (col > maxcol && toEnd - toNext > 3) { // There is one problem here: when we do never get enough space // to write the soft line break, we never get a chance to write // it. Then we will break the rule, that a line must not have more // than 76 characters. *toNext++ = '='; *toNext++ = '\r'; *toNext++ = '\n'; col = 0; } char ch = readByte(s, fromNext); if (isqprint(ch)) { *toNext++ = ch; ++col; } else if (ch == '\r' || ch == '\n') { *toNext++ = ch; col = 0; } else if (ch == '\t' || ch == ' ') { // tab or space is not allowed at the end of the line if (available(s, fromNext, fromEnd)) { char next = peekByte(s, fromNext); if (next != '\n' && next != '\r') { *toNext++ = ch; ++col; } else if (toEnd >= toNext + 3 && col < maxcol - 3) { // translate to hex sequence *toNext++ = '='; *toNext++ = hex[static_cast(ch) >> 4]; *toNext++ = hex[static_cast(ch) & 0xf]; col += 3; } else { // no space in output sequence => store char s.value.mbytes[s.n-1] = ch; ++s.n; return std::codecvt_base::partial; } } else { // don't know, whether the next char is printable - store for later use s.value.mbytes[s.n-1] = ch; ++s.n; return std::codecvt_base::partial; } } else if (toNext + 3 < toEnd) { if (col + 3 > maxcol) { *toNext++ = '='; *toNext++ = '\r'; *toNext++ = '\n'; col = 0; if (toEnd < toNext + 3) { // we filled the remaining space withour newline // put the char back to buffer and wait for a new output buffer s.value.mbytes[s.n-1] = ch; ++s.n; return std::codecvt_base::partial; } } *toNext++ = '='; *toNext++ = hex[static_cast(ch) >> 4]; *toNext++ = hex[static_cast(ch) & 0xf]; col += 3; } else { s.value.mbytes[s.n-1] = ch; ++s.n; return std::codecvt_base::partial; } } return available(s, fromNext, fromEnd) ? std::codecvt_base::partial : std::codecvt_base::ok; } QuotedPrintableCodec::result QuotedPrintableCodec::do_unshift(MBState& s, char* toBegin, char* toEnd, char*& toNext) const { const char* fromBegin = 0; const char* fromEnd = 0; const char* fromNext = 0; return do_out(s, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); } } cxxtools-3.0/src/settings.cpp0000664000175000017500000000357213644433072013332 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/settings.h" #include "settingsreader.h" #include "settingswriter.h" namespace cxxtools { SettingsError::SettingsError(const std::string& what, unsigned line) : SerializationError(what) , _line(line) {} Settings::Settings() {} void Settings::load(std::basic_istream& is) { SettingsReader reader(is); reader.parse(*this); } void Settings::save(std::basic_ostream& os ) const { SettingsWriter writer(os); writer.write(*this); } } cxxtools-3.0/src/iniserializer.cpp0000664000175000017500000000666513644433072014351 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { static bool isplain(const String& str) { if (str.empty()) return true; if (std::isspace(str[0]) || std::isspace(str[str.size() - 1])) return false; return true; } static void stringOut(TextOStream& _os, const cxxtools::String& str) { for (cxxtools::String::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == L'"') _os << "\\\""; else if (*it == L'\\') _os << "\\\\"; else if (*it == L'\b') _os << "\\b"; else if (*it == L'\f') _os << "\\f"; else if (*it == L'\n') _os << "\\n"; else if (*it == L'\r') _os << "\\r"; else if (*it == L'\t') _os << "\\t"; else _os << *it; } } IniSerializer& IniSerializer::serialize(const SerializationInfo& si) { for (SerializationInfo::const_iterator it = si.begin(); it != si.end(); ++it) { if (it->category() == SerializationInfo::Value) { cxxtools::String v; it->getValue(v); _os << String(it->name()) << L'='; if (isplain(v)) _os << v << L'\n'; else { _os << '"'; stringOut(_os, v); _os << "\"\n"; } } } for (SerializationInfo::const_iterator it = si.begin(); it != si.end(); ++it) { if (it->category() != SerializationInfo::Value) { _os << L'[' << String(it->name()) << L"]\n"; for (SerializationInfo::const_iterator value = it->begin(); value != it->end(); ++value) { cxxtools::String v; value->getValue(v); _os << String(value->name()) << L'='; if (isplain(v)) _os << v << L'\n'; else { _os << '"'; stringOut(_os, v); _os << "\"\n"; } } } } return *this; } } cxxtools-3.0/src/pipeimpl.h0000664000175000017500000000626713644433072012762 00000000000000/*************************************************************************** * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef Cxxtools_posix_PipeImpl_h #define Cxxtools_posix_PipeImpl_h #include "iodeviceimpl.h" #include #include namespace cxxtools { class PipeIODevice : public IODevice { friend class PipeImpl; public: PipeIODevice(); ~PipeIODevice(); int fd() const { return _impl.fd(); } void redirect(int fd, bool close, bool inherit); protected: void open(int fd, bool isAsync); void onClose() { cancel(); _impl.close(); } IODeviceImpl& ioimpl() { return _impl; } SelectableImpl& simpl() { return _impl; } private: IODeviceImpl _impl; }; class PipeImpl { public: PipeImpl(bool isAsync); PipeIODevice& in(); const PipeIODevice& in() const; PipeIODevice& out(); const PipeIODevice& out() const; void redirect(int fd, bool close, bool inherit); int getReadFd() const { return out().fd(); } int getWriteFd() const { return in().fd(); } /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStdout(bool close, bool inherit); /// Redirect read-end to stdin. /// When the close argument is set, closes the original filedescriptor void redirectStdin(bool close, bool inherit); /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStderr(bool close, bool inherit); private: PipeIODevice _out; PipeIODevice _in; }; } // namespace cxxtools #endif cxxtools-3.0/src/fdstream.cpp0000664000175000017500000001007013644433072013266 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include log_define("cxxtools.fdstream") namespace cxxtools { Fdstreambuf::Fdstreambuf(int fd_, unsigned bufsize_, bool doClose_) : fd(fd_), doClose(doClose_), bufsize(bufsize_), buffer(0) { } Fdstreambuf::~Fdstreambuf() { delete [] buffer; if (doClose) ::close(fd); } void Fdstreambuf::close() { ::close(fd); doClose = false; } std::streambuf::int_type Fdstreambuf::overflow(std::streambuf::int_type ch) { log_debug("overflow(" << ch << ')'); setg(0, 0, 0); if (pptr() > buffer) { log_debug("write " << (pptr() - buffer) << " bytes to fd " << fd); ssize_t ret; do { ret = ::write(fd, buffer, pptr() - buffer); } while (ret == -1 && errno == EINTR); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes written to fd " << fd); ssize_t rest = pptr() - buffer - ret; std::copy(buffer + ret, buffer + ret + rest, buffer); setp(buffer + rest, buffer + bufsize); } else { log_debug("initialize outputbuffer"); if (buffer == 0) { log_debug("allocate " << bufsize << " bytes output buffer"); buffer = new char[bufsize]; } setp(buffer, buffer + bufsize); } if (ch != traits_type::eof()) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type Fdstreambuf::underflow() { if (sync() != 0) return traits_type::eof(); if (buffer == 0) { log_debug("allocate " << bufsize << " bytes input buffer"); buffer = new char[bufsize]; } log_debug("read from fd " << fd); ssize_t ret; do { ret = ::read(fd, buffer, bufsize); } while (ret == -1 && errno == EINTR); if(ret < 0) throw SystemError(errno, "read"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes read"); setg(buffer, buffer, buffer + ret); return traits_type::to_int_type(*gptr()); } int Fdstreambuf::sync() { log_debug("sync()"); if (pptr() != pbase()) { char* p = pbase(); while (p < pptr()) { log_debug("write " << (pptr() - p) << " bytes to fd " << fd); ssize_t ret = ::write(fd, p, pptr() - p); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes written to fd " << fd); p += ret; } } setp(0, 0); setg(0, 0, 0); return 0; } } cxxtools-3.0/src/formatter.cpp0000664000175000017500000000574013644433072013474 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { void Formatter::addValueStdString(const std::string& name, const std::string& type, const std::string& value) { addValueString(name, type, String::widen(value)); } void Formatter::addValueChar(const std::string& name, const std::string& type, char value) { addValueString(name, type, String(1, Char(value))); } void Formatter::addValueBool(const std::string& name, const std::string& type, bool value) { addValueString(name, type, convert(value)); } void Formatter::addValueInt(const std::string& name, const std::string& type, int_type value) { addValueString(name, type, convert(value)); } void Formatter::addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value) { addValueString(name, type, convert(value)); } void Formatter::addValueFloat(const std::string& name, const std::string& type, float value) { addValueString(name, type, convert(value)); } void Formatter::addValueDouble(const std::string& name, const std::string& type, double value) { addValueString(name, type, convert(value)); } void Formatter::addValueLongDouble(const std::string& name, const std::string& type, long double value) { addValueString(name, type, convert(value)); } void Formatter::addNull(const std::string& name, const std::string& type) { addValueString(name, type, String()); } } cxxtools-3.0/src/eventloop.cpp0000664000175000017500000002001013644433072013467 00000000000000/* * Copyright (C) 2007 Marc Boris Duerner * Copyright (C) 2007 Laurentiu-Gheorghe Crisan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "selectorimpl.h" #include "cxxtools/eventloop.h" #include "cxxtools/mutex.h" #include "cxxtools/log.h" #include log_define("cxxtools.eventloop") namespace cxxtools { namespace { struct EvPtr { Event* ev; explicit EvPtr(Event* ev_) : ev(ev_) { } ~EvPtr() { if (ev) ev->destroy(); } }; } class EventLoop::Impl { public: Impl() : _exitLoop(false), _selector(new SelectorImpl()), _eventsPerLoop(16) { } ~Impl(); bool eventQueueEmpty() { return _eventQueue.empty() && _priorityEventQueue.empty() && _activeEventQueue.empty(); } Event* front() { if (_priorityEventQueue.empty()) return _eventQueue.front(); else return _priorityEventQueue.front(); } void pop_front() { if (_priorityEventQueue.empty()) _eventQueue.pop_front(); else _priorityEventQueue.pop_front(); } bool _exitLoop; SelectorImpl* _selector; std::deque _eventQueue; std::deque _priorityEventQueue; std::deque _activeEventQueue; bool _activeEventQueueIsPriority; Mutex _queueMutex; unsigned _eventsPerLoop; }; EventLoop::Impl::~Impl() { try { while ( ! _eventQueue.empty() ) { Event* ev = _eventQueue.front(); _eventQueue.pop_front(); ev->destroy(); } while ( ! _priorityEventQueue.empty() ) { Event* ev = _priorityEventQueue.front(); _priorityEventQueue.pop_front(); ev->destroy(); } while ( ! _activeEventQueue.empty() ) { Event* ev = _activeEventQueue.front(); _activeEventQueue.pop_front(); if (ev) ev->destroy(); } } catch(...) {} delete _selector; } EventLoop::EventLoop() : _impl(new Impl()) { } EventLoop::~EventLoop() { delete _impl; } unsigned EventLoop::eventsPerLoop() { return _impl->_eventsPerLoop; } void EventLoop::eventsPerLoop(unsigned n) { _impl->_eventsPerLoop = n; } void EventLoop::onAdd( Selectable& s ) { return _impl->_selector->add( s ); } void EventLoop::onRemove( Selectable& s ) { _impl->_selector->remove( s ); } void EventLoop::onReinit(Selectable& /*s*/) { } void EventLoop::onChanged(Selectable& s) { _impl->_selector->changed(s); } void EventLoop::onRun() { started(); while (true) { MutexLock lock(_impl->_queueMutex); if (_impl->_exitLoop) { _impl->_exitLoop = false; break; } bool eventQueueEmpty = _impl->eventQueueEmpty(); if (!eventQueueEmpty) { lock.unlock(); processEvents(_impl->_eventsPerLoop); eventQueueEmpty = _impl->eventQueueEmpty(); } lock.unlock(); if (eventQueueEmpty) { idle(); bool active = wait(idleTimeout()); if (!active) timeout.send(); } else { // process I/O events wait(0); } } exited(); } bool EventLoop::onWaitUntil(Timespan timeout) { if (_impl->_selector->waitUntil(timeout)) { MutexLock lock(_impl->_queueMutex); if (!_impl->eventQueueEmpty()) { lock.unlock(); processEvents(_impl->_eventsPerLoop); } return true; } return false; } void EventLoop::onWake() { _impl->_selector->wake(); } void EventLoop::onExit() { log_debug("exit loop"); { MutexLock lock(_impl->_queueMutex); _impl->_exitLoop = true; } wake(); } void EventLoop::onQueueEvent(const Event& ev, bool priority) { log_debug("queue event"); MutexLock lock( _impl->_queueMutex ); EvPtr cloned(ev.clone()); if (priority) _impl->_priorityEventQueue.push_back(cloned.ev); else _impl->_eventQueue.push_back(cloned.ev); cloned.ev = 0; } void EventLoop::onCommitEvent(const Event& ev, bool priority) { onQueueEvent(ev, priority); _impl->_selector->wake(); } void EventLoop::onProcessEvents(unsigned max) { unsigned count = 0; bool& exitLoop = _impl->_exitLoop; std::deque& eventQueue = _impl->_eventQueue; std::deque& priorityEventQueue = _impl->_priorityEventQueue; std::deque& activeEventQueue = _impl->_activeEventQueue; bool& activeEventQueueIsPriority = _impl->_activeEventQueueIsPriority; Mutex& queueMutex = _impl->_queueMutex; log_debug("processEvents(max:" << max << ") normal/priority/active(priority): " << eventQueue.size() << '/' << priorityEventQueue.size() << '/' << activeEventQueue.size() << '(' << activeEventQueueIsPriority << ')'); if (!activeEventQueue.empty() && !activeEventQueueIsPriority) { MutexLock lock(queueMutex); if (!priorityEventQueue.empty()) { log_debug("priority events bypass active events"); if (eventQueue.empty()) { eventQueue.swap(activeEventQueue); } else { eventQueue.insert(eventQueue.begin(), activeEventQueue.begin(), activeEventQueue.end()); activeEventQueue.clear(); } priorityEventQueue.swap(activeEventQueue); activeEventQueueIsPriority = true; } } while (!exitLoop) { if (activeEventQueue.empty()) { MutexLock lock(queueMutex); if (!priorityEventQueue.empty()) { log_debug("move " << priorityEventQueue.size() << " priority events to active event queue"); activeEventQueueIsPriority = true; activeEventQueue.swap(priorityEventQueue); } else if (!eventQueue.empty()) { log_debug("move " << eventQueue.size() << " events to active event queue"); activeEventQueueIsPriority = false; activeEventQueue.swap(eventQueue); } } if (exitLoop || activeEventQueue.empty()) { log_debug_if(activeEventQueue.empty(), "no events to process"); break; } EvPtr ev(activeEventQueue.front()); activeEventQueue.pop_front(); ++count; log_debug("send event " << count); event.send(*ev.ev); if (max != 0 && count >= max) { log_debug("maximum number of events per loop " << max << " reached"); break; } } } } // namespace cxxtools cxxtools-3.0/src/threadimpl.cpp0000664000175000017500000001035513644433072013620 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "threadimpl.h" #include "cxxtools/systemerror.h" #include "cxxtools/timespan.h" #include "config.h" #include #include #include #include #ifdef HAVE_ABI_FORCED_UNWIND #include #endif extern "C" { static void* thread_entry(void* arg) { cxxtools::ThreadImpl* impl = (cxxtools::ThreadImpl*)arg; if( impl->cb() ) { try { impl->cb()->call(); } catch (const std::exception& e) { std::cerr << "exception occured: " << e.what() << std::endl; } #ifdef HAVE_ABI_FORCED_UNWIND catch (const abi::__forced_unwind&) { throw; } #endif catch (...) { std::cerr << "exception occured" << std::endl; } } return 0; } } namespace cxxtools { void ThreadImpl::detach() { _detached = true; if( _id ) { int ret = pthread_detach(_id); if(ret != 0) throw SystemError("pthread_detach"); } } void ThreadImpl::init(const Callable& cb) { delete _cb; _cb = cb.clone(); } void ThreadImpl::start() { size_t stacksize = 0; pthread_attr_t attrs; pthread_attr_init(&attrs); //pthread_attr_setinheritsched(&attrs, PTHREAD_INHERIT_SCHED); if (stacksize > 0) pthread_attr_setstacksize(&attrs ,stacksize); if (_detached) { pthread_t id; int ret = pthread_create(&id, &attrs, thread_entry, this); pthread_attr_destroy(&attrs); if (ret != 0) throw SystemError("pthread_create"); ret = pthread_detach(id); if (ret != 0) throw SystemError("pthread_detach"); } else { int ret = pthread_create(&_id, &attrs, thread_entry, this); pthread_attr_destroy(&attrs); if (ret != 0) throw SystemError("pthread_create"); } } void ThreadImpl::join() { void* threadRet = 0; int ret = pthread_join(_id, &threadRet); if (ret != 0) throw SystemError("pthread_join"); } void ThreadImpl::terminate() { int ret = pthread_kill(_id, SIGKILL); if(ret != 0) throw SystemError("pthread_kill"); } void ThreadImpl::sleep(const Timespan& t) { #ifdef HAVE_NANOSLEEP struct timespec ts; ts.tv_sec = t.totalUSecs() / 1000000l; ts.tv_nsec = t.totalUSecs() % 1000000l * 1000; while (::nanosleep(&ts, &ts) == -1 && errno == EINTR) ; #else Timespan eow = Timespan::gettimeofday() + t; Timespan remaining; while ((remaining = eow - Timespan::gettimeofday()).totalUSecs() >= 1000000) { ::sleep(remaining.totalUSecs() / 1000000); } while (remaining.totalUSecs() > 0) { ::usleep(remaining.totalUSecs()); remaining = eow - Timespan::gettimeofday(); } #endif } } cxxtools-3.0/src/clockimpl.cpp0000664000175000017500000000636213644433072013447 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "clockimpl.h" #include #include namespace cxxtools { Timespan ClockImpl::start() { #ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_MONOTONIC, &_startTime); return Timespan(_startTime.tv_sec, _startTime.tv_nsec / 1000); #else gettimeofday( &_startTime, 0 ); return Timespan(_startTime.tv_sec, _startTime.tv_usec); #endif } Timespan ClockImpl::stop() const { #ifdef HAVE_CLOCK_GETTIME struct timespec stopTime; clock_gettime(CLOCK_MONOTONIC, &stopTime); time_t secs = stopTime.tv_sec - _startTime.tv_sec; suseconds_t usecs = (stopTime.tv_nsec - _startTime.tv_nsec) / 1000; #else struct timeval stopTime; gettimeofday( &stopTime, 0 ); time_t secs = stopTime.tv_sec - _startTime.tv_sec; suseconds_t usecs = stopTime.tv_usec - _startTime.tv_usec; #endif return Timespan(secs, usecs); } UtcDateTime ClockImpl::getSystemTime() { struct timeval tod; gettimeofday(&tod, NULL); struct tm tim; time_t sec = tod.tv_sec; gmtime_r(&sec, &tim); return UtcDateTime( tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, 0, tod.tv_usec); } LocalDateTime ClockImpl::getLocalTime() { struct timeval tod; gettimeofday(&tod, NULL); struct tm tim; time_t sec = tod.tv_sec; localtime_r(&sec, &tim); return LocalDateTime( tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, 0, tod.tv_usec); } Timespan ClockImpl::getSystemTicks() { struct timeval tv; gettimeofday( &tv, 0 ); return Timespan(tv.tv_sec, tv.tv_usec); } } // namespace System cxxtools-3.0/src/eventsink.cpp0000664000175000017500000000536313644433072013500 00000000000000/* * Copyright (C) 2007 Marc Boris Duerner * Copyright (C) 2007 Laurentiu-Gheorghe Crisan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/eventsink.h" #include "cxxtools/eventsource.h" namespace cxxtools { EventSink::EventSink() { } EventSink::~EventSink() { while( true ) { RecursiveLock lock( _mutex ); if( _sources.empty() ) return; EventSource* source = _sources.front(); if( ! source->tryDisconnect(*this) ) { lock.unlock(); Thread::yield(); } } } void EventSink::queueEvent(const Event& event) { this->onQueueEvent(event, false); } void EventSink::commitEvent(const Event& event) { this->onCommitEvent(event, false); } void EventSink::queuePriorityEvent(const Event& event) { this->onQueueEvent(event, true); } void EventSink::commitPriorityEvent(const Event& event) { this->onCommitEvent(event, true); } void EventSink::onConnect(EventSource& source) { RecursiveLock lock1( _mutex ); _sources.push_back(&source); } void EventSink::onDisconnect(EventSource& source) { RecursiveLock lock1( _mutex ); _sources.remove(&source); } void EventSink::onUnsubscribe(EventSource& source) { RecursiveLock lock1( _mutex ); std::list::iterator it; for(it = _sources.begin(); it != _sources.end(); ++it) { if(&source == *it) { _sources.erase(it); return; } } } } // namespace cxxtools cxxtools-3.0/src/sslcertificateimpl.h0000664000175000017500000000400313644433072015013 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SSLCERTIFICATEIMPL_H #define SSLCERTIFICATEIMPL_H #include #include #include #include namespace cxxtools { class SslCertificateImpl : public AtomicRefCounted { X509* _cert; SslCertificateImpl(const SslCertificateImpl&) { } SslCertificateImpl& operator=(const SslCertificateImpl&) { return *this; } public: explicit SslCertificateImpl(X509* cert) : _cert(cert) { } ~SslCertificateImpl(); String getSubject() const; String getIssuer() const; DateTime getNotBefore() const; DateTime getNotAfter() const; std::string getSerial() const; }; } #endif cxxtools-3.0/src/settingsreader.h0000664000175000017500000006552613644433072014171 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SettingsReader_h #define cxxtools_SettingsReader_h #include "cxxtools/settings.h" #include "cxxtools/char.h" #include "cxxtools/serializationinfo.h" #include #include #include namespace cxxtools { class SettingsReader { public: class State { public: virtual State* onChar(cxxtools::Char c, SettingsReader& reader) { if( c == std::char_traits::to_char_type( std::char_traits::eof() ) ) { return this->onEof(reader); } switch( c.value() ) { case '\n': case ' ': case '\t': case '\r': return this->onSpace(c, reader); case '"': return this->onQuote(c, reader); case ',': return this->onComma(c, reader); case '=': return this->onEqual(c, reader); case '#': case ';': return this->onHash(c, reader); case '{': return this->onOpenCurlyBrace(c, reader); case '}': return this->onCloseCurlyBrace(c, reader); case '(': return this->onOpenBrace(c, reader); case ')': return this->onCloseBrace(c, reader); case '[': return this->onOpenSquareBrace(c, reader); case ']': return this->onCloseSquareBrace(c, reader); default: return this->onAlpha(c, reader); } this->syntaxError(reader.line()); return 0; } virtual State* onEof(SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual ~State() {} private: virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onComma(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onEqual(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onOpenCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onCloseCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onOpenBrace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onCloseBrace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onOpenSquareBrace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onCloseSquareBrace(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onHash(cxxtools::Char /*c*/, SettingsReader& reader) { reader.beginComment(); // save current state return OnComment::instance(); } virtual State* onAlpha(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } protected: void syntaxError(unsigned line); }; class OnComment : public State { public: State* onChar(cxxtools::Char c, SettingsReader& reader) { if( c == '\n' ) { // restore state before comment return reader.endComment(); } return this; } static State* instance() { static OnComment _state; return &_state; } }; class BeginStatement : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& reader) { if(reader.depth() == 0) this->syntaxError(reader.line()); return OnQuotedValue::instance(); } virtual State* onOpenSquareBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.beginSection(); return OnSection::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.enterMember(); return OnCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return BeginType::instance(); } virtual State* onEof(SettingsReader& /*reader*/) { return this; } public: static State* instance() { static BeginStatement _state; return &_state; } }; class OnSection : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onCloseSquareBrace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return BeginStatement::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildSection(c); return this; } public: static State* instance() { static OnSection _state; return &_state; } }; class BeginType : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return AfterName::instance(); } virtual State* onEqual(cxxtools::Char /*c*/, SettingsReader& reader) { if (reader.depth() == 0) reader.enterMember(); else reader.pushName(); return OnEqual::instance(); } virtual State* onComma(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.enterMember(); return BeginStatement::instance(); } virtual State* onOpenBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushTypeName(); return BeginTypedValue::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { if(reader.depth() == 0) this->syntaxError(reader.line()); reader.pushTypeName(); reader.enterMember(); return OnCurly::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } public: static State* instance() { static BeginType _state; return &_state; } }; class AfterName : public BeginType { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onAlpha(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } public: static State* instance() { static AfterName _state; return &_state; } }; class OnEqual : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { if (c.value() == '\n') { reader.pushValue(); return AfterRValue::instance(); } else return this; } virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return OnQuotedValue::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.enterMember(); return OnCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return OnRValue::instance(); } public: static State* instance() { static OnEqual _state; return &_state; } }; class OnQuotedValue : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); return AfterQuotedValue::instance(); } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onEqual(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onHash(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onOpenBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onCloseBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onCloseSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { if(c == '\\') c = reader.getEscaped(); reader.buildToken(c); return this; } public: static State* instance() { static OnQuotedValue _state; return &_state; } }; class AfterValue : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onComma(cxxtools::Char /*c*/, SettingsReader& reader) { reader.leaveMember(); reader.enterMember(); return BeginStatement::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.leaveMember(); reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); reader.buildToken(c); return BeginType::instance(); } virtual State* onEof(SettingsReader& reader) { reader.leaveMember(); if(reader.depth() > 1) this->syntaxError(reader.line()); return this; } public: static State* instance() { static AfterValue _state; return &_state; } }; class AfterQuotedValue : public AfterValue { virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { /// TODO: multi-line strings return this; } virtual State* onOpenSquareBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.leaveMember(); reader.beginSection(); return OnSection::instance(); } public: static State* instance() { static AfterQuotedValue _state; return &_state; } }; class OnRValue : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return AfterRValue::instance(); } virtual State* onOpenSquareBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.beginSection(); return OnSection::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushTypeName(); reader.enterMember(); return OnCurly::instance(); } virtual State* onOpenBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushTypeName(); return BeginTypedValue::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onComma(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.enterMember(); return BeginStatement::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onEof(SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); return BeginStatement::instance(); } public: static State* instance() { static OnRValue _state; return &_state; } }; class AfterRValue : public OnRValue { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.buildToken(c); return BeginType::instance(); } public: static State* instance() { static AfterRValue _state; return &_state; } }; class OnCurly : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onOpenCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.enterMember(); return OnCurly::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return OnQuotedValue::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return BeginType::instance(); } public: static State* instance() { static OnCurly _state; return &_state; } }; class OnCloseCurly : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onOpenSquareBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.beginSection(); return OnSection::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.leaveMember(); return this; } virtual State* onComma(cxxtools::Char /*c*/, SettingsReader& reader) { if(reader.depth() == 0) { this->syntaxError(reader.line()); } reader.enterMember(); return BeginStatement::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return BeginType::instance(); } virtual State* onEof(SettingsReader& reader) { if(reader.depth() != 0) this->syntaxError(reader.line()); return this; } public: static State* instance() { static OnCloseCurly _state; return &_state; } }; class BeginTypedValue : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return this; } virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return OnQuotedTypedValue::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return OnTypedValue::instance(); } public: static State* instance() { static BeginTypedValue _state; return &_state; } }; class OnTypedValue : public State { virtual State* onSpace(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return EndTypedValue::instance(); } virtual State* onCloseBrace(cxxtools::Char /*c*/, SettingsReader& reader) { reader.pushValue(); return AfterValue::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } public: static State* instance() { static OnTypedValue _state; return &_state; } }; class OnQuotedTypedValue : public OnQuotedValue { virtual State* onQuote(cxxtools::Char /*c*/, SettingsReader& /*reader*/) { return EndTypedValue::instance(); } public: static State* instance() { static OnQuotedTypedValue _state; return &_state; } }; class EndTypedValue : public OnTypedValue { virtual State* onAlpha(cxxtools::Char /*c*/, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } public: static State* instance() { static EndTypedValue _state; return &_state; } }; public: SettingsReader(std::basic_istream& is) : state(0) , _beforeComment(0) , _is(&is) , _line(1) , _depth(0) , _isDotted(false) { } void parse(cxxtools::SerializationInfo& si); protected: void buildToken(cxxtools::Char c) { _token += c; } void beginSection() { _section.clear(); } void buildSection(cxxtools::Char c) { _section += c; } size_t depth() const { return _depth; } size_t line() const { return _line; } void enterMember(); void leaveMember(); void pushValue(); void pushTypeName(); void pushName(); void beginComment() { _beforeComment = state; } State* endComment() const { return _beforeComment; } cxxtools::Char getEscaped(); private: SerializationInfo* current() { return _current.top(); } State* state; State* _beforeComment; std::stack _current; std::basic_istream* _is; size_t _line; size_t _depth; bool _isDotted; cxxtools::String _token; cxxtools::String _section; }; static struct SettingsReaderInit { SettingsReaderInit() { SettingsReader::OnComment::instance(); SettingsReader::BeginStatement::instance(); SettingsReader::OnSection::instance(); SettingsReader::BeginType::instance(); SettingsReader::AfterName::instance(); SettingsReader::OnEqual::instance(); SettingsReader::OnCurly::instance(); SettingsReader::OnCloseCurly::instance(); SettingsReader::OnQuotedValue::instance(); SettingsReader::AfterQuotedValue::instance(); SettingsReader::OnRValue::instance(); SettingsReader::AfterRValue::instance(); SettingsReader::BeginTypedValue::instance(); SettingsReader::OnTypedValue::instance(); SettingsReader::OnQuotedTypedValue::instance(); SettingsReader::EndTypedValue::instance(); SettingsReader::AfterValue::instance(); } } settingsReaderInit; } // namespace cxxtools #endif cxxtools-3.0/src/jsondeserializer.cpp0000664000175000017500000000673313644433072015050 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include namespace cxxtools { namespace { struct CodecReleaser { TextCodec* _codec; CodecReleaser(TextCodec* codec) : _codec(codec) { } ~CodecReleaser() { if (_codec->refs() == 0) delete _codec; } private: CodecReleaser(const CodecReleaser&) { } void operator=(const CodecReleaser&) { } }; } JsonDeserializer::JsonDeserializer(std::istream& in, TextCodec* codec) { CodecReleaser r(codec); char ibuf; Char obuf; const char* fromBegin = &ibuf; const char* fromEnd = (&ibuf) + 1; const char* fromNext = fromEnd; Char* toBegin = &obuf; Char* toEnd = (&obuf) + 1; Char* toNext = &obuf; MBState mbstate; begin(); while (true) { if (fromNext > fromBegin) { if (!in.get(ibuf)) break; fromNext = fromBegin; } if (fromNext < fromEnd || toNext < toEnd) { std::codecvt_base::result r = codec->in(mbstate, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); if (r == std::codecvt_base::error) { in.setstate(std::ios::failbit); return; } } if (toNext > toBegin) { int ret = advance(obuf); if (ret == -1) in.putback(ibuf); if (ret != 0) break; toNext = &obuf; } } if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("json deserialization failed"); finish(); } JsonDeserializer::JsonDeserializer(std::basic_istream& in) { begin(); Char ch; int ret; while (in.get(ch)) { ret = advance(ch); if (ret == -1) in.putback(ch); if (ret != 0) break; } if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("json deserialization failed"); finish(); } void JsonDeserializer::begin() { Deserializer::begin(); _parser.begin(*this); } } cxxtools-3.0/src/tcpsocketimpl.cpp0000664000175000017500000010332213644433072014345 00000000000000/* * Copyright (C) 2009 Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #if defined(HAVE_ACCEPT4) || defined(HAVE_SO_NOSIGPIPE) || defined(MSG_NOSIGNAL) #include #include #endif #include #if !defined(MSG_MSG_NOSIGNAL) #include #endif #include "tcpsocketimpl.h" #include "tcpserverimpl.h" #include "sslcertificateimpl.h" #include #include #include #include #include #include #include #include #include "cxxtools/mutex.h" #include "cxxtools/resetter.h" #include "config.h" #include "error.h" #include #include #include #include #include #include #include #include #include #include log_define("cxxtools.net.tcpsocket.impl") log_define_instance(ssl, "cxxtools.net.tcpsocket.impl.ssl") namespace cxxtools { namespace net { namespace { std::string connectFailedMessage(AddrInfoImpl::const_iterator aip, int err) { std::ostringstream msg; msg << "failed to connect to <" << formatIp(*reinterpret_cast(aip->ai_addr)) << ">: " << getErrnoString(err); return msg.str(); } } void formatIp(const Sockaddr& sa, std::string& str) { #ifdef HAVE_INET_NTOP # ifdef HAVE_IPV6 char strbuf[INET6_ADDRSTRLEN + 1]; # else char strbuf[INET_ADDRSTRLEN + 1]; # endif const char* p = 0; switch(sa.sa_in.sin_family) { case AF_INET: p = inet_ntop(AF_INET, &sa.sa_in.sin_addr, strbuf, sizeof(strbuf)); break; # ifdef HAVE_IPV6 case AF_INET6: p = inet_ntop(AF_INET6, &sa.sa_in6.sin6_addr, strbuf, sizeof(strbuf)); break; # endif } str = (p == 0 ? "-" : strbuf); #else // HAVE_INET_NTOP static Mutex monitor; MutexLock lock(monitor); const char* p = inet_ntoa(sa.sa_in.sin_addr); if (p) str = p; else str.clear(); #endif } std::string getSockAddr(int fd) { Sockaddr addr; socklen_t slen = sizeof(addr); if (::getsockname(fd, &addr.sa, &slen) < 0) throw SystemError("getsockname"); std::string ret; formatIp(addr, ret); return ret; } std::string TcpSocketImpl::connectFailedMessages() { std::ostringstream msg; msg << "while trying to connect to "; if (_addrInfo.host().empty()) msg << "local host"; else msg << "host \"" << _addrInfo.host() << '"'; msg << " port " << _addrInfo.port() << ": "; join(_connectFailedMessages.begin(), _connectFailedMessages.end(), " / ", msg); _connectFailedMessages.clear(); return msg.str(); } #ifdef WITH_SSL void TcpSocketImpl::checkSslOperation(int ret, const char* fn, pollfd* pfd) { int err = SSL_get_error(_ssl, ret); log_debug_to(ssl, "check ssl operation ret=" << ret << " err=" << err); switch (err) { case SSL_ERROR_NONE: break; case SSL_ERROR_ZERO_RETURN: log_debug_to(ssl, "SSL_ERROR_ZERO_RETURN"); _state = CONNECTED; _socket.sslClosed(_socket); break; case SSL_ERROR_WANT_READ: log_debug_to(ssl, "SSL_ERROR_WANT_READ"); if (pfd) { pfd->events |= POLLIN; pfd->events &= ~POLLOUT; } break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_ACCEPT: log_debug_to(ssl, "SSL_ERROR_WANT_WRITE"); if (pfd) { pfd->events |= POLLOUT; pfd->events &= ~POLLIN; } break; case SSL_ERROR_WANT_X509_LOOKUP: log_debug_to(ssl, "SSL_ERROR_WANT_X509_LOOKUP"); break; case SSL_ERROR_SYSCALL: log_debug_to(ssl, "SSL_ERROR_SYSCALL; errno=" << errno); SslError::checkSslError(); if (ret == 0) { close(); _socket.closed(_socket); throw IOError("lost connection to peer in ssl operation"); } else { int e = errno; close(); throw SystemError(e, fn); } case SSL_ERROR_SSL: log_debug_to(ssl, "SSL_ERROR_SSL"); SslError::checkSslError(); break; } } void TcpSocketImpl::waitSslOperation(int ret, cxxtools::Timespan timeout) { pollfd pfd; pfd.fd = _fd; pfd.revents = 0; pfd.events = 0; checkSslOperation(ret, 0, &pfd); log_debug_to(ssl, "wait " << timeout << " fd " << _fd); bool avail = wait(timeout, pfd); if (!avail) { log_debug_to(ssl, "IOTimeout " << _fd); throw IOTimeout(); } } static cxxtools::Mutex *openssl_mutex; static unsigned long pthreads_thread_id() { return (unsigned long)pthread_self(); } static void pthreads_locking_callback(int mode, int n, const char* /* file */, int /* line */) { if (mode & CRYPTO_LOCK) openssl_mutex[n].lock(); else openssl_mutex[n].unlock(); } static void thread_setup() { openssl_mutex = new cxxtools::Mutex[CRYPTO_num_locks()]; CRYPTO_set_id_callback(pthreads_thread_id); CRYPTO_set_locking_callback(pthreads_locking_callback); } void TcpSocketImpl::initSsl() { if (_ssl) return; { MutexLock lock(_sslMutex); if (!_sslCtx) { if (!_sslInitialized) { log_debug_to(ssl, "SSL_library_init"); SSL_library_init(); SslError::checkSslError(); thread_setup(); _sslInitialized = true; } #ifdef HAVE_TLS_METHOD log_debug_to(ssl, "SSL_CTX_new(TLS_method())"); _sslCtx = SSL_CTX_new(TLS_method()); #else log_debug_to(ssl, "SSL_CTX_new(SSLv23_method())"); _sslCtx = SSL_CTX_new(SSLv23_method()); #endif SslError::checkSslError(); } } if (!_ssl) { _ssl = SSL_new(_sslCtx); SslError::checkSslError(); log_debug_to(ssl, "SSL_set_fd(" << _ssl << ", " << _fd << ')'); SSL_set_fd(_ssl, _fd); } } #endif // WITH_SSL TcpSocketImpl::TcpSocketImpl(TcpSocket& socket) : IODeviceImpl(socket), _socket(socket), _state(IDLE), _sentry(0) #ifdef WITH_SSL , _sslCtx(0), _ssl(0), _peerCertificateLoaded(false) #endif { } TcpSocketImpl::~TcpSocketImpl() { assert(_pfd == 0); #ifdef WITH_SSL if (_ssl) SSL_free(_ssl); if (_sslCtx) SSL_CTX_free(_sslCtx); #endif if (_sentry) _sentry->detach(); } void TcpSocketImpl::close() { log_debug("close socket " << _fd); IODeviceImpl::close(); _state = IDLE; #ifdef WITH_SSL _peerCertificate.clear(); _peerCertificateLoaded = false; if (_ssl) { log_debug("SSL_free"); SSL_free(_ssl); _ssl = 0; } #endif } std::string TcpSocketImpl::getSockAddr() const { return net::getSockAddr(_fd); } std::string TcpSocketImpl::getPeerAddr() const { Sockaddr addr; addr.storage = _peeraddr; std::string ret; formatIp(addr, ret); return ret; } int TcpSocketImpl::checkConnect() { log_trace("checkConnect"); int sockerr; socklen_t optlen = sizeof(sockerr); // check for socket error if (::getsockopt(_fd, SOL_SOCKET, SO_ERROR, &sockerr, &optlen) != 0) { // getsockopt failed int e = errno; close(); throw SystemError(e, "getsockopt"); } if (sockerr == 0) { log_debug("connected successfully to " << getPeerAddr()); _connectFailedMessages.clear(); _state = CONNECTED; } return sockerr; } void TcpSocketImpl::checkPendingError() { if (!_connectResult.empty()) { _connectFailedMessages.push_back(_connectResult); _connectResult.clear(); } if (!_connectFailedMessages.empty()) throw IOError(connectFailedMessages()); } std::string TcpSocketImpl::tryConnect() { log_trace("tryConnect"); assert(_fd == -1); if (_addrInfoPtr == _addrInfo.impl()->end()) { log_debug("no more address informations"); std::ostringstream msg; msg << "invalid address information; host \"" << _addrInfo.host() << "\" port " << _addrInfo.port(); return msg.str(); } while (true) { int fd; while (true) { log_debug("create socket for ip <" << formatIp(*reinterpret_cast(_addrInfoPtr->ai_addr)) << '>'); fd = ::socket(_addrInfoPtr->ai_family, SOCK_STREAM, 0); if (fd >= 0) break; log_debug("failed to create socket: " << getErrnoString()); AddrInfoImpl::const_iterator aip = _addrInfoPtr; if (++_addrInfoPtr == _addrInfo.impl()->end()) return connectFailedMessage(aip, errno); } static const int on = 1; #ifdef HAVE_SO_NOSIGPIPE if (::setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)) < 0) throw SystemError("setsockopt(SO_NOSIGPIPE)"); #endif if (::setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) throw SystemError("setsockopt(TCP_NODELAY)"); IODeviceImpl::open(fd, true, false); std::memmove(&_peeraddr, _addrInfoPtr->ai_addr, _addrInfoPtr->ai_addrlen); log_debug("created socket " << _fd << " max: " << FD_SETSIZE); log_debug("connect to port " << _addrInfo.port()); if (::connect(_fd, _addrInfoPtr->ai_addr, _addrInfoPtr->ai_addrlen) == 0) { _state = CONNECTED; log_debug("connected successfully to " << getPeerAddr()); break; } if (errno == EINPROGRESS) { log_debug("connect in progress"); break; } close(); AddrInfoImpl::const_iterator aip = _addrInfoPtr; if (++_addrInfoPtr == _addrInfo.impl()->end()) return connectFailedMessage(aip, errno); } return std::string(); } bool TcpSocketImpl::beginConnect(const AddrInfo& addrInfo) { log_trace("begin connect"); assert(_state == IDLE); _connectFailedMessages.clear(); _addrInfo = addrInfo; _addrInfoPtr = _addrInfo.impl()->begin(); _state = CONNECTING; _connectResult = tryConnect(); checkPendingError(); return _state == CONNECTED; } void TcpSocketImpl::endConnect() { log_trace("ending connect"); if (_pfd && ! _socket.wbuf()) { _pfd->events &= ~POLLOUT; } checkPendingError(); if ( _state == CONNECTED ) return; try { while (true) { pollfd pfd; pfd.fd = _fd; pfd.revents = 0; pfd.events = POLLOUT; log_debug("wait " << timeout()); bool avail = wait(timeout(), pfd); if (avail) { // something has happened int sockerr = checkConnect(); if (_state == CONNECTED) { _connectFailedMessages.clear(); return; } _connectFailedMessages.push_back(connectFailedMessage(_addrInfoPtr, sockerr)); log_debug("connect failed: " << _connectFailedMessages.back()); if (++_addrInfoPtr == _addrInfo.impl()->end()) { // no more addrInfo - propagate error throw IOError(connectFailedMessages()); } } else if (++_addrInfoPtr == _addrInfo.impl()->end()) { log_debug("timeout"); throw IOTimeout(); } close(); _connectResult = tryConnect(); if (_state == CONNECTED) { _connectResult.clear(); _connectFailedMessages.clear(); return; } if (!_connectResult.empty()) checkPendingError(); } } catch(...) { close(); throw; } } void TcpSocketImpl::accept(const TcpServer& server, unsigned flags) { socklen_t peeraddr_len = sizeof(_peeraddr); _fd = server.impl().accept(flags, reinterpret_cast (&_peeraddr), peeraddr_len); if (_fd < 0) throw SystemError("accept"); #ifdef HAVE_ACCEPT4 // Pass inherit flag as "true" since this is the default. // Otherwise `open` would set it although we have already set it with accept4 IODeviceImpl::open(_fd, false, true); #else bool inherit = (flags & TcpSocket::INHERIT) != 0; IODeviceImpl::open(_fd, true, inherit); #endif //TODO ECONNABORTED EINTR EPERM static const int on = 1; if (::setsockopt(_fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) throw SystemError("setsockopt(TCP_NODELAY)"); _state = CONNECTED; log_debug( "accepted from " << getPeerAddr() << " fd=" << _fd); } void TcpSocketImpl::initWait(pollfd& pfd) { IODeviceImpl::initWait(pfd); if (!isConnected()) { log_debug("not connected, setting POLLOUT "); pfd.events = POLLOUT; } } bool TcpSocketImpl::checkPollEvent(pollfd& pfd) { log_finer("checkPollEvent " << pfd.revents); DestructionSentry sentry(_sentry); if (isConnected()) { // check for error while neither reading nor writing // // if reading or writing, IODeviceImpl::checkPollEvent will emit // inputReady or outputReady signal and the user gets an exception in // endRead or endWrite. if ( !_device.reading() && !_device.writing() && (pfd.revents & POLLERR) ) { _device.close(); _socket.closed(_socket); return true; } #ifdef WITH_SSL if (_state == SSLCONNECTING) { log_debug_to(ssl, "SSL_connect"); int ret = SSL_connect(_ssl); if (ret == 1) { _state = SSLCONNECTED; _socket.sslConnected(_socket); } else { try { checkSslOperation(ret, "SSL_connect", _pfd); } catch (const std::exception&) { Resetter resetter(_state, CONNECTED); _state = THROWING; _socket.sslConnected(_socket); } } return true; } else if (_state == SSLACCEPTING) { log_debug_to(ssl, "SSL_accept " << _fd); int ret = SSL_accept(_ssl); if (ret == 1) { _state = SSLCONNECTED; _socket.sslAccepted(_socket); } else { try { checkSslOperation(ret, "SSL_accept", _pfd); } catch (const std::exception&) { Resetter resetter(_state, CONNECTED); _state = THROWING; _socket.sslAccepted(_socket); } } return true; } #endif bool avail = IODeviceImpl::checkPollEvent(pfd); if (!_sentry) return avail; if ( !_device.reading() && !_device.writing() && !_socket.enabled()) { _socket.closed(_socket); return true; } return avail; } if (pfd.revents & POLLERR) { int sockerr; socklen_t optlen = sizeof(sockerr); // check for socket error if (::getsockopt(_fd, SOL_SOCKET, SO_ERROR, &sockerr, &optlen) != 0) throw SystemError("getsockopt"); _connectFailedMessages.push_back(connectFailedMessage(_addrInfoPtr, sockerr)); AddrInfoImpl::const_iterator ptr = _addrInfoPtr; if (++ptr == _addrInfo.impl()->end()) { // not really connected but error // end of addrinfo list means that no working addrinfo was found log_debug("no more addrinfos found"); _socket.connected(_socket); return true; } else { _addrInfoPtr = ptr; close(); _connectResult = tryConnect(); if (_state == CONNECTED || !_connectResult.empty()) { // immediate success or error log_debug_if(_state == CONNECTED, "connected successfully"); log_debug_if(!_connectResult.empty(), "connection failed: " << _connectResult); _socket.connected(_socket); } else { // by closing the previous file handle _pfd is set to 0. // creating a new socket in tryConnect may also change the value of fd. initializePoll(&pfd, 1); } return true; } } else if (pfd.revents & POLLOUT) { int sockerr = checkConnect(); if (_state == CONNECTED) { _socket.connected(_socket); return true; } // something went wrong - look for next addrInfo _connectFailedMessages.push_back(connectFailedMessage(_addrInfoPtr, sockerr)); log_debug("connect failed: " << _connectFailedMessages.back()); if (++_addrInfoPtr == _addrInfo.impl()->end()) { // no more addrInfo - propagate error _connectResult = connectFailedMessages(); _socket.connected(_socket); return true; } close(); _connectResult = tryConnect(); if (_state == CONNECTED) { _socket.connected(_socket); return true; } } return false; } size_t TcpSocketImpl::callSend(const char* buffer, size_t n) { log_debug("::send(" << _fd << ", buffer, " << n << ')'); log_finer(hexDump(buffer, n)); #if defined(HAVE_MSG_NOSIGNAL) ssize_t ret; do { ret = ::send(_fd, (const void*)buffer, n, MSG_NOSIGNAL); } while (ret == -1 && errno == EINTR); #elif defined(HAVE_SO_NOSIGPIPE) ssize_t ret; do { ret = ::send(_fd, (const void*)buffer, n, 0); } while (ret == -1 && errno == EINTR); #else // block SIGPIPE sigset_t sigpipeMask, oldSigmask; sigemptyset(&sigpipeMask); sigaddset(&sigpipeMask, SIGPIPE); pthread_sigmask(SIG_BLOCK, &sigpipeMask, &oldSigmask); // execute send ssize_t ret; do { ret = ::send(_fd, (const void*)buffer, n, 0); } while (ret == -1 && errno == EINTR); // clear possible SIGPIPE sigset_t pending; sigemptyset(&pending); sigpending(&pending); if (sigismember(&pending, SIGPIPE)) { static const struct timespec nowait = { 0, 0 }; while (sigtimedwait(&sigpipeMask, 0, &nowait) == -1 && errno == EINTR) ; } // unblock SIGPIPE pthread_sigmask(SIG_SETMASK, &oldSigmask, 0); #endif int e = errno; log_debug("send returned " << ret); if (ret > 0) return static_cast(ret); errno = e; if (e == ECONNRESET || e == EPIPE) throw IOError("lost connection to peer"); return 0; } size_t TcpSocketImpl::beginWrite(const char* buffer, size_t n) { if (_state == CONNECTED) { size_t ret = callSend(buffer, n); if (ret > 0) return ret; if (_pfd) _pfd->events |= POLLOUT; } #ifdef WITH_SSL else if (_state == SSLCONNECTED) { log_debug("SSL_write(" << _fd << ", buffer, " << n << ')'); log_finer(hexDump(buffer, n)); int ret = SSL_write(_ssl, buffer, n); log_debug("SSL_write returned " << ret); if (ret > 0) return ret; try { checkSslOperation(ret, "SSL_write", _pfd); } catch (const std::exception&) { _exception = std::current_exception(); } } #endif else { log_error("Device not connected when trying to write; state=" << _state); throw std::logic_error("Device not connected when trying to write"); } return 0; } size_t TcpSocketImpl::write(const char* buffer, size_t n) { ssize_t ret = 0; while (true) { if (_state == CONNECTED) { ret = callSend(buffer, n); if (ret > 0) break; if (errno != EAGAIN) throw IOError(getErrnoString("send")); pollfd pfd; pfd.fd = _fd; pfd.revents = 0; pfd.events = POLLOUT; if (!wait(_timeout, pfd)) throw IOTimeout(); } #ifdef WITH_SSL else if (_state == SSLCONNECTED) { log_debug("SSL_write"); ret = SSL_write(_ssl, buffer, n); if (ret > 0) break; waitSslOperation(ret, timeout()); } #endif else { log_error("Device not connected when trying to write; state=" << _state); throw std::logic_error("Device not connected when trying to write"); } } return static_cast(ret); } void TcpSocketImpl::inputReady() { log_trace("inputReady; state=" << static_cast(_state)); switch (_state) { case IDLE: case CONNECTING: break; case CONNECTED: #ifdef WITH_SSL case SSLCONNECTED: #endif IODeviceImpl::inputReady(); break; #ifdef WITH_SSL case SSLACCEPTING: if (beginSslAccept()) _socket.sslAccepted(_socket); break; case SSLCONNECTING: if (beginSslConnect()) _socket.sslConnected(_socket); break; case SSLSHUTTINGDOWN: if (beginSslShutdown()) _socket.sslClosed(_socket); break; #endif } } void TcpSocketImpl::outputReady() { switch (_state) { case IDLE: case CONNECTING: break; case CONNECTED: #ifdef WITH_SSL case SSLCONNECTED: #endif IODeviceImpl::outputReady(); break; #ifdef WITH_SSL case SSLACCEPTING: if (beginSslAccept()) _socket.sslAccepted(_socket); break; case SSLCONNECTING: if (beginSslConnect()) _socket.sslConnected(_socket); break; case SSLSHUTTINGDOWN: if (beginSslShutdown()) _socket.sslClosed(_socket); break; #endif } } size_t TcpSocketImpl::read(char* buffer, size_t count, bool& eof) { if (_state == CONNECTED) { return IODeviceImpl::read(buffer, count, eof); } #ifdef WITH_SSL else if (_state == SSLCONNECTED) { while (true) { log_debug("SSL_read"); int ret = SSL_read(_ssl, buffer, count); log_debug("SSL_read(" << _fd << ", " << count << ") returned " << ret); if (ret > 0) { log_finer(hexDump(buffer, ret)); return ret; } pollfd pfd; pfd.fd = _fd; pfd.revents = 0; pfd.events = 0; checkSslOperation(ret, "SSL_read", &pfd); if (_state != SSLCONNECTED) { eof = true; return 0; } log_debug("wait " << timeout()); bool avail = wait(timeout(), pfd); if (!avail) throw IOTimeout(); } } #endif else { log_warn("socket not connected when trying to read; state=" << _state); throw IOError("socket not connected when trying to read"); } } #ifdef WITH_SSL Mutex TcpSocketImpl::_sslMutex; bool TcpSocketImpl::_sslInitialized = false; void TcpSocketImpl::loadSslCertificateFile(const std::string& certFile, const std::string& privateKeyFile) { log_debug("load ssl certificate file \"" << certFile << '"'); initSsl(); int ret = SSL_use_certificate_file(_ssl, certFile.c_str(), SSL_FILETYPE_PEM); if (ret != 1) checkSslOperation(ret, "SSL_use_certificate_file", _pfd); std::string key = privateKeyFile.empty() ? certFile : privateKeyFile; log_debug("load ssl private key file \"" << key << '"'); ret = SSL_use_PrivateKey_file(_ssl, key.c_str(), SSL_FILETYPE_PEM); if (ret != 1) checkSslOperation(ret, "SSL_use_PrivateKey_file", _pfd); log_debug("check private key"); if (!SSL_check_private_key(_ssl)) throw SslError("private key does not match the certificate public key", 0); log_debug("private key ok"); } void TcpSocketImpl::setSslVerify(int level, const std::string& ca) { cxxtools::FileInfo fileInfo(ca); initSsl(); STACK_OF(X509_NAME)* names = SSL_load_client_CA_file(ca.c_str()); log_debug("SSL_load_client_CA_file => " << names << " (" << sk_X509_NAME_num(names) << ')'); log_debug("SSL_CTX_set_client_CA_list"); SSL_CTX_set_client_CA_list(_sslCtx, names); log_debug("set ssl verify level " << level); SSL_set_verify( _ssl, level == 0 ? SSL_VERIFY_NONE : level == 1 ? (SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE) : (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT | SSL_VERIFY_CLIENT_ONCE), 0); if (level > 0) { log_debug_if(fileInfo.isFile(), "load verify locations file \"" << ca << '"'); log_debug_if(fileInfo.isDirectory(), "load verify locations directory \"" << ca << '"'); int ret = SSL_CTX_load_verify_locations(_sslCtx, fileInfo.isFile() ? ca.c_str() : 0, fileInfo.isDirectory() ? ca.c_str() : 0); if (ret == 0) SslError::checkSslError(); } } const SslCertificate& TcpSocketImpl::getSslPeerCertificate() const { if (_ssl && !_peerCertificateLoaded) { X509* cert = SSL_get_peer_certificate(_ssl); if (cert) _peerCertificate = SslCertificate(new SslCertificateImpl(cert)); _peerCertificateLoaded = true; } return _peerCertificate; } bool TcpSocketImpl::beginSslConnect() { log_trace("beginSslConnect; state=" << static_cast(_state)); if (!(_state == CONNECTED || _state == SSLCONNECTING)) { log_error("Device not connected when trying to enable ssl; state=" << _state); throw std::logic_error("Device not connected when trying to enable ssl"); } _state = SSLCONNECTING; initSsl(); log_debug("SSL_connect"); int ret = SSL_connect(_ssl); if (ret == 1) { log_debug("SSL connection successful"); _state = SSLCONNECTED; return true; } try { checkSslOperation(ret, "SSL_connect", _pfd); } catch (const std::exception&) { _exception = std::current_exception(); } return false; } void TcpSocketImpl::endSslConnect() { log_trace("ending ssl connect"); if (_pfd && !_socket.wbuf()) _pfd->events &= ~POLLOUT; if (_state == THROWING) throw; checkPendingException(); if (_state == SSLCONNECTED) { verifySslCertificate(); return; } if (_state == IDLE) { log_debug("no connection when ending connect; assume lost connection"); throw IOError("lost connection to peer"); } if (_state != SSLCONNECTING) { log_error_to(ssl, "Device not in connecting mode when trying to finish ssl connect; state=" << _state); throw std::logic_error("Device not in connecting mode when trying to finish ssl connect"); } while (true) { log_debug("SSL_connect"); int ret = SSL_connect(_ssl); if (ret == 1) { log_debug("SSL connection successful"); log_debug_if(_socket.hasSslPeerCertificate(), "peer subject: \"" << _socket.getSslPeerCertificate().getSubject() << "\" " "validity: " << _socket.getSslPeerCertificate().getNotBefore().toString() << " - " << _socket.getSslPeerCertificate().getNotAfter().toString()); verifySslCertificate(); _state = SSLCONNECTED; return; } waitSslOperation(ret, cxxtools::Seconds(-1)); } } bool TcpSocketImpl::beginSslAccept() { log_trace("begin ssl accept"); if (!(_state == CONNECTED || _state == SSLACCEPTING)) { log_error_to(ssl, "Device not connected when trying to enable ssl; state=" << _state); throw std::logic_error("Device not connected when trying to enable ssl"); } _state = SSLACCEPTING; initSsl(); log_debug_to(ssl, "SSL_accept " << _fd); int ret = SSL_accept(_ssl); if (ret == 1) { log_debug_to(ssl, "SSL accepted"); log_debug_to_if(ssl, _socket.hasSslPeerCertificate(), "peer subject: \"" << _socket.getSslPeerCertificate().getSubject() << "\" validity: " << _socket.getSslPeerCertificate().getNotBefore().toString() << " - " << _socket.getSslPeerCertificate().getNotAfter().toString()); _state = SSLCONNECTED; return true; } try { checkSslOperation(ret, "SSL_accept", _pfd); } catch (const std::exception&) { _exception = std::current_exception(); } return false; } void TcpSocketImpl::endSslAccept() { log_trace_to(ssl, "ending ssl accept"); if (_pfd && !_socket.wbuf()) _pfd->events &= ~POLLOUT; if (_state == THROWING) throw; checkPendingException(); if (_state == SSLCONNECTED) { verifySslCertificate(); return; } if (_state == IDLE) { log_debug("no connection when ending accept; assume lost connection"); throw IOError("lost connection to peer"); } if (_state != SSLACCEPTING) { log_error_to(ssl, "Device not in accepting mode when trying to finish ssl accept; state=" << _state); throw std::logic_error("Device not in accepting mode when trying to finish ssl accept"); } while (true) { log_debug_to(ssl, "SSL_accept " << _fd); int ret = SSL_accept(_ssl); if (ret == 1) { log_debug_to(ssl, "SSL accepted"); verifySslCertificate(); _state = SSLCONNECTED; return; } waitSslOperation(ret, cxxtools::Seconds(-1)); } } bool TcpSocketImpl::beginSslShutdown() { if (!(_state == SSLCONNECTED || _state == SSLSHUTTINGDOWN)) { log_error_to(ssl, "Device not connected when trying to shutdown ssl; state=" << _state); throw std::logic_error("Device not connected when trying to shutdown ssl"); } _state = SSLSHUTTINGDOWN; log_debug_to(ssl, "SSL_shutdown"); int ret = SSL_shutdown(_ssl); if (ret == 1) { _state = CONNECTED; return true; } try { checkSslOperation(ret, "SSL_shutdown", _pfd); } catch (const std::exception&) { _exception = std::current_exception(); } return false; } void TcpSocketImpl::endSslShutdown() { log_trace_to(ssl, "ending ssl shutdown"); if (_pfd && !_socket.wbuf()) _pfd->events &= ~POLLOUT; if (_state == CONNECTED) return; if (_state == IDLE) { log_debug("no connection when ending ssl shutdown; assume lost connection"); throw IOError("lost connection to peer"); } if (_state != SSLSHUTTINGDOWN) { log_error_to(ssl, "Device not in ssl shutdown mode when trying to finish ssl shutdown; state=" << _state); throw std::logic_error("Device not in ssl shutdown mode when trying to finish ssl shutdown"); } checkPendingException(); while (true) { log_debug_to(ssl, "SSL_shutdown"); int ret = SSL_shutdown(_ssl); if (ret == 1) { _state = CONNECTED; SSL* ssl = _ssl; _ssl = 0; SSL_clear(ssl); SslError::checkSslError(); return; } waitSslOperation(ret, cxxtools::Seconds(-1)); } } void TcpSocketImpl::verifySslCertificate() { if (_socket.acceptSslCertificate.isConnected() && !_socket.acceptSslCertificate(_socket.getSslPeerCertificate())) { _state = CONNECTED; throw SslCertificateNotAccepted(); } } #endif // WITH_SSL } // namespace net } // namespace cxxtools cxxtools-3.0/src/library.cpp0000664000175000017500000001003113644433072013122 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libraryimpl.h" #include "cxxtools/library.h" #include "cxxtools/fileinfo.h" #include "cxxtools/file.h" #include "cxxtools/directory.h" #include "cxxtools/log.h" #include log_define("cxxtools.library") namespace cxxtools { Library::Library() : _impl(new LibraryImpl()) { } Library::Library(const std::string& path) : _impl(new LibraryImpl()) { try { open(path); } catch (...) { delete _impl; throw; } } Library::Library(const Library& other) { _path = other._path; _impl = other._impl; _impl->addRef(); } Library& Library::operator=(const Library& other) { if(_impl == other._impl) return *this; _path = other._path; other._impl->addRef(); if( ! _impl->release() ) delete _impl; _impl = other._impl; return *this; } Library::~Library() { if ( ! _impl->release() ) delete _impl; } void Library::detach() { if ( _impl->refs() == 1 ) return; _path.clear(); LibraryImpl* x = _impl; _impl = new LibraryImpl(); if( ! x->release() ) delete x; } Library& Library::open(const std::string& libname) { this->detach(); try { log_debug("search for library \"" << libname << '"'); _impl->open(libname); _path = libname; return *this; } catch(const OpenLibraryFailed&) { } std::string path = libname; path += suffix(); try { log_debug("search for library \"" << path << '"'); _impl->open(path); _path = path; return *this; } catch(const OpenLibraryFailed&) { } std::string::size_type idx = path.rfind( Directory::sep() ); if(idx == std::string::npos) { idx = 0; } else if( ++idx == path.length() ) { throw OpenLibraryFailed(path); } path.insert( idx, prefix() ); log_debug("search for library \"" << path << '"'); _impl->open(path); _path = path; return *this; } void Library::close() { this->detach(); _impl->close(); } void* Library::resolve(const char* symbol) const { return _impl->resolve(symbol); } Symbol Library::getSymbol(const char* symbol) const { void* sym = this->resolve(symbol); if (sym == 0) { throw SymbolNotFound(symbol); } return Symbol(*this, sym); } Library::operator const void*() const { return _impl->failed() ? 0 : this; } bool Library::operator!() const { return _impl->failed(); } const std::string& Library::path() const { return _path; } std::string Library::suffix() { return LibraryImpl::suffix(); } std::string Library::prefix() { return LibraryImpl::prefix(); } } // namespace cxxtools cxxtools-3.0/src/threadimpl.h0000664000175000017500000000416513644433072013267 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/thread.h" #include #include namespace cxxtools { class Timespan; class ThreadImpl { public: ThreadImpl() : _cb(0), _id(0), _detached(false) { } ~ThreadImpl() { delete _cb; } void init(const Callable& cb); void detach(); void start(); void join(); void terminate(); static void exit() { ::pthread_exit( NULL ); } static void yield() { ::sched_yield(); } static void sleep(const Timespan& ts); const Callable* cb() { return _cb; } private: const Callable* _cb; pthread_t _id; bool _detached; }; } cxxtools-3.0/src/filedeviceimpl.h0000664000175000017500000000406413644433072014115 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 PTV AG * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/ioerror.h" #include "cxxtools/filedevice.h" #include "cxxtools/iodevice.h" #include "iodeviceimpl.h" namespace cxxtools { class FileDeviceImpl : public IODeviceImpl { public: typedef FileDevice::pos_type pos_type; typedef FileDevice::off_type off_type; public: FileDeviceImpl(FileDevice& device); ~FileDeviceImpl(); bool seekable() const; pos_type seek(off_type offset, std::ios::seekdir sd); void resize(off_type size); size_t size() const; size_t peek(char* buffer, size_t count); void sync() const; }; } //namespace cxxtools cxxtools-3.0/src/addrinfoimpl.cpp0000664000175000017500000000601513644433072014135 00000000000000/* * Copyright (C) 2003,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "addrinfoimpl.h" #include "error.h" #include #include #include #include #include namespace cxxtools { namespace net { namespace { std::string getAddrInfoError(int ret) { if (ret == EAI_SYSTEM) return getErrnoString("getaddrinfo"); std::ostringstream msg; msg << "error " << ret << " in function getaddrinfo: " << ::gai_strerror(ret); return msg.str(); } } AddrInfoError::AddrInfoError(int ret) : SystemError(getAddrInfoError(ret)) { } void AddrInfoImpl::init(const std::string& host, unsigned short port) { struct addrinfo hints; // give some useful default values to use for getaddrinfo() memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; init(host, port, hints); } void AddrInfoImpl::init(const std::string& host, unsigned short port, const addrinfo& hints) { if (_ai) { freeaddrinfo(_ai); _ai = 0; } _host = host; _port = port; std::ostringstream p; p << port; while (true) { int ret = ::getaddrinfo(host.empty() ? 0 : host.c_str(), p.str().c_str(), &hints, &_ai); if (ret == 0) break; if (ret == EAI_AGAIN) continue; throw AddrInfoError(ret); } if (_ai == 0) throw SystemError("getaddrinfo"); } AddrInfoImpl::~AddrInfoImpl() { if (_ai) freeaddrinfo(_ai); } const std::string& AddrInfoImpl::host() const { return _host; } unsigned short AddrInfoImpl::port() const { return _port; } } // namespace net } // namespace cxxtools cxxtools-3.0/src/decomposer.cpp0000664000175000017500000000775313644433072013637 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/decomposer.h" #include "cxxtools/formatter.h" namespace cxxtools { void IDecomposer::formatEach(const SerializationInfo& si, Formatter& formatter) { if (si.isNull()) { formatter.addNull( si.name(), si.typeName() ); } else if (si.category() == SerializationInfo::Value) { if (si.isInt()) { int_type value; si.getValue(value); formatter.addValueInt( si.name(), si.typeName(), value ); } else if (si.isUInt()) { unsigned_type value; si.getValue(value); formatter.addValueUnsigned( si.name(), si.typeName(), value ); } else if (si.isBool()) { bool value; si.getValue(value); formatter.addValueBool( si.name(), si.typeName(), value ); } else if (si.isFloat()) { float value; si.getValue(value); formatter.addValueFloat( si.name(), si.typeName(), value ); } else if (si.isDouble()) { double value; si.getValue(value); formatter.addValueDouble( si.name(), si.typeName(), value ); } else if (si.isLongDouble()) { long double value; si.getValue(value); formatter.addValueLongDouble( si.name(), si.typeName(), value ); } else if (si.isString8()) { std::string value; si.getValue(value); formatter.addValueStdString( si.name(), si.typeName(), value ); } else if (si.isChar()) { char value; si.getValue(value); formatter.addValueChar( si.name(), si.typeName(), value ); } else { String value; si.getValue(value); formatter.addValueString( si.name(), si.typeName(), value ); } } else if(si.category() == SerializationInfo::Object) { formatter.beginObject( si.name(), si.typeName() ); SerializationInfo::ConstIterator it; for(it = si.begin(); it != si.end(); ++it) { formatter.beginMember( it->name() ); formatEach(*it, formatter); formatter.finishMember(); } formatter.finishObject(); } else if(si.category() == SerializationInfo::Array) { formatter.beginArray( si.name(), si.typeName() ); SerializationInfo::ConstIterator it; for(it = si.begin(); it != si.end(); ++it) { formatEach(*it, formatter); } formatter.finishArray(); } } } // namespace cxxtools cxxtools-3.0/src/pipeimpl.cpp0000664000175000017500000000546513644433072013314 00000000000000/* * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "pipeimpl.h" #include "cxxtools/systemerror.h" #include #include namespace cxxtools { PipeIODevice::PipeIODevice() : _impl(*this) { } PipeIODevice::~PipeIODevice() { try { IODevice::close(); } catch(...) {} } void PipeIODevice::redirect(int newFd, bool close, bool inherit) { int ret = ::dup2(fd(), newFd); if (ret < 0) throw SystemError("dup2"); if (close) { IODevice::close(); _impl.open(newFd, async(), inherit); } } void PipeIODevice::open(int fd, bool isAsync) { _impl.open(fd, isAsync, true); this->setEnabled(true); this->setAsync(isAsync); this->setEof(false); } PipeImpl::PipeImpl(bool isAsync) { int fds[2]; if(-1 == ::pipe(fds) ) throw SystemError("pipe"); _out.open( fds[0], isAsync ); _in.open( fds[1], isAsync ); } PipeIODevice& PipeImpl::out() { return _out; } const PipeIODevice& PipeImpl::out() const { return _out; } PipeIODevice& PipeImpl::in() { return _in; } const PipeIODevice& PipeImpl::in() const { return _in; } void PipeImpl::redirectStdin(bool close, bool inherit) { out().redirect(0, close, inherit); } void PipeImpl::redirectStdout(bool close, bool inherit) { in().redirect(1, close, inherit); } void PipeImpl::redirectStderr(bool close, bool inherit) { in().redirect(2, close, inherit); } } cxxtools-3.0/src/applicationimpl.h0000664000175000017500000000327513644433072014324 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_APPLICATION_IMPL_H #define CXXTOOLS_APPLICATION_IMPL_H namespace cxxtools { class SelectorBase; class ApplicationImpl { public: ApplicationImpl(); virtual ~ApplicationImpl(); void init(SelectorBase& s); bool catchSystemSignal(int sig); bool raiseSystemSignal(int sig); //int signalFd() const; }; } // namespace cxxtools #endif cxxtools-3.0/src/tcpsocketimpl.h0000664000175000017500000001254413644433072014017 00000000000000/* * Copyright (C) 2006-2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TcpSocketImpl_H #define CXXTOOLS_NET_TcpSocketImpl_H #include "iodeviceimpl.h" #include "cxxtools/net/addrinfo.h" #include "cxxtools/mutex.h" #include "cxxtools/sslcertificate.h" #include "addrinfoimpl.h" #include "config.h" #include #include #include #include #include #include #include #include #include namespace cxxtools { class SelectorBase; class Timespan; namespace net { class TcpServer; class TcpSocket; union Sockaddr { struct sockaddr_storage storage; struct sockaddr sa; struct sockaddr_in sa_in; #ifdef HAVE_IPV6 struct sockaddr_in6 sa_in6; #endif }; void formatIp(const Sockaddr& addr, std::string& str); inline std::string formatIp(const Sockaddr& addr) { std::string ret; formatIp(addr, ret); return ret; } std::string getSockAddr(int fd); class TcpSocketImpl : public IODeviceImpl { private: TcpSocket& _socket; enum State { IDLE, CONNECTING, CONNECTED #ifdef WITH_SSL , SSLACCEPTING, SSLCONNECTING, SSLSHUTTINGDOWN, SSLCONNECTED, THROWING #endif } _state; struct sockaddr_storage _peeraddr; AddrInfo _addrInfo; AddrInfoImpl::const_iterator _addrInfoPtr; std::string _connectResult; std::vector _connectFailedMessages; DestructionSentry* _sentry; #ifdef WITH_SSL // SSL static Mutex _sslMutex; static bool _sslInitialized; SSL_CTX* _sslCtx; SSL* _ssl; mutable bool _peerCertificateLoaded; mutable SslCertificate _peerCertificate; #endif // methods int checkConnect(); size_t callSend(const char* buffer, size_t n); void checkPendingError(); std::string tryConnect(); std::string connectFailedMessages(); #ifdef WITH_SSL void checkSslOperation(int ret, const char* fn, pollfd* pfd); void waitSslOperation(int ret, cxxtools::Timespan timeout); void initSsl(); #endif public: explicit TcpSocketImpl(TcpSocket& socket); ~TcpSocketImpl(); void close(); std::string getSockAddr() const; std::string getPeerAddr() const; bool isConnected() const { return _state >= CONNECTED; } bool isSslConnected() const #ifdef WITH_SSL { return _state == SSLCONNECTED; } #else { return false; } #endif bool beginConnect(const AddrInfo& addrinfo); void endConnect(); void accept(const TcpServer& server, unsigned flags); void terminateAccept(); // implementation using poll void initWait(pollfd& pfd); // implementation using poll bool checkPollEvent(pollfd& pfd); // override beginWrite to use send(2) instead of write(2) virtual size_t beginWrite(const char* buffer, size_t n); // override write to use send(2) instead of write(2) virtual size_t write(const char* buffer, size_t count); // override for ssl virtual size_t read(char* buffer, size_t count, bool& eof); // override for ssl virtual void inputReady(); // override for ssl virtual void outputReady(); #ifdef WITH_SSL void loadSslCertificateFile(const std::string& certFile, const std::string& privateKeyFile); void setSslVerify(int level, const std::string& ca); const SslCertificate& getSslPeerCertificate() const; // initiates a ssl connection on the socket bool beginSslConnect(); void endSslConnect(); // accept a ssl connection from the peer bool beginSslAccept(); void endSslAccept(); // terminates ssl bool beginSslShutdown(); void endSslShutdown(); void verifySslCertificate(); #endif }; } // namespace net } // namespace cxxtools #endif cxxtools-3.0/src/settingswriter.cpp0000664000175000017500000001274413644433072014570 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "settingswriter.h" namespace cxxtools { void SettingsWriter::write(const cxxtools::SerializationInfo& si) { cxxtools::SerializationInfo::ConstIterator it; for(it = si.begin(); it != si.end(); ++it) { if( it->category() == cxxtools::SerializationInfo::Value ) { String value; it->getValue(value); this->writeEntry( it->name(), value, it->typeName() ); *_os << std::endl; } else if( it->category() == cxxtools::SerializationInfo::Object) { // Array types may have no instance-names if( it->findMember("") ) { *_os << cxxtools::String::widen( it->name() ) << cxxtools::String(L" = "); *_os << cxxtools::String::widen( it->typeName() ) << cxxtools::String(L"{ "); this->writeParent( *it, ""); *_os << cxxtools::String(L" }") << std::endl; continue; } //this->writeSection( subdata->name() ); this->writeParent( *it, it->name() ); } } } void SettingsWriter::writeParent(const cxxtools::SerializationInfo& sd, const std::string& prefix) { cxxtools::SerializationInfo::ConstIterator it; for(it = sd.begin(); it != sd.end(); ++it) { if( it->category() == cxxtools::SerializationInfo::Value ) { *_os << cxxtools::String::widen( prefix ) << '.'; String value; it->getValue(value); this->writeEntry( it->name(), value, it->typeName() ); *_os << std::endl; } else if( it->category() == cxxtools::SerializationInfo::Object ) { *_os << cxxtools::String::widen( prefix ) << '.' << cxxtools::String::widen( it->name() ) << cxxtools::String(L" = "); *_os<< cxxtools::String::widen( it->typeName() ) << cxxtools::String(L"{ "); this->writeChild(*it); *_os << cxxtools::String(L" }") << std::endl; } } } void SettingsWriter::writeChild(const cxxtools::SerializationInfo& sd) { bool separate = false; cxxtools::SerializationInfo::ConstIterator it; for(it = sd.begin(); it != sd.end(); ++it) { if(separate) *_os << cxxtools::String(L", "); if( it->category() == cxxtools::SerializationInfo::Value ) { String value; it->getValue(value); writeEntry( it->name(), value, it->typeName() ); } else if( it->category() == cxxtools::SerializationInfo::Object || it->category() == cxxtools::SerializationInfo::Array) { if(it->name().empty() == false && sd.category() != cxxtools::SerializationInfo::Array) *_os << cxxtools::String::widen( it->name() ) << cxxtools::String(L" = "); *_os << cxxtools::String::widen( it->typeName() ) << cxxtools::String(L"{ "); this->writeChild(*it); *_os << cxxtools::String(L" }"); } separate = true; } } void writeEscapedValue(std::basic_ostream& os, const cxxtools::String& value) { for(size_t n = 0; n < value.size(); ++n) { switch( value[n].value() ) { case '\\': os << cxxtools::Char('\\'); default: os << value[n]; } } } void SettingsWriter::writeEntry(const std::string& name, const cxxtools::String& value, const std::string& type) { if( type.empty() ) { if( name.empty() == false) *_os << cxxtools::String::widen(name) << cxxtools::String(L"="); *_os << cxxtools::String(L"\""); writeEscapedValue(*_os, value); *_os << cxxtools::String(L"\""); return; } if( name.empty() == false) *_os << cxxtools::String::widen(name) << cxxtools::String(L" = "); *_os << cxxtools::String::widen(type) << cxxtools::String(L"(\""); writeEscapedValue(*_os, value); *_os << cxxtools::String(L"\")"); } void SettingsWriter::writeSection(const cxxtools::String& prefix) { *_os << cxxtools::String(L"[") << prefix << cxxtools::String(L"]") << std::endl; } } cxxtools-3.0/src/udp.cpp0000664000175000017500000001435013644433072012256 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "addrinfoimpl.h" #include #include #include #include #include #include #include #include #include log_define("cxxtools.net.udp") namespace cxxtools { namespace net { ////////////////////////////////////////////////////////////////////// // UdpSender // UdpSender::UdpSender(const std::string& ipaddr, unsigned short int port, bool bcast) : connected(false) { connect(ipaddr, port, bcast); } void UdpSender::connect(const std::string& ipaddr, unsigned short int port, bool bcast) { struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_DGRAM; AddrInfo ai(new AddrInfoImpl(ipaddr, port, hints)); for (AddrInfoImpl::const_iterator it = ai.impl()->begin(); it != ai.impl()->end(); ++it) { try { Socket::create(it->ai_family, SOCK_DGRAM, 0); } catch (const SystemError&) { continue; } if (bcast) { const int on = 1; if (::setsockopt(getFd(), SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) < 0) throw SystemError("setsockopt"); } if (::connect(getFd(), it->ai_addr, it->ai_addrlen) == 0) { connected = true; return; } } throw SystemError("connect"); } UdpSender::size_type UdpSender::send(const void* message, size_type length, int flags) const { ssize_t ret = ::send(getFd(), message, length, flags); if (ret < 0) throw SystemError("send"); return static_cast(ret); } UdpSender::size_type UdpSender::send(const std::string& message, int flags) const { return send(message.data(), message.size(), flags); } UdpSender::size_type UdpSender::recv(void* buffer, size_type length, int flags) const { ssize_t ret = ::recv(getFd(), buffer, length, flags); if (ret < 0 && errno == EAGAIN) { if (getTimeout() == 0) throw IOTimeout(); poll(POLLIN); ret = ::recv(getFd(), buffer, length, flags); } if (ret < 0) throw SystemError("recv"); return static_cast(ret); } std::string UdpSender::recv(size_type length, int flags) const { std::vector buffer(length); size_type len = recv(&buffer[0], length, flags); return std::string(&buffer[0], len); } ////////////////////////////////////////////////////////////////////// // UdpReceiver // UdpReceiver::UdpReceiver() { memset(&peeraddr, 0, sizeof(peeraddr)); } UdpReceiver::UdpReceiver(const std::string& ipaddr, unsigned short int port) { memset(&peeraddr, 0, sizeof(peeraddr)); bind(ipaddr, port); } void UdpReceiver::bind(const std::string& ipaddr, unsigned short int port) { AddrInfo ai(ipaddr, port); int reuseAddr = 1; for (AddrInfoImpl::const_iterator it = ai.impl()->begin(); it != ai.impl()->end(); ++it) { try { Socket::create(it->ai_family, SOCK_DGRAM, 0); } catch (const SystemError&) { continue; } log_debug("setsockopt"); if (::setsockopt(getFd(), SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)) < 0) throw SystemError(errno, "setsockopt"); log_debug("bind ip " << ipaddr << " port " << port); if (::bind(getFd(), it->ai_addr, it->ai_addrlen) == 0) { memmove(&peeraddr, it->ai_addr, it->ai_addrlen); peeraddrLen = it->ai_addrlen; return; } } throw SystemError(errno, "bind"); } UdpReceiver::size_type UdpReceiver::recv(void* buffer, size_type length, int flags) { log_debug("recvfrom"); ssize_t ret = ::recvfrom(getFd(), buffer, length, flags, reinterpret_cast (&peeraddr), &peeraddrLen); if (ret < 0 && errno == EAGAIN) { if (getTimeout() == 0) throw IOTimeout(); poll(POLLIN); ret = ::recvfrom(getFd(), buffer, length, flags, reinterpret_cast (&peeraddr), &peeraddrLen); } if (ret < 0) throw SystemError("recvfrom"); return static_cast(ret); } std::string UdpReceiver::recv(size_type length, int flags) { std::vector buffer(length); size_type len = recv(&buffer[0], length, flags); return std::string(&buffer[0], len); } UdpReceiver::size_type UdpReceiver::send(const void* message, size_type length, int flags) const { ssize_t ret = ::sendto(getFd(), message, length, flags, reinterpret_cast (&peeraddr), peeraddrLen); if (ret < 0) throw SystemError("sendto"); return static_cast(ret); } UdpReceiver::size_type UdpReceiver::send(const std::string& message, int flags) const { return send(message.data(), message.size(), flags); } } // namespace net } // namespace cxxtools cxxtools-3.0/src/sslcertificate.cpp0000664000175000017500000001042413644433072014470 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "config.h" #ifdef WITH_SSL #include #include "sslcertificateimpl.h" #include #include #endif namespace cxxtools { #ifdef WITH_SSL SslCertificate::SslCertificate(const std::string& filename) : _impl(0) { X509* cert = 0; FILE* fp = fopen(filename.c_str(), "r"); if (fp == 0) throw SystemError(errno, ("fopen(" + filename + ')').c_str()); cert = PEM_read_X509(fp, 0, 0, 0); if (cert == 0) { fclose(fp); SslError::checkSslError(); throw std::runtime_error("failed to read certificate from file \"" + filename + '"'); } fclose(fp); _impl = new SslCertificateImpl(cert); } SslCertificate::SslCertificate(SslCertificateImpl* impl) : _impl(impl) { if (_impl) _impl->addRef(); } SslCertificate::SslCertificate(const SslCertificate& s) : _impl(s._impl) { if (_impl) _impl->addRef(); } SslCertificate& SslCertificate::operator=(const SslCertificate& s) { if (_impl && _impl->release() <= 0) delete _impl; _impl = s._impl; if (_impl) _impl->addRef(); return *this; } SslCertificate::~SslCertificate() { if (_impl && _impl->release() <= 0) delete _impl; } void SslCertificate::clear() { if (_impl) { if (_impl->release() <= 0) delete _impl; _impl = 0; } } String SslCertificate::getSubject() const { if (!_impl) return String(); else return _impl->getSubject(); } String SslCertificate::getIssuer() const { if (!_impl) return String(); else return _impl->getIssuer(); } DateTime SslCertificate::getNotBefore() const { if (!_impl) return DateTime(0, 1, 1, 0, 0, 0); else return _impl->getNotBefore(); } DateTime SslCertificate::getNotAfter() const { if (!_impl) return DateTime(2999, 12, 31, 23, 59, 59, 999); else return _impl->getNotAfter(); } std::string SslCertificate::getSerial() const { if (!_impl) return std::string(); else return _impl->getSerial(); } #else // no ssl enabled - provide just dummies SslCertificate::SslCertificate(const std::string& filename) : _impl(0) { } SslCertificate::SslCertificate(SslCertificateImpl* impl) : _impl(impl) { } SslCertificate::SslCertificate(const SslCertificate& s) : _impl(s._impl) { } SslCertificate& SslCertificate::operator=(const SslCertificate& s) { } SslCertificate::~SslCertificate() { } void SslCertificate::clear() { } String SslCertificate::getSubject() const { return String(); } String SslCertificate::getIssuer() const { return String(); } DateTime SslCertificate::getNotBefore() const { return DateTime(0, 1, 1, 0, 0, 0); } DateTime SslCertificate::getNotAfter() const { return DateTime(2999, 12, 31, 23, 59, 59, 999); } std::string SslCertificate::getSerial() const { return std::string(); } #endif } cxxtools-3.0/src/selectableimpl.h0000664000175000017500000000375113644433072014123 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_SELECTABLEIMPL_H #define CXXTOOLS_SYSTEM_SELECTABLEIMPL_H #include #include struct pollfd; namespace cxxtools { class SelectorImpl; class SelectableImpl { public: virtual ~SelectableImpl() {} virtual void close() = 0; virtual bool wait(Timespan timeout)= 0; virtual std::size_t pollSize() const = 0; virtual std::size_t initializePoll(pollfd* pfd, std::size_t pollSize) = 0; virtual bool checkPollEvent() = 0; }; } //namespace cxxtools #endif cxxtools-3.0/src/csvparser.cpp0000664000175000017500000003065113644433072013500 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include log_define("cxxtools.csv.parser") namespace cxxtools { namespace { const unsigned unknownNoColumns = std::numeric_limits::max(); void checkNoColumns(unsigned column, unsigned& noColumns, unsigned lineNo) { if (noColumns == unknownNoColumns) { column = noColumns; } else if (column + 1 != noColumns) { std::ostringstream msg; msg << "number of columns " << (column + 1) << " in line " << lineNo << " does not match expected number of columns " << noColumns << " in csv"; SerializationError::doThrow(msg.str()); } } } const Char CsvParser::autoDelimiter = L'\0'; void CsvParser::begin(CsvDeserializer& handler) { if (_delimiter == autoDelimiter && !_readTitle) throw std::logic_error("can't read csv data with auto delimiter but without title"); _state = (_readTitle ? _delimiter == autoDelimiter ? state_detectDelim : state_title : state_rowstart); _deserializer = &handler; _titles.clear(); _titles.push_back(std::string()); _noColumns = unknownNoColumns; _lineNo = 0; } void CsvParser::advance(Char ch) { if (ch == L'\n') ++_lineNo; switch (_state) { case state_detectDelim: if (isalnum(ch) || ch == L'_' || ch == L' ') { _titles.back() += ch.narrow(); } else if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _noColumns = 1; _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == L'\'' || ch == L'"') { _quote = ch; _state = state_detectDelim_q; } else { _delimiter = ch; log_debug("delimiter=" << _delimiter.narrow()); log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); _state = state_title; } break; case state_detectDelim_q: if (ch == _quote) { _state = state_detectDelim_postq; } else { _titles.back() += ch.narrow(); } break; case state_detectDelim_postq: if (isalnum(ch) || ch == L'_' || ch == L'\'' || ch == L'"' || ch == L' ') { std::ostringstream msg; msg << "invalid character '" << ch.narrow() << "' within csv title of column " << _titles.size(); SerializationError::doThrow(msg.str()); } else if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _noColumns = 1; _state = (ch == L'\r' ? state_cr : state_rowstart); } else { _delimiter = ch; log_debug("delimiter=" << _delimiter.narrow()); log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); _state = state_title; } break; case state_title: if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _state = (ch == L'\r' ? state_cr : state_rowstart); _noColumns = _titles.size(); } else if (ch == _delimiter) { log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); } else if (ch == L'\'' || ch == L'\"') { if (_titles.back().empty()) { _quote = ch; _state = state_qtitle; } else { std::ostringstream msg; msg << "unexpected quote character within csv title of column " << _titles.size(); SerializationError::doThrow(msg.str()); } } else { _titles.back() += ch.narrow(); } break; case state_qtitle: if (ch == _quote) { _state = state_qtitlep; } else { _titles.back() += ch.narrow(); } break; case state_qtitlep: if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _state = (ch == L'\r' ? state_cr : state_rowstart); _noColumns = _titles.size(); } else if (ch == _delimiter) { log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); _state = state_title; } else { std::ostringstream msg; msg << "invalid character '" << ch.narrow() << "' within csv title of column " << _titles.size(); SerializationError::doThrow(msg.str()); } break; case state_cr: _state = state_rowstart; if (ch == L'\n') { break; } // fallthrough case state_rowstart: _column = 0; log_debug("new row"); _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Object); _state = state_datastart; // no break case state_datastart: log_debug("member \"" << (_column < _titles.size() ? _titles[_column] : std::string()) << '"'); _deserializer->beginMember( _column < _titles.size() ? _titles[_column] : std::string(), std::string(), SerializationInfo::Value); if (ch == L'\n' || ch == L'\r') { _deserializer->leaveMember(); checkNoColumns(_column, _noColumns, _lineNo); _deserializer->leaveMember(); _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == L'"' || ch == L'\'') { _quote = ch; _state = state_qdata; } else if (ch == _delimiter) { ++_column; _deserializer->leaveMember(); } else { _value += ch; _state = state_data; } break; case state_data0: if (ch == L'"' || ch == L'\'') { _quote = ch; _state = state_qdata; break; } _state = state_data; // fallthrough case state_data: if (ch == L'\n' || ch == L'\r') { log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); checkNoColumns(_column, _noColumns, _lineNo); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == _delimiter) { log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); _deserializer->leaveMember(); // leave data item ++_column; log_debug("member \"" << (_column < _titles.size() ? _titles[_column] : std::string()) << '"'); _deserializer->beginMember( _column < _titles.size() ? _titles[_column] : std::string(), std::string(), SerializationInfo::Value); _state = state_data0; } else { _value += ch; } break; case state_qdata: if (ch == _quote) { //it can be a double _quote, used to allow usage of _quote _state = state_qdata_end; } else { _value += ch; } break; case state_qdata_end: if (ch == _quote) { //it is indeed a double_quote. Add one. _value += ch; _state = state_qdata; break; } //it is not a double _quote. End the _value log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); _deserializer->leaveMember(); // leave data item if (ch == L'\n' || ch == L'\r') { checkNoColumns(_column, _noColumns, _lineNo); _deserializer->leaveMember(); // leave row _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == _delimiter) { ++_column; log_debug("member \"" << (_column < _titles.size() ? _titles[_column] : std::string()) << '"'); _deserializer->beginMember( _column < _titles.size() ? _titles[_column] : std::string(), std::string(), SerializationInfo::Value); _state = state_data0; } else { _value = _quote + _value + ch; _state = state_data; } break; } } void CsvParser::finish() { switch (_state) { case state_datastart: _deserializer->leaveMember(); // leave row break; case state_data0: case state_data: checkNoColumns(_column, _noColumns, _lineNo); _deserializer->setValue(_value); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row break; case state_qdata: checkNoColumns(_column, _noColumns, _lineNo); log_debug("value \"" << _quote.narrow() << _value << '"'); _deserializer->setValue(_quote + _value); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row break; case state_qdata_end: log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row break; default: ; } } } cxxtools-3.0/src/propertiesfile.cpp0000664000175000017500000000504213644433072014520 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include namespace cxxtools { namespace { class PropertiesEvent : public PropertiesParser::Event { PropertiesFile& properties; String key; public: PropertiesEvent(PropertiesFile& properties_) : properties(properties_) { } bool onKeyPart(const String& key); bool onKey(const String& key); bool onValue(const String& value); }; bool PropertiesEvent::onKeyPart(const String&) { return false; } bool PropertiesEvent::onKey(const String& key_) { key = key_; return false; } bool PropertiesEvent::onValue(const String& value) { properties.setValue(key, value); return false; } } PropertiesFile::PropertiesFile(const std::string& filename) { PropertiesEvent ev(*this); std::ifstream in(filename.c_str()); if (!in) throw PropertiesParserError("could not open properties file \"" + filename + '"'); PropertiesParser(ev).parse(in); } PropertiesFile::PropertiesFile(std::istream& in) { PropertiesEvent ev(*this); PropertiesParser(ev).parse(in); } } cxxtools-3.0/src/settingsreader.cpp0000664000175000017500000001103413644433072014505 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "settingsreader.h" namespace cxxtools { void SettingsReader::State::syntaxError(unsigned line) { throw SettingsError("syntax error", line); } void SettingsReader::parse(cxxtools::SerializationInfo& si) { while (!_current.empty()) _current.pop(); _current.push(&si); state = BeginStatement::instance(); _line = 1; _isDotted = false; Char ch = Char(0); while ( _is->get(ch) ) { state = state->onChar(ch, *this); if(ch == '\n') { ++_line; } } // if exceptions are deactivated caller must check // istream for failure if( _is->bad() ) return; state->onEof(*this); } void SettingsReader::enterMember() { // // Consider namespace at top-level. For example a.b.c means c // as a child of a.b. both are only added when not present. // If we are not top-level, always add a node. // if( _depth == 0 ) { std::string name; if( _section.size() ) { name += _section.narrow(); name += '.'; name += _token.narrow(); } else { name = _token.narrow(); } // // Add a serialization node for the parent if not present. // In this example the parent is a.b // size_t pos = name.rfind('.'); if(pos != std::string::npos) { std::string root = name.substr( 0, pos ); cxxtools::SerializationInfo* c = current()->findMember( root ); if(c == 0) c = &( current()->addMember( root ) ); _current.push(c); ++_depth; _isDotted = true; // remember that we have to leave twice later name = name.substr( ++pos ); // TODO: use remove or erase } // // Add a node for the actual value if not present. In this // example c is a parent of a.b // cxxtools::SerializationInfo* c = current()->findMember( name ); if(c == 0) c = &( current()->addMember( name ) ); _current.push(c); } else { _current.push( &( current()->addMember( _token.narrow() ) ) ); } ++_depth; _token.clear(); } void SettingsReader::leaveMember() { //std::cerr << "@" << std::endl; if (_current.empty()) throw SettingsError("too many closing braces", _line); _current.pop(); --_depth; if(_depth == 1 && _isDotted) { // leaving a dotted entry _current.pop(); _isDotted = false; --_depth; } } void SettingsReader::pushValue() { current()->setValue(_token); _token.clear(); } void SettingsReader::pushTypeName() { current()->setTypeName( _token.narrow() ); _token.clear(); } void SettingsReader::pushName() { current()->setName( _token.narrow() ); _token.clear(); } cxxtools::Char SettingsReader::getEscaped() { cxxtools::Char ch; if( ! _is->get(ch) ) throw SettingsError("unexpected EOF", _line); switch( ch.value() ) { case 'n': return cxxtools::Char(L'\n'); case 'r': return cxxtools::Char(L'\r'); } return ch; } } cxxtools-3.0/src/inifile.cpp0000664000175000017500000000665613644433072013117 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include log_define("cxxtools.inifile") namespace cxxtools { namespace { class IniFileEvent : public IniParser::Event { IniFile& iniFile; String section; String key; public: IniFileEvent(IniFile& iniFile_) : iniFile(iniFile_) { } bool onSection(const String& section); bool onKey(const String& key); bool onValue(const String& value); }; bool IniFileEvent::onSection(const String& section_) { log_debug("section \"" << section_ << '"'); section = section_; return false; } bool IniFileEvent::onKey(const String& key_) { log_debug("key \"" << key_ << '"'); key = key_; return false; } bool IniFileEvent::onValue(const String& value) { log_debug("value(" << section << ", " << key << ")=" << value); iniFile.setValue(section, key, value); return false; } } IniFile::IniFile(const std::string& filename) { log_debug("read ini-file \"" << filename << '"'); std::ifstream in(filename.c_str()); if (!in) throw std::runtime_error("could not open file \"" + filename + '"'); IniFileEvent ev(*this); IniParser(ev).parse(in); } IniFile::IniFile(std::istream& in, TextCodec* codec) { IniFileEvent ev(*this); IniParser(ev).parse(in); } std::istream& operator >> (std::istream& in, IniFile& ini) { ini.data.clear(); IniFileEvent ev(ini); IniParser(ev).parse(in); return in; } std::ostream& operator << (std::ostream& out, const IniFile& ini) { for (IniFile::MapType::const_iterator si = ini.data.begin(); si != ini.data.end(); ++si) { out << '[' << si->first << "]\n"; for (IniFile::MapType::mapped_type::const_iterator it = si->second.begin(); it != si->second.end(); ++it) out << it->first << '=' << it->second << '\n'; } return out; } } cxxtools-3.0/src/propertiesdeserializer.cpp0000664000175000017500000001233113644433072016262 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include log_define("cxxtools.properties.deserializer") namespace cxxtools { PropertiesDeserializer::PropertiesDeserializer(std::istream& in, TextCodec* codec) : _envSubst(false), _trim(false) { TextIStream s(in, codec); doDeserialize(s); } PropertiesDeserializer::PropertiesDeserializer(std::basic_istream& in) : _envSubst(false), _trim(false) { doDeserialize(in); } PropertiesDeserializer::PropertiesDeserializer() : _envSubst(false), _trim(false) { } void PropertiesDeserializer::read(std::istream& in, TextCodec* codec) { TextIStream s(in, codec); doDeserialize(s); } void PropertiesDeserializer::read(std::basic_istream& in) { doDeserialize(in); } class PropertiesDeserializer::Ev : public PropertiesParser::Event { PropertiesDeserializer& _deserializer; std::vector _keys; public: Ev(PropertiesDeserializer& deserializer) : _deserializer(deserializer) { } virtual bool onKeyPart(const String& key); virtual bool onKey(const String& key); virtual bool onValue(const String& value); }; bool PropertiesDeserializer::Ev::onKeyPart(const String& key) { log_finer("onKeyPart(" << key << ')'); _keys.push_back(Utf8Codec::encode(key)); return false; } bool PropertiesDeserializer::Ev::onKey(const String& key) { log_finer("onKey(" << key << ')'); return false; } namespace { void addValue(SerializationInfo& si, const std::string& key, const std::vector& keys, unsigned idx, const String& value) { log_trace("val key=" << key << " keys.size=" << keys.size() << " idx=" << idx << " value=" << value); std::string k = join(keys.begin() + idx, keys.end(), '.'); log_debug("key " << k << " value " << value); si.getAddMember(k).setValue(value); SerializationInfo& sia = si.getAddMember(key); for (unsigned n = idx + 1; n < keys.size(); ++n) { addValue(sia, join(keys.begin() + idx + 1, keys.begin() + n + 1, '.'), keys, n, value); addValue(si, join(keys.begin(), keys.begin() + n + 1, '.'), keys, n, value); } } void addValue(SerializationInfo& si, const std::vector& keys, const String& value) { if (keys.empty()) return; SerializationInfo& sia = si.getAddMember(keys[0]); if (keys.size() == 1) { log_debug("key " << keys[0] << " value " << value << "(1)"); sia.setValue(value); } else if (keys.size() > 1) addValue(si, keys[0], keys, 0, value); } } bool PropertiesDeserializer::Ev::onValue(const String& value) { log_finer("onValue(" << value << ')'); String v = value; if (_deserializer._envSubst) { v = Utf8Codec::decode(cxxtools::envSubst(Utf8Codec::encode(v))); } addValue(*_deserializer.current(), _keys, v); _keys.clear(); return false; } void PropertiesDeserializer::doDeserialize(std::basic_istream& in) { begin(); Ev ev(*this); PropertiesParser parser(ev, _trim); parser.parse(in); if (in.rdstate() & std::ios::badbit) SerializationError::doThrow("propertiesdeserialization failed"); } } cxxtools-3.0/src/xmlrpc/0000775000175000017500000000000013672344760012352 500000000000000cxxtools-3.0/src/xmlrpc/service.cpp0000664000175000017500000000351313644433072014432 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/service.h" #include "cxxtools/xmlrpc/responder.h" #include "cxxtools/http/request.h" namespace cxxtools { namespace xmlrpc { Service::~Service() { } http::Responder* Service::createResponder(const http::Request& req) { if (req.header().isHeaderValue("Content-Type", "text/xml")) return new XmlRpcResponder(*this); return 0; } void Service::releaseResponder(http::Responder* resp) { delete resp; } } } cxxtools-3.0/src/xmlrpc/Makefile.in0000664000175000017500000005601613644433103014334 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/xmlrpc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_xmlrpc_la_DEPENDENCIES = \ $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la am_libcxxtools_xmlrpc_la_OBJECTS = client.lo clientimpl.lo \ httpclient.lo httpclientimpl.lo formatter.lo responder.lo \ scanner.lo service.lo libcxxtools_xmlrpc_la_OBJECTS = $(am_libcxxtools_xmlrpc_la_OBJECTS) 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 = libcxxtools_xmlrpc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcxxtools_xmlrpc_la_LDFLAGS) \ $(LDFLAGS) -o $@ 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/client.Plo \ ./$(DEPDIR)/clientimpl.Plo ./$(DEPDIR)/formatter.Plo \ ./$(DEPDIR)/httpclient.Plo ./$(DEPDIR)/httpclientimpl.Plo \ ./$(DEPDIR)/responder.Plo ./$(DEPDIR)/scanner.Plo \ ./$(DEPDIR)/service.Plo am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(libcxxtools_xmlrpc_la_SOURCES) DIST_SOURCES = $(libcxxtools_xmlrpc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-xmlrpc.la libcxxtools_xmlrpc_la_SOURCES = \ client.cpp \ clientimpl.cpp \ httpclient.cpp \ httpclientimpl.cpp \ formatter.cpp \ responder.cpp \ scanner.cpp \ service.cpp noinst_HEADERS = \ clientimpl.h \ httpclientimpl.h libcxxtools_xmlrpc_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_xmlrpc_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xmlrpc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/xmlrpc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-xmlrpc.la: $(libcxxtools_xmlrpc_la_OBJECTS) $(libcxxtools_xmlrpc_la_DEPENDENCIES) $(EXTRA_libcxxtools_xmlrpc_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcxxtools_xmlrpc_la_LINK) -rpath $(libdir) $(libcxxtools_xmlrpc_la_OBJECTS) $(libcxxtools_xmlrpc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclient.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclientimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/client.Plo -rm -f ./$(DEPDIR)/clientimpl.Plo -rm -f ./$(DEPDIR)/formatter.Plo -rm -f ./$(DEPDIR)/httpclient.Plo -rm -f ./$(DEPDIR)/httpclientimpl.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/scanner.Plo -rm -f ./$(DEPDIR)/service.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/client.Plo -rm -f ./$(DEPDIR)/clientimpl.Plo -rm -f ./$(DEPDIR)/formatter.Plo -rm -f ./$(DEPDIR)/httpclient.Plo -rm -f ./$(DEPDIR)/httpclientimpl.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/scanner.Plo -rm -f ./$(DEPDIR)/service.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES 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 uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/src/xmlrpc/scanner.cpp0000664000175000017500000003023113644433072014420 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include namespace cxxtools { namespace xmlrpc { namespace { void throwSerializationError(const char* msg = "invalid XML-RPC parameter") { SerializationError::doThrow(msg); } } void Scanner::begin(Deserializer& handler, IComposer& composer) { _state = OnParam; _deserializer = &handler; _composer = &composer; _deserializer->begin(); } bool Scanner::advance(const cxxtools::xml::Node& node) { switch(_state) { case OnParam: { if(node.type() == xml::Node::StartElement) // value { const xml::StartElement& se = static_cast(node); if(se.name() != L"value") throwSerializationError(); _state = OnValueBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnValueBegin: { if(node.type() == xml::Node::StartElement) // i4, struct, array... { const xml::StartElement& se = static_cast(node); if(se.name() == L"struct") { _state = OnStructBegin; } else if(se.name() == L"array") { _state = OnArrayBegin; } else { _state = OnScalarBegin; } _value.clear(); _type = se.name(); } else if(node.type() == xml::Node::Characters) { // maybe ......... (case 1) // or ... (case 2) const xml::Characters& chars = static_cast(node); _value = chars.content(); } else if(node.type() == xml::Node::EndElement) { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"value") throwSerializationError(); // is always type string _deserializer->setValue( _value ); _value.clear(); _state = OnValueEnd; } else { throwSerializationError(); } break; } case OnValueEnd: { if(node.type() == xml::Node::EndElement) { const xml::EndElement& ee = static_cast(node); if(ee.name() == L"member") { _deserializer->leaveMember(); _state = OnStructBegin; } else if(ee.name() == L"data") { _deserializer->leaveMember(); _state = OnDataEnd; } else if(ee.name() == L"param" || ee.name() == L"fault") { _composer->fixup(_deserializer->si()); return true; } else { throwSerializationError(); } } else if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast(node); if(se.name() == L"value") { _deserializer->leaveMember(); _deserializer->beginMember(std::string(), _type.narrow(), SerializationInfo::Value); _state = OnValueBegin; } else { throwSerializationError(); } } break; } case OnStructBegin: { if(node.type() == xml::Node::StartElement) // { const xml::StartElement& se = static_cast(node); if(se.name() != L"member") throwSerializationError(); _state = OnMemberBegin; } else if(node.type() == xml::Node::EndElement) // { _state = OnStructEnd; } break; } case OnStructEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"value") throwSerializationError(); _state = OnValueEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnMemberBegin: { if(node.type() == xml::Node::StartElement) // name { const xml::StartElement& se = static_cast(node); if(se.name() != L"name") throwSerializationError(); _state = OnNameBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnNameBegin: { if(node.type() == xml::Node::Characters) // member-name { const xml::Characters& chars = static_cast(node); const std::string& name = chars.content().narrow(); _deserializer->beginMember(name, std::string(), SerializationInfo::Object); _state = OnName; } else { throwSerializationError(); } break; } case OnName: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"name") throwSerializationError(); _state = OnNameEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnNameEnd: { if(node.type() == xml::Node::StartElement) // { const xml::StartElement& se = static_cast(node); if(se.name() != L"value") throwSerializationError(); _state = OnValueBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnScalarBegin: { if(node.type() == xml::Node::Characters) { const xml::Characters& chars = static_cast(node); _state = OnScalar; _deserializer->setValue( chars.content() ); } else if(node.type() == xml::Node::EndElement) // no content, for example empty strings { _deserializer->setValue( cxxtools::String() ); _state = OnScalarEnd; } else { throwSerializationError(); } break; } case OnScalar: { if(node.type() == xml::Node::EndElement) // , boolean ... { _state = OnScalarEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnScalarEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"value") throwSerializationError(); _state = OnValueEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnArrayBegin: { if(node.type() == xml::Node::StartElement) // { const xml::StartElement& se = static_cast(node); if(se.name() != L"data") throwSerializationError(); _state = OnDataBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnDataBegin: { if(node.type() == xml::Node::StartElement) // value { _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Array); _state = OnValueBegin; } else if(node.type() == xml::Node::EndElement) // empty array { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"data") throwSerializationError(); _state = OnDataEnd; } break; } case OnDataEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"array") throwSerializationError(); _state = OnArrayEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnArrayEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if(ee.name() != L"value") throwSerializationError(); _state = OnValueEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } } return false; } } } cxxtools-3.0/src/xmlrpc/clientimpl.h0000664000175000017500000000764713644433072014613 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_ClientImpl_h #define cxxtools_xmlrpc_ClientImpl_h #include #include #include #include #include #include #include #include #include #include #include namespace cxxtools { class IRemoteProcedure; namespace xmlrpc { class ClientImpl : public cxxtools::Connectable { enum State { OnBegin, OnMethodResponseBegin, OnFaultBegin, OnFaultEnd, OnFaultResponseEnd, OnParamsBegin, OnParam, OnParamEnd, OnParamsEnd, OnMethodResponseEnd }; public: ClientImpl(); virtual ~ClientImpl(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Milliseconds timeout() const { return _timeout; } void timeout(Milliseconds t) { _timeout = t; if (!_connectTimeoutSet) _connectTimeout = t; } Milliseconds connectTimeout() const { return _connectTimeout; } void connectTimeout(Milliseconds t) { _connectTimeout = t; _connectTimeoutSet = true; } virtual std::string url() const = 0; const IRemoteProcedure* activeProcedure() const; virtual void cancel(); protected: void onReadReplyBegin(std::istream& is); std::size_t onReadReply(); void onReplyFinished(); virtual void beginExecute() = 0; virtual void endExecute() = 0; virtual std::istream& execute() = 0; virtual std::ostream& prepareRequest() = 0; protected: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void advance(const xml::Node& node); State _state; TextIStream _ts; xml::XmlReader _reader; xml::XmlWriter _writer; Formatter _formatter; Deserializer _deserializer; Scanner _scanner; IRemoteProcedure* _method; RemoteException _fault; Composer _fh; Milliseconds _timeout; bool _connectTimeoutSet; // indicates if connectTimeout is explicitely set // when not, it follows the setting of _timeout Milliseconds _connectTimeout; bool _errorPending; }; } } #endif cxxtools-3.0/src/xmlrpc/httpclient.cpp0000664000175000017500000001132113644433072015144 00000000000000/* * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/httpclient.h" #include "cxxtools/net/uri.h" #include "cxxtools/net/addrinfo.h" #include "httpclientimpl.h" #include namespace cxxtools { namespace xmlrpc { HttpClientImpl* HttpClient::getImpl() { if (_impl == 0) { _impl = new HttpClientImpl(); _impl->addRef(); impl(_impl); } return _impl; } HttpClient::HttpClient(const HttpClient& other) : Client(*this), _impl(other._impl) { if (_impl) { _impl->addRef(); impl(_impl); } } HttpClient& HttpClient::operator= (const HttpClient& other) { if (_impl == other._impl) return *this; if (_impl && _impl->release() <= 0) delete _impl; _impl = other._impl; if (_impl) _impl->addRef(); impl(_impl); return *this; } HttpClient::~HttpClient() { if (_impl && _impl->release() <= 0) delete _impl; } void HttpClient::prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, bool ssl) { getImpl()->prepareConnect(addrinfo, url, ssl); } void HttpClient::prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, const std::string& sslCertificate) { getImpl()->prepareConnect(addrinfo, url, sslCertificate); } void HttpClient::prepareConnect(const std::string& host, unsigned short int port, const std::string& url, bool ssl) { prepareConnect(net::AddrInfo(host, port), url, ssl); } void HttpClient::prepareConnect(const std::string& host, unsigned short int port, const std::string& url, const std::string& sslCertificate) { prepareConnect(net::AddrInfo(host, port), url, sslCertificate); } void HttpClient::prepareConnect(const net::Uri& uri) { #ifdef WITH_SSL if (uri.protocol() != "http" && uri.protocol() != "https") throw std::runtime_error("only protocols \"http\" and \"https\" are supported by xmlrpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.protocol() == "https", uri.path()); #else if (uri.protocol() != "http") throw std::runtime_error("only protocol \"http\" is supported by xmlrpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.path()); #endif auth(uri.user(), uri.password()); } void HttpClient::prepareConnect(const net::Uri& uri, const std::string& sslCertificate) { #ifdef WITH_SSL if (uri.protocol() != "http" && uri.protocol() != "https") throw std::runtime_error("only protocols \"http\" and \"https\" are supported by xmlrpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.path(), sslCertificate); #else if (uri.protocol() != "http") throw std::runtime_error("only protocol \"http\" is supported by xmlrpc client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.path()); #endif auth(uri.user(), uri.password()); } void HttpClient::connect() { getImpl()->connect(); } void HttpClient::url(const std::string& url) { getImpl()->url(url); } void HttpClient::auth(const std::string& username, const std::string& password) { getImpl()->auth(username, password); } void HttpClient::clearAuth() { getImpl()->clearAuth(); } void HttpClient::setSelector(SelectorBase* selector) { getImpl()->setSelector(selector); } void HttpClient::setSslVerify(int level, const std::string& ca) { getImpl()->setSslVerify(level, ca); } void HttpClient::wait(Milliseconds msecs) { getImpl()->wait(msecs); } } } cxxtools-3.0/src/xmlrpc/Makefile.am0000664000175000017500000000103113644433072014313 00000000000000AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-xmlrpc.la libcxxtools_xmlrpc_la_SOURCES = \ client.cpp \ clientimpl.cpp \ httpclient.cpp \ httpclientimpl.cpp \ formatter.cpp \ responder.cpp \ scanner.cpp \ service.cpp noinst_HEADERS = \ clientimpl.h \ httpclientimpl.h libcxxtools_xmlrpc_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_xmlrpc_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ cxxtools-3.0/src/xmlrpc/httpclientimpl.h0000664000175000017500000000674613644433072015512 00000000000000/* * Copyright (C) 2009 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_HttpClientImpl_h #define cxxtools_xmlrpc_HttpClientImpl_h #include #include #include #include "clientimpl.h" namespace cxxtools { namespace net { class AddrInfo; } namespace xmlrpc { class HttpClientImpl : public RefCounted, public ClientImpl { public: HttpClientImpl(); void prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, bool ssl) { _client.prepareConnect(addrinfo, ssl); _request.url(url); } void prepareConnect(const net::AddrInfo& addrinfo, const std::string& url, const std::string& sslCertificate) { _client.prepareConnect(addrinfo, sslCertificate); _request.url(url); } void connect() { _client.connect(); } void url(const std::string& url) { _request.url(url); } void auth(const std::string& username, const std::string& password) { _client.auth(username, password); } void clearAuth() { _client.clearAuth(); } void setSelector(SelectorBase* selector) { _client.setSelector(selector); } void setSelector(SelectorBase& selector) { _client.setSelector(&selector); } void setSslVerify(int level, const std::string& ca) { _client.setSslVerify(level, ca); } std::string url() const; virtual void wait(std::size_t msecs); protected: void onReplyHeader(http::Client& client); std::size_t onReplyBody(http::Client& client); void onReplyFinished(http::Client& client); virtual void beginExecute(); virtual void endExecute(); virtual std::istream& execute(); virtual std::ostream& prepareRequest(); virtual void cancel(); private: static void verifyHeader(const http::ReplyHeader& header); http::Client _client; http::Request _request; }; } } #endif cxxtools-3.0/src/xmlrpc/client.cpp0000664000175000017500000000456613644433072014261 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/client.h" #include "clientimpl.h" namespace cxxtools { namespace xmlrpc { Client::~Client() { } void Client::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void Client::endCall() { _impl->endCall(); } void Client::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } Milliseconds Client::timeout() const { return _impl->timeout(); } void Client::timeout(Milliseconds t) { _impl->timeout(t); } Milliseconds Client::connectTimeout() const { return _impl->connectTimeout(); } void Client::connectTimeout(Milliseconds t) { _impl->connectTimeout(t); } std::string Client::url() const { return _impl->url(); } const IRemoteProcedure* Client::activeProcedure() const { return _impl == 0 ? 0 : _impl->activeProcedure(); } void Client::cancel() { if (_impl) _impl->cancel(); } } } cxxtools-3.0/src/xmlrpc/httpclientimpl.cpp0000664000175000017500000001132413644433072016031 00000000000000/* * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "httpclientimpl.h" #include "cxxtools/log.h" #include "cxxtools/http/replyheader.h" #include "cxxtools/ioerror.h" #include "cxxtools/remoteclient.h" #include "cxxtools/clock.h" #include log_define("cxxtools.xmlrpc.httpclient.impl") namespace cxxtools { namespace xmlrpc { HttpClientImpl::HttpClientImpl() { _request.method("POST"); cxxtools::connect(_client.headerReceived, *this, &HttpClientImpl::onReplyHeader); cxxtools::connect(_client.bodyAvailable, *this, &HttpClientImpl::onReplyBody); cxxtools::connect(_client.replyFinished, *this, &HttpClientImpl::onReplyFinished); } std::string HttpClientImpl::url() const { std::ostringstream s; s << "http://" << _client.host() << ':' << _client.port() << _request.url(); return s.str(); } void HttpClientImpl::onReplyHeader(http::Client& client) { log_debug("httpReturnCode=" << client.header().httpReturnCode() << " content-type=" << client.header().getHeader("Content-Type")); verifyHeader(client.header()); ClientImpl::onReadReplyBegin(client.in()); } std::size_t HttpClientImpl::onReplyBody(http::Client& /*client*/) { return ClientImpl::onReadReply(); } void HttpClientImpl::onReplyFinished(http::Client& /*client*/) { ClientImpl::onReplyFinished(); } void HttpClientImpl::beginExecute() { _client.beginExecute(_request); } void HttpClientImpl::endExecute() { if (_errorPending) { _errorPending = false; throw; } _client.endExecute(); } std::istream& HttpClientImpl::execute() { _client.execute(_request, timeout(), connectTimeout()); try { verifyHeader(_client.header()); _client.readBody(); return _client.reply().bodyStream(); } catch (...) { _client.cancel(); throw; } } std::ostream& HttpClientImpl::prepareRequest() { _request.clear(); _request.setHeader("Content-Type", "text/xml"); _request.method("POST"); return _request.body(); } void HttpClientImpl::cancel() { _client.cancel(); ClientImpl::cancel(); } void HttpClientImpl::wait(std::size_t msecs) { if (!_client.selector()) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (msecs != RemoteClient::WaitInfinite) clock.start(); std::size_t remaining = msecs; while (activeProcedure() != 0) { if (_client.selector()->wait(remaining) == false) throw IOTimeout(); if (msecs != RemoteClient::WaitInfinite) { std::size_t diff = static_cast(clock.stop().totalMSecs()); remaining = diff >= msecs ? 0 : msecs - diff; } } } void HttpClientImpl::verifyHeader(const http::ReplyHeader& header) { if (header.httpReturnCode() != 200) { std::ostringstream msg; msg << "invalid http return code " << header.httpReturnCode() << ": " << header.httpReturnText(); throw std::runtime_error(msg.str()); } const char* contentType = header.getHeader("Content-Type"); if (contentType == 0) throw std::runtime_error("missing content type header"); if (::strncasecmp(contentType, "text/xml", 8) != 0) { std::ostringstream msg; msg << "invalid content type " << contentType; throw std::runtime_error(msg.str()); } } } } cxxtools-3.0/src/xmlrpc/formatter.cpp0000664000175000017500000000601413644433072014774 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace xmlrpc { void Formatter::addValueString(const std::string& /*name*/, const std::string& type, const cxxtools::String& value) { _writer->writeStartElement( L"value" ); if (type == "string" || type.empty()) { _writer->writeCharacters(value); } else { std::map::iterator it = _typemap.find(type); if( it != _typemap.end() ) _writer->writeElement( cxxtools::String::widen(it->second), value ); else _writer->writeElement( cxxtools::String::widen(type), value ); } _writer->writeEndElement(); } void Formatter::beginArray(const std::string&, const std::string&) { _writer->writeStartElement( L"value" ); _writer->writeStartElement( L"array" ); _writer->writeStartElement( L"data" ); } void Formatter::finishArray() { _writer->writeEndElement(); _writer->writeEndElement(); _writer->writeEndElement(); } void Formatter::beginObject(const std::string& /*name*/, const std::string& /*type*/) { _writer->writeStartElement( L"value" ); _writer->writeStartElement( L"struct" ); } void Formatter::beginMember(const std::string& name) { _writer->writeStartElement( L"member" ); _writer->writeElement( L"name", cxxtools::String::widen(name) ); } void Formatter::finishMember() { _writer->writeEndElement(); } void Formatter::finishObject() { _writer->writeEndElement(); _writer->writeEndElement(); } void Formatter::finish() { _writer->writeEndElement(); } } } cxxtools-3.0/src/xmlrpc/clientimpl.cpp0000664000175000017500000002466513644433072015145 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/client.h" #include "clientimpl.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/xml/xmlerror.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/selectable.h" #include "cxxtools/utf8codec.h" #include "cxxtools/xmlrpc/errorcodes.h" #include "cxxtools/serializationerror.h" #include "cxxtools/log.h" #include log_define("cxxtools.xmlrpc.client.impl") namespace cxxtools { inline void operator >>=(const cxxtools::SerializationInfo& si, RemoteException& fault) { int faultCode; std::string faultString; si.getMember("faultCode") >>= faultCode; si.getMember("faultString") >>= faultString; fault.rc(faultCode); fault.text(faultString); } inline void operator <<=(cxxtools::SerializationInfo& si, const RemoteException& fault) { si.addMember("faultCode") <<= fault.rc(); si.addMember("faultString") <<= fault.text(); } namespace xmlrpc { namespace { static const String methodCall = L"methodCall"; static const String methodName = L"methodName"; static const String params = L"params"; static const String param = L"param"; } ClientImpl::ClientImpl() : _state(OnBegin) , _ts( new Utf8Codec ) , _reader(_ts) , _formatter(_writer) , _method(0) , _timeout(Selectable::WaitInfinite) , _connectTimeoutSet(false) , _connectTimeout(Selectable::WaitInfinite) , _errorPending(false) { _writer.useIndent(false); _writer.useEndl(false); _formatter.addAlias("bool", "boolean"); } ClientImpl::~ClientImpl() { } void ClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_method) throw std::logic_error("asyncronous request already running"); _method = &method; _state = OnBegin; prepareRequest(method.name(), argv, argc); try { beginExecute(); } catch (const std::exception& ) { IRemoteProcedure* method = _method; cancel(); _errorPending = true; method->onFinished(); if (_errorPending) throw; } _reader.reset(_ts); _scanner.begin(_deserializer, r); } void ClientImpl::endCall() { endExecute(); } void ClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _method = &method; _state = OnBegin; prepareRequest(method.name(), argv, argc); std::istream& is = execute(); _ts.attach(is); _reader.reset(_ts); _deserializer.begin(); _scanner.begin(_deserializer, r); while( _reader.get().type() != cxxtools::xml::Node::EndDocument ) { const cxxtools::xml::Node& node = _reader.get(); advance(node); _reader.next(); } // let xml::ParseError SerializationError, ConversionError propagate if (_method->failed() ) { _method = 0; _state = OnBegin; throw _fault; } _method = 0; _state = OnBegin; // _method contains a valid return value now } const IRemoteProcedure* ClientImpl::activeProcedure() const { return _method; } void ClientImpl::cancel() { _method = 0; } void ClientImpl::onReadReplyBegin(std::istream& is) { _ts.attach(is); } std::size_t ClientImpl::onReadReply() { std::size_t n = 0; try { _errorPending = false; while(true) { std::streamsize m = _ts.buffer().import(); if( ! m ) break; n += m; while( _reader.advance() ) // xml::ParseError { const cxxtools::xml::Node& node = _reader.get(); advance(node); // SerializationError, ConversionError } } } catch(const xml::XmlError& error) { _method->setFault(ErrorCodes::invalidXmlRpc, error.what()); _method->onFinished(); } catch(const SerializationError& error) { _method->setFault(ErrorCodes::invalidMethodParameters, error.what()); _method->onFinished(); } catch(const ConversionError& error) { _method->setFault(ErrorCodes::invalidMethodParameters, error.what()); _method->onFinished(); } catch(const std::exception& error) { _errorPending = true; _method->onFinished(); } return n; } void ClientImpl::onReplyFinished() { log_debug("onReplyFinished; method=" << static_cast(_method)); try { _errorPending = false; endExecute(); } catch (const std::exception& e) { if (!_method) throw; _errorPending = true; IRemoteProcedure* method = _method; _method = 0; method->onFinished(); if (_errorPending) { _errorPending = false; throw; } return; } IRemoteProcedure* method = _method; _method = 0; method->onFinished(); } void ClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { _writer.begin( prepareRequest() ); _writer.writeStartElement( methodCall ); _writer.writeElement( methodName, name ); _writer.writeStartElement( params ); for(unsigned n = 0; n < argc; ++n) { _writer.writeStartElement( param ); argv[n]->format(_formatter); _writer.writeEndElement(); } _writer.writeEndElement(); _writer.writeEndElement(); _writer.flush(); } void ClientImpl::advance(const cxxtools::xml::Node& node) { switch(_state) { case OnBegin: { if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast(node); if( se.name() != L"methodResponse" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnMethodResponseBegin; } break; } case OnMethodResponseBegin: { if(node.type() == xml::Node::StartElement) // or { const xml::StartElement& se = static_cast(node); if( se.name() == L"params") { _state = OnParamsBegin; break; } else if( se.name() == L"fault") { _fh.begin(_fault); _scanner.begin(_deserializer, _fh); _state = OnFaultBegin; break; } SerializationError::doThrow("invalid XML-RPC methodCall"); } break; } case OnFaultBegin: { bool finished = _scanner.advance(node); // start with if(finished) { // _state = OnFaultEnd; } break; } case OnFaultEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if( ee.name() != L"methodResponse" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _method->setFault(_fault.rc(), _fault.text()); _state = OnFaultResponseEnd; } break; } case OnFaultResponseEnd: { _state = OnFaultResponseEnd; break; } case OnParamsBegin: { if(node.type() == xml::Node::StartElement) // { const xml::StartElement& se = static_cast(node); if( se.name() != L"param" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnParam; } break; } case OnParam: { bool finished = _scanner.advance(node); // start with if(finished) { // _state = OnParamEnd; } break; } case OnParamEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if( ee.name() != L"params" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnParamsEnd; } break; } case OnParamsEnd: { if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if( ee.name() != L"methodResponse" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnMethodResponseEnd; } break; } case OnMethodResponseEnd: { _state = OnMethodResponseEnd; break; } } } } } cxxtools-3.0/src/xmlrpc/responder.cpp0000664000175000017500000002501413644433072014773 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/responder.h" #include "cxxtools/xmlrpc/service.h" #include "cxxtools/remoteexception.h" #include "cxxtools/xml/xmlerror.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/http/reply.h" #include "cxxtools/utf8codec.h" #include "cxxtools/convert.h" #include "cxxtools/log.h" log_define("cxxtools.xmlrpc.responder") namespace cxxtools { namespace xmlrpc { XmlRpcResponder::XmlRpcResponder(Service& service) : http::Responder(service) , _state(OnBegin) , _ts(new Utf8Codec) , _reader(_ts) , _formatter(_writer) , _service(&service) , _proc(0) , _args(0) { _writer.useIndent(false); _writer.useEndl(false); _formatter.addAlias("bool", "boolean"); } XmlRpcResponder::~XmlRpcResponder() { if(_proc) _service->releaseProcedure(_proc); } void XmlRpcResponder::beginRequest(net::TcpSocket& /*socket*/, std::istream& is, http::Request& /*request*/) { _fault.clear(); _state = OnBegin; _ts.attach( is ); _args = 0; } std::size_t XmlRpcResponder::readBody(std::istream& /*is*/) { std::size_t n = 0; try { while(true) { std::streamsize m = _ts.buffer().import(); if( ! m) break; n += m; while( _reader.advance() ) { const xml::Node& node = _reader.get(); this->advance(node); } } } catch(const xml::XmlError& error) { _fault.rc(1); _fault.text( error.what() ); throw _fault; } catch(const SerializationError& error) { _fault.rc(2); _fault.text( error.what() ); throw _fault; } catch(const ConversionError& error) { _fault.rc(3); _fault.text( error.what() ); throw _fault; } return n; } void XmlRpcResponder::replyError(std::ostream& os, http::Request& /*request*/, http::Reply& reply, const std::exception& ex) { reply.setHeader("Content-Type", "text/xml"); _writer.begin(os); _writer.writeStartElement( L"methodResponse" ); _writer.writeStartElement( L"fault" ); _writer.writeStartElement( L"value" ); _writer.writeStartElement( L"struct" ); _writer.writeStartElement( L"member" ); _writer.writeElement( L"name", L"faultCode" ); _writer.writeStartElement( L"value" ); _writer.writeElement( L"int", cxxtools::convert(_fault.rc()) ); _writer.writeEndElement(); // value _writer.writeEndElement(); // member _writer.writeStartElement( L"member" ); _writer.writeElement( L"name", L"faultString" ); _writer.writeStartElement( L"value" ); const char* msg = (_fault.rc() ? _fault.what() : ex.what()); _writer.writeElement( L"string", cxxtools::String::widen(msg)); _writer.writeEndElement(); // value _writer.writeEndElement(); // member _writer.writeEndElement(); // struct _writer.writeEndElement(); // value _writer.writeEndElement(); // fault _writer.writeEndElement(); // methodResponse _writer.flush(); } void XmlRpcResponder::reply(std::ostream& os, http::Request& request, http::Reply& reply) { try { if( ! _proc ) { _fault.rc(4); _fault.text("invalid XML-RPC"); throw _fault; } if( _args ) { ++_args; if( * _args ) { _fault.rc(5); _fault.text("invalid XML-RPC, missing arguments"); throw _fault; } } IDecomposer* rh = _proc->endCall(); reply.setHeader("Content-Type", "text/xml"); _writer.begin(os); _writer.writeStartElement( L"methodResponse" ); _writer.writeStartElement( L"params" ); _writer.writeStartElement( L"param" ); rh->format(_formatter); _writer.writeEndElement(); // param _writer.writeEndElement(); // params _writer.writeEndElement(); // methodResponse _writer.flush(); } catch (const RemoteException& fault) { _fault.rc(fault.rc()); _fault.text(fault.text()); replyError(reply.bodyStream(), request, reply, fault); } catch (...) { _writer.flush(); throw; } } void XmlRpcResponder::advance(const cxxtools::xml::Node& node) { switch(_state) { case OnBegin: { //std::cerr << "OnBegin" << std::endl; if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast(node); if( se.name() != L"methodCall" ) throw xml::XmlError( "invalid XML-RPC methodCall", _reader.line() ); _state = OnMethodCallBegin; } break; } case OnMethodCallBegin: { //std::cerr << "OnMethodCallBegin" << std::endl; if(node.type() == xml::Node::StartElement) { _state = OnMethodNameBegin; } break; } case OnMethodNameBegin: { //std::cerr << "OnMethodNameBegin" << std::endl; if(node.type() == xml::Node::Characters) { const xml::Characters& chars = static_cast(node); log_info("xmlrpc method <" << chars.content().narrow() << '>'); _proc = _service->getProcedure( chars.content().narrow() ); if( ! _proc ) throw std::runtime_error("no such procedure \"" + chars.content().narrow() + '"'); //std::cerr << "-> Found Procedure: " << chars.content().narrow() << std::endl; _state = OnMethodName; } break; } case OnMethodName: { //std::cerr << "OnMethodName" << std::endl; if(node.type() == xml::Node::EndElement) { const xml::EndElement& ee = static_cast(node); if( ee.name() != L"methodName" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnMethodNameEnd; } break; } case OnMethodNameEnd: { //std::cerr << "OnMethodNameEnd" << std::endl; if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast(node); if( se.name() != L"params" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnParams; } break; } case OnParams: { //std::cerr << "OnParams" << std::endl; if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if( ee.name() != L"params" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnParamsEnd; break; } if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast(node); if( se.name() != L"param" ) throw std::runtime_error("invalid XML-RPC methodCall"); //std::cerr << "-> Found param" << std::endl; if( ! _args ) { //std::cerr << "-> begin call" << std::endl; _args = _proc->beginCall(); if( ! *_args) throw std::runtime_error("too many arguments"); } else { //std::cerr << "-> next argument" << std::endl; ++_args; if( ! *_args) throw std::runtime_error("too many arguments"); } _scanner.begin(_deserializer, **_args); _state = OnParam; break; } break; } case OnParam: { //std::cerr << "S: OnParam" << std::endl; bool finished = _scanner.advance(node); if(finished) { //std::cerr << "-> param finished" << std::endl; // node is _state = OnParams; } break; } case OnParamsEnd: { //std::cerr << "OnParamsEnd" << std::endl; if(node.type() == xml::Node::EndElement) // { const xml::EndElement& ee = static_cast(node); if( ee.name() != L"methodCall" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnMethodCallEnd; } break; } case OnMethodCallEnd: { //std::cerr << "OnMethodCallEnd" << std::endl; if(node.type() == xml::Node::EndDocument) { _state = OnMethodCallEnd; } break; } } } } } cxxtools-3.0/src/http/0000775000175000017500000000000013672344760012024 500000000000000cxxtools-3.0/src/http/service.cpp0000664000175000017500000000524213644433072014105 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace http { Responder* Service::doCreateResponder(const Request& request) { MutexLock lock(_mutex); ++_responderCount; return createResponder(request); } void Service::doReleaseResponder(Responder* responder) { MutexLock lock(_mutex); releaseResponder(responder); if (--_responderCount <= 0) _isIdle.signal(); } void Service::waitIdle() { MutexLock lock(_mutex); while (_responderCount > 0) _isIdle.wait(lock); } bool Service::checkAuth(const Request& request) { for (std::vector::const_iterator it = _authenticators.begin(); it != _authenticators.end(); ++it) { if (!(*it)->checkAuth(request)) return false; } return true; } CachedServiceBase::~CachedServiceBase() { for (Responders::iterator it = responders.begin(); it != responders.end(); ++it) delete *it; } Responder* CachedServiceBase::createResponder(const Request& /*request*/) { if (responders.empty()) { return newResponder(); } else { Responder* ret = responders.back(); responders.pop_back(); return ret; } } void CachedServiceBase::releaseResponder(Responder* resp) { responders.push_back(resp); } } } cxxtools-3.0/src/http/Makefile.in0000664000175000017500000006244113644433103014005 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/http ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_http_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_libcxxtools_http_la_OBJECTS = chunkedreader.lo client.lo \ clientimpl.lo mapper.lo messageheader.lo \ notauthenticatedresponder.lo notauthenticatedservice.lo \ notfoundresponder.lo notfoundservice.lo parser.lo server.lo \ serverimpl.lo service.lo socket.lo request.lo responder.lo \ worker.lo libcxxtools_http_la_OBJECTS = $(am_libcxxtools_http_la_OBJECTS) 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 = libcxxtools_http_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcxxtools_http_la_LDFLAGS) \ $(LDFLAGS) -o $@ 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/chunkedreader.Plo \ ./$(DEPDIR)/client.Plo ./$(DEPDIR)/clientimpl.Plo \ ./$(DEPDIR)/mapper.Plo ./$(DEPDIR)/messageheader.Plo \ ./$(DEPDIR)/notauthenticatedresponder.Plo \ ./$(DEPDIR)/notauthenticatedservice.Plo \ ./$(DEPDIR)/notfoundresponder.Plo \ ./$(DEPDIR)/notfoundservice.Plo ./$(DEPDIR)/parser.Plo \ ./$(DEPDIR)/request.Plo ./$(DEPDIR)/responder.Plo \ ./$(DEPDIR)/server.Plo ./$(DEPDIR)/serverimpl.Plo \ ./$(DEPDIR)/service.Plo ./$(DEPDIR)/socket.Plo \ ./$(DEPDIR)/worker.Plo am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(libcxxtools_http_la_SOURCES) DIST_SOURCES = $(libcxxtools_http_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-http.la libcxxtools_http_la_SOURCES = \ chunkedreader.cpp \ client.cpp \ clientimpl.cpp \ mapper.cpp \ messageheader.cpp \ notauthenticatedresponder.cpp \ notauthenticatedservice.cpp \ notfoundresponder.cpp \ notfoundservice.cpp \ parser.cpp \ server.cpp \ serverimpl.cpp \ service.cpp \ socket.cpp \ request.cpp \ responder.cpp \ worker.cpp noinst_HEADERS = \ chunkedreader.h \ clientimpl.h \ mapper.h \ notauthenticatedresponder.h \ notauthenticatedservice.h \ notfoundresponder.h \ notfoundservice.h \ parser.h \ serverimpl.h \ serverimplbase.h \ socket.h \ worker.h libcxxtools_http_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_http_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/http/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/http/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-http.la: $(libcxxtools_http_la_OBJECTS) $(libcxxtools_http_la_DEPENDENCIES) $(EXTRA_libcxxtools_http_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcxxtools_http_la_LINK) -rpath $(libdir) $(libcxxtools_http_la_OBJECTS) $(libcxxtools_http_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunkedreader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/messageheader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notauthenticatedresponder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notauthenticatedservice.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notfoundresponder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notfoundservice.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serverimpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/chunkedreader.Plo -rm -f ./$(DEPDIR)/client.Plo -rm -f ./$(DEPDIR)/clientimpl.Plo -rm -f ./$(DEPDIR)/mapper.Plo -rm -f ./$(DEPDIR)/messageheader.Plo -rm -f ./$(DEPDIR)/notauthenticatedresponder.Plo -rm -f ./$(DEPDIR)/notauthenticatedservice.Plo -rm -f ./$(DEPDIR)/notfoundresponder.Plo -rm -f ./$(DEPDIR)/notfoundservice.Plo -rm -f ./$(DEPDIR)/parser.Plo -rm -f ./$(DEPDIR)/request.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/server.Plo -rm -f ./$(DEPDIR)/serverimpl.Plo -rm -f ./$(DEPDIR)/service.Plo -rm -f ./$(DEPDIR)/socket.Plo -rm -f ./$(DEPDIR)/worker.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/chunkedreader.Plo -rm -f ./$(DEPDIR)/client.Plo -rm -f ./$(DEPDIR)/clientimpl.Plo -rm -f ./$(DEPDIR)/mapper.Plo -rm -f ./$(DEPDIR)/messageheader.Plo -rm -f ./$(DEPDIR)/notauthenticatedresponder.Plo -rm -f ./$(DEPDIR)/notauthenticatedservice.Plo -rm -f ./$(DEPDIR)/notfoundresponder.Plo -rm -f ./$(DEPDIR)/notfoundservice.Plo -rm -f ./$(DEPDIR)/parser.Plo -rm -f ./$(DEPDIR)/request.Plo -rm -f ./$(DEPDIR)/responder.Plo -rm -f ./$(DEPDIR)/server.Plo -rm -f ./$(DEPDIR)/serverimpl.Plo -rm -f ./$(DEPDIR)/service.Plo -rm -f ./$(DEPDIR)/socket.Plo -rm -f ./$(DEPDIR)/worker.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES 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 uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/src/http/clientimpl.h0000664000175000017500000001532213644433072014252 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_ClientImpl_h #define cxxtools_Http_ClientImpl_h #include "parser.h" #include "chunkedreader.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" namespace cxxtools { namespace http { class Client; class ClientImpl : public RefCounted, public Connectable { friend class ParseEvent; Client* _client; class ParseEvent : public HeaderParser::MessageHeaderEvent { ReplyHeader& _replyHeader; public: explicit ParseEvent(ReplyHeader& replyHeader) : HeaderParser::MessageHeaderEvent(replyHeader), _replyHeader(replyHeader) { } void onHttpReturn(unsigned ret, const std::string& text); }; const Request* _request; Reply _reply; ParseEvent _parseEvent; HeaderParser _parser; net::AddrInfo _addrInfo; #ifdef WITH_SSL bool _ssl; std::string _sslCertificate; int _sslVerifyLevel; std::string _sslCa; #endif net::TcpSocket _socket; IOStream _stream; ChunkedIStream _chunkedIStream; LimitIStream _bodyStream; std::string _username; std::string _password; bool _readHeader; bool _chunkedEncoding; bool _reconnectOnError; bool _errorPending; void sendRequest(const Request& request); void processHeaderAvailable(StreamBuffer& sb); void processBodyAvailable(StreamBuffer& sb); void reexecute(const Request& request); void reexecuteBegin(const Request& request); void doparse(); // make non copyable ClientImpl(const ClientImpl& client); ClientImpl& operator=(const ClientImpl& client); protected: void onConnect(net::TcpSocket& socket); #ifdef WITH_SSL void onSslConnect(net::TcpSocket& socket); #endif void onOutput(StreamBuffer& sb); void onInput(StreamBuffer& sb); public: ClientImpl(Client* client); net::TcpSocket& socket() { return _socket; } // Sets the server and port. No actual network connect is done. void prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate); void ssl(bool sw) { #ifdef WITH_SSL if (_ssl != sw) { _ssl = sw; close(); } #endif } void connect() { _socket.close(); _socket.connect(_addrInfo); #ifdef WITH_SSL if (_ssl) _socket.sslConnect(); #endif } void close() { _socket.close(); } void setSslVerify(int level, const std::string& ca) { #ifdef WITH_SSL _sslVerifyLevel = level; _sslCa = ca; #endif } // Sends the passed request to the server and parses the headers. // The body must be read with readBody. // This method blocks or times out until the body is parsed. const ReplyHeader& execute(const Request& request, Timespan timeout, Timespan connectTimeout); // Reads the http body after header read with execute. // This method blocks until the body is received. void readBody(); std::string body() const { return _reply.body(); } const Reply& reply() const { return _reply; } Reply& reply() { return _reply; } // Starts a new request. // This method does not block. To actually process the request, the // event loop must be executed. The state of the request is signaled // with the corresponding signals and delegates. // The delegate "bodyAvailable" must be connected, if a body is // received. void beginExecute(const Request& request); void endExecute(); void setSelector(SelectorBase* selector) { _socket.setSelector(selector); } SelectorBase* selector(); // Executes the underlying selector until a event occures or the // specified timeout is reached. bool wait(std::size_t msecs); // Returns the underlying stream, where the reply may be read from. std::istream& in() { return _chunkedEncoding ? static_cast(_chunkedIStream) : static_cast(_bodyStream); } const std::string& host() const { return _addrInfo.host(); } unsigned short port() const { return _addrInfo.port(); } // Sets the username and password for all subsequent requests. void auth(const std::string& username, const std::string& password) { _username = username; _password = password; } void clearAuth() { _username.clear(); _password.clear(); } void cancel(); }; } // namespace http } // namespace cxxtools #endif cxxtools-3.0/src/http/Makefile.am0000664000175000017500000000165713644433072014003 00000000000000AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-http.la libcxxtools_http_la_SOURCES = \ chunkedreader.cpp \ client.cpp \ clientimpl.cpp \ mapper.cpp \ messageheader.cpp \ notauthenticatedresponder.cpp \ notauthenticatedservice.cpp \ notfoundresponder.cpp \ notfoundservice.cpp \ parser.cpp \ server.cpp \ serverimpl.cpp \ service.cpp \ socket.cpp \ request.cpp \ responder.cpp \ worker.cpp noinst_HEADERS = \ chunkedreader.h \ clientimpl.h \ mapper.h \ notauthenticatedresponder.h \ notauthenticatedservice.h \ notfoundresponder.h \ notfoundservice.h \ parser.h \ serverimpl.h \ serverimplbase.h \ socket.h \ worker.h libcxxtools_http_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_http_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ cxxtools-3.0/src/http/messageheader.cpp0000664000175000017500000001263113644433072015242 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include log_define("cxxtools.http.messageheader") namespace cxxtools { namespace http { namespace { int compareIgnoreCase(const char* s1, const char* s2) { const char* it1 = s1; const char* it2 = s2; while (*it1 && *it2) { if (*it1 != *it2) { char c1 = std::toupper(*it1); char c2 = std::toupper(*it2); if (c1 < c2) return -1; else if (c2 < c1) return 1; } ++it1; ++it2; } return *it1 ? 1 : *it2 ? -1 : 0; } } const char* MessageHeader::getHeader(const char* key) const { for (const_iterator it = begin(); it != end(); ++it) { if (compareIgnoreCase(key, it->first) == 0) return it->second; } return 0; } bool MessageHeader::isHeaderValue(const char* key, const char* value) const { const char* h = getHeader(key); if (h == 0) return false; return compareIgnoreCase(h, value) == 0; } void MessageHeader::clear() { _rawdata[0] = _rawdata[1] = '\0'; _endOffset = 0; _httpVersionMajor = 1; _httpVersionMinor = 1; } void MessageHeader::setHeader(const char* key, const char* value, bool replace) { log_debug("setHeader(\"" << key << "\", \"" << value << "\", " << replace << ')'); if (!*key) throw std::runtime_error("empty key not allowed in messageheader"); if (replace) removeHeader(key); char* p = eptr(); size_t lk = strlen(key); // length of key size_t lv = strlen(value); // length of value if (p - _rawdata + lk + lv + 2 > MAXHEADERSIZE) throw std::runtime_error("message header too big"); std::strcpy(p, key); // copy key p += lk + 1; std::strcpy(p, value); // copy value p[lv + 1] = '\0'; // put new message end marker in place _endOffset = (p + lv + 1) - _rawdata; } void MessageHeader::removeHeader(const char* key) { if (!*key) throw std::runtime_error("empty key not allowed in messageheader"); char* p = eptr(); const_iterator it = begin(); while (it != end()) { if (compareIgnoreCase(key, it->first) == 0) { unsigned slen = it->second - it->first + std::strlen(it->second) + 1; std::memmove( const_cast(it->first), it->first + slen, p - it->first + slen); p -= slen; it.fixup(); } else ++it; } _endOffset = p - _rawdata; } bool MessageHeader::chunkedTransferEncoding() const { return isHeaderValue("Transfer-Encoding", "chunked"); } std::size_t MessageHeader::contentLength() const { const char* s = getHeader("Content-Length"); if (s == 0) return 0; std::size_t size = 0; while (*s >= '0' && *s <= '9') size = size * 10 + (*s++ - '0'); return size; } bool MessageHeader::keepAlive() const { const char* ch = getHeader("Connection"); if (ch == 0) return httpVersionMajor() == 1 && httpVersionMinor() >= 1; else return compareIgnoreCase(ch, "keep-alive") == 0; } char* MessageHeader::htdateCurrent(char* buffer) { int year = 0; unsigned month = 0; unsigned day = 0; unsigned hour = 0; unsigned min = 0; unsigned sec = 0; unsigned msec = 0; DateTime dt = Clock::getSystemTime(); dt.get(year, month, day, hour, min, sec, msec); unsigned dayOfWeek = dt.date().dayOfWeek(); static const char* wday[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static const char* monthn[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; sprintf(buffer, "%s, %02u %s %d %02u:%02u:%02u GMT", wday[dayOfWeek], day, monthn[month-1], year, hour, min, sec); return buffer; } } // namespace http } // namespace cxxtools cxxtools-3.0/src/http/server.cpp0000664000175000017500000000700113644433072013746 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "serverimpl.h" log_define("cxxtools.http.server") namespace cxxtools { namespace http { ServerImplBase* Server::newImpl(EventLoopBase& eventLoop) { return new ServerImpl(eventLoop, runmodeChanged); } Server::~Server() { if (!_impl) return; if (_impl->runmode() == Running) _impl->terminate(); delete _impl; } void Server::listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) { log_info_if(certificateFile.empty(), "listen ip=" << ip << " port=" << port); log_info_if(!certificateFile.empty(), "listen ip=" << ip << " port=" << port << " certificate: \"" << certificateFile << "\" private key: \"" << privateKeyFile << '"'); _impl->listen(ip, port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } void Server::addService(const std::string& url, Service& service) { _impl->addService(url, service); } void Server::addService(const Regex& url, Service& service) { _impl->addService(url, service); } void Server::removeService(Service& service) { _impl->removeService(service); } Milliseconds Server::readTimeout() const { return _impl->readTimeout(); } Milliseconds Server::writeTimeout() const { return _impl->writeTimeout(); } Milliseconds Server::keepAliveTimeout() const { return _impl->keepAliveTimeout(); } void Server::readTimeout(Milliseconds ms) { _impl->readTimeout(ms); } void Server::writeTimeout(Milliseconds ms) { _impl->writeTimeout(ms); } void Server::keepAliveTimeout(Milliseconds ms) { _impl->keepAliveTimeout(ms); } unsigned Server::minThreads() const { return _impl->minThreads(); } void Server::minThreads(unsigned m) { _impl->minThreads(m); } unsigned Server::maxThreads() const { return _impl->maxThreads(); } void Server::maxThreads(unsigned m) { _impl->maxThreads(m); } Delegate& Server::acceptSslCertificate() { return _impl->acceptSslCertificate; } } // namespace http } // namespace cxxtools cxxtools-3.0/src/http/socket.h0000664000175000017500000000776413644433072013415 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Socket_h #define cxxtools_Http_Socket_h #include #include #include #include #include #include #include #include #include "parser.h" namespace cxxtools { namespace http { class ServerImpl; class Responder; class Socket : public net::TcpSocket, public Connectable { class ParseEvent : public HeaderParser::MessageHeaderEvent { Request& _request; public: explicit ParseEvent(Request& request) : HeaderParser::MessageHeaderEvent(request.header()), _request(request) { } virtual void onMethod(const std::string& method); virtual void onUrl(const std::string& url); virtual void onUrlParam(const std::string& q); }; public: Socket(ServerImpl& server, net::TcpServer& tcpServer, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa); explicit Socket(Socket& socket); ~Socket(); void accept(); void postAccept(); bool hasAccepted() const { return _accepted; } void setSelector(SelectorBase* s); void removeSelector(); void onIODeviceInput(IODevice& iodevice); void onInput(StreamBuffer& sb); bool onOutput(StreamBuffer& sb); void onTimeout(); bool onAcceptSslCertificate(const SslCertificate& cert); bool doReply(); void sendReply(); bool isReady() const { return _parser.end() && _contentLength == 0; } const Request& request() const { return _request; } const Reply& reply() const { return _reply; } Signal inputReady; Signal timeout; StreamBuffer& buffer() { return _stream.buffer(); } MethodSlot inputSlot; Connection inputConnection; Connection timeoutConnection; private: net::TcpServer& _tcpServer; std::string _certificateFile; std::string _privateKeyFile; ServerImpl& _server; ParseEvent _parseEvent; HeaderParser _parser; Request _request; Reply _reply; Timer _timer; int _contentLength; Responder* _responder; IOStream _stream; int _sslVerifyLevel; std::string _sslCa; bool _accepted; }; } // namespace http } // namespace cxxtools #endif cxxtools-3.0/src/http/notfoundresponder.cpp0000664000175000017500000000310313644433072016215 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notfoundresponder.h" #include namespace cxxtools { namespace http { void NotFoundResponder::reply(std::ostream& /*out*/, Request& /*request*/, Reply& reply) { reply.httpReturn(404, "Not found"); } } } cxxtools-3.0/src/http/serverimplbase.h0000664000175000017500000001065613644433072015142 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_SERVERIMPLBASE_H #define CXXTOOLS_HTTP_SERVERIMPLBASE_H #include #include #include "mapper.h" namespace cxxtools { class EventLoopBase; namespace http { class ServerImplBase { #if __cplusplus >= 201103L ServerImplBase(const ServerImplBase&) = delete; ServerImplBase& operator=(const ServerImplBase&) = delete; #else ServerImplBase(const ServerImplBase&); ServerImplBase& operator=(const ServerImplBase&); #endif public: ServerImplBase(EventLoopBase& eventLoop, Signal& runmodeChanged) : _eventLoop(eventLoop), _readTimeout(Seconds(20)), _writeTimeout(Seconds(20)), _keepAliveTimeout(Seconds(30)), _minThreads(5), _maxThreads(200), _runmodeChanged(runmodeChanged), _runmode(Server::Stopped) { } virtual ~ServerImplBase() { } virtual void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) = 0; void addService(const std::string& url, Service& service) { _mapper.addService(url, service); } void addService(const Regex& url, Service& service) { _mapper.addService(url, service); } void removeService(Service& service) { _mapper.removeService(service); } Responder* getResponder(const Request& request) { return _mapper.getResponder(request); } Responder* getDefaultResponder(const Request& request) { return _mapper.getDefaultResponder(request); } Milliseconds readTimeout() const { return _readTimeout; } Milliseconds writeTimeout() const { return _writeTimeout; } Milliseconds keepAliveTimeout() const { return _keepAliveTimeout; } void readTimeout(Milliseconds ms) { _readTimeout = ms; } void writeTimeout(Milliseconds ms) { _writeTimeout = ms; } void keepAliveTimeout(Milliseconds ms) { _keepAliveTimeout = ms; } unsigned minThreads() const { return _minThreads; } void minThreads(unsigned m) { _minThreads = m; } unsigned maxThreads() const { return _maxThreads; } void maxThreads(unsigned m) { _maxThreads = m; } virtual void terminate() { } Server::Runmode runmode() const { return _runmode; } Delegate acceptSslCertificate; protected: void runmode(Server::Runmode runmode) { _runmode = runmode; _runmodeChanged(runmode); } EventLoopBase& _eventLoop; private: Milliseconds _readTimeout; Milliseconds _writeTimeout; Milliseconds _keepAliveTimeout; unsigned _minThreads; unsigned _maxThreads; Signal& _runmodeChanged; Server::Runmode _runmode; Mapper _mapper; }; } } #endif // CXXTOOLS_HTTP_SERVERIMPL_H cxxtools-3.0/src/http/parser.h0000664000175000017500000001317013644433072013405 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Parser_h #define cxxtools_Http_Parser_h #include #include #include namespace cxxtools { namespace http { class HeaderParser { public: class Event { public: virtual ~Event() {} virtual void onMethod(const std::string& method); virtual void onUrl(const std::string& url); virtual void onUrlParam(const std::string& q); virtual void onHttpVersion(unsigned major, unsigned minor); virtual void onKey(const std::string& key); virtual void onValue(const std::string& value); virtual void onHttpReturn(unsigned ret, const std::string& text); virtual void onEnd(); }; class MessageHeaderEvent : public Event { MessageHeader& _header; char _key[MessageHeader::MAXHEADERSIZE]; public: explicit MessageHeaderEvent(MessageHeader& header) : _header(header) { } virtual void onHttpVersion(unsigned major, unsigned minor); virtual void onKey(const std::string& key); virtual void onValue(const std::string& value); }; private: typedef void (HeaderParser::*state_type)(char); void state_cmd0(char ch); void state_cmd(char ch); void state_url0(char ch); void state_uri_protocol(char ch); void state_uri_protocol_e(char ch); void state_uri_host(char ch); void state_url(char ch); void state_urlesc(char ch); void state_qparam(char ch); void state_protocol0(char ch); void state_protocol(char ch); void state_version0(char ch); void state_version_major(char ch); void state_version_major_e(char ch); void state_version_minor(char ch); void state_end0(char ch); void state_h0(char ch); void state_hcr(char ch); void state_hfieldname(char ch); void state_hfieldnamespace(char ch); void state_hfieldbody0(char ch); void state_hfieldbody(char ch); void state_hfieldbody_cr(char ch); void state_hfieldbody_crlf(char ch); void state_hend_cr(char ch); void state_cl_protocol0(char ch); void state_cl_protocol(char ch); void state_cl_version0(char ch); void state_cl_version_major(char ch); void state_cl_version_major_e(char ch); void state_cl_version_minor(char ch); void state_cl_httpresult0(char ch); void state_cl_httpresult(char ch); void state_cl_httpresulttext(char ch); void state_cl_httpresult_cr(char ch); void state_end(char ch); void state_error(char ch); state_type state; Event& ev; std::string token; unsigned value; public: HeaderParser(Event& ev_, bool client) : state(client ? &HeaderParser::state_cl_protocol0 : &HeaderParser::state_cmd0), ev(ev_) { } /// parse as many characters as available in buffer without blocking std::size_t advance(std::streambuf& sb); std::size_t advance(std::istream& is) { return advance(*is.rdbuf()); } /// parses a single character and returns true, if message is finished bool parse(char ch) { (this->*state)(ch); return state == &HeaderParser::state_end || state == &HeaderParser::state_error; } bool begin() const { return state == &HeaderParser::state_cl_protocol0 || state == &HeaderParser::state_cmd0; } bool end() const { return state == &HeaderParser::state_end || state == &HeaderParser::state_error; } bool fail() const { return state == &HeaderParser::state_error; } void reset(bool client) { state = (client ? &HeaderParser::state_cl_protocol0 : &HeaderParser::state_cmd0); } /// returns parser to header reading state void readHeader() { state = &HeaderParser::state_h0; } }; } // namespace http } // namespace cxxtools #endif cxxtools-3.0/src/http/notfoundservice.h0000664000175000017500000000352313644433072015327 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTFOUNDSERVICE_H #define CXXTOOLS_HTTP_NOTFOUNDSERVICE_H #include #include "notfoundresponder.h" namespace cxxtools { namespace http { class NotFoundService : public Service { public: NotFoundService() : _responder(*this) { } Responder* createResponder(const Request&); void releaseResponder(Responder*); private: NotFoundResponder _responder; }; } } #endif // CXXTOOLS_HTTP_NOTFOUNDSERVICE_H cxxtools-3.0/src/http/chunkedreader.cpp0000664000175000017500000001614413644433072015254 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "chunkedreader.h" #include #include #include log_define("cxxtools.http.chunkedreader") namespace cxxtools { namespace http { namespace { std::string charToPrint(char ch) { std::ostringstream s; if (ch >= 32 && ch < 127) s << '<' << ch << '>'; s << '(' << static_cast(static_cast(ch)) << ')'; return s.str(); } void throwInvalidCharacter(char ch) { std::ostringstream s; s << "invalid character "; if (ch >= 32 && ch < 127) s << '<' << ch << '>'; s << '(' << static_cast(static_cast(ch)) << ") in chunked encoding"; throw std::runtime_error(s.str()); } } //////////////////////////////////////////////////////////////////// // ChunkedReader ChunkedReader::ChunkedReader(std::streambuf* ib, unsigned bufsize) : _ib(ib), _buffer(0), _bufsize(bufsize), _state(&ChunkedReader::onBegin) { } std::streamsize ChunkedReader::showmanyc() { log_trace("showmanyc"); while (_state != 0 && gptr() == egptr() && _ib->in_avail()) { (this->*_state)(); } log_debug("showmanyc=" << egptr() - gptr()); return egptr() - gptr(); } int ChunkedReader::sync() { return 0; } ChunkedReader::int_type ChunkedReader::overflow(int_type /*ch*/) { return traits_type::eof(); } ChunkedReader::int_type ChunkedReader::underflow() { log_trace("ChunkedReader::underflow"); while (_state != 0 && gptr() == egptr() && _ib->sgetc() != traits_type::eof()) { (this->*_state)(); } if (_state == 0) { log_debug("end of chunked data reached"); return traits_type::eof(); } if (_ib->sgetc() == traits_type::eof()) { log_debug("end of input stream"); _state = 0; return traits_type::eof(); } log_debug("not at eof - return " << charToPrint(*gptr())); return *gptr(); } void ChunkedReader::onBegin() { char ch = _ib->sbumpc(); log_trace("onBegin, ch=" << charToPrint(ch)); if (ch >= '0' && ch <= '9') { _chunkSize = ch - '0'; _state = &ChunkedReader::onSize; } else if (ch >= 'a' && ch <= 'f') { _chunkSize = ch - 'a' + 10; _state = &ChunkedReader::onSize; } else if (ch >= 'A' && ch <= 'F') { _chunkSize = ch - 'A' + 10; _state = &ChunkedReader::onSize; } else throwInvalidCharacter(ch); } void ChunkedReader::onSize() { char ch = _ib->sbumpc(); log_trace("onSize, ch=" << charToPrint(ch)); if (ch >= '0' && ch <= '9') { _chunkSize = _chunkSize * 16 + (ch - '0'); } else if (ch >= 'a' && ch <= 'f') { _chunkSize = _chunkSize * 16 + (ch - 'a' + 10); } else if (ch >= 'A' && ch <= 'F') { _chunkSize = _chunkSize * 16 + (ch - 'A' + 10); } else { log_debug("chunk size=" << _chunkSize); if (ch == '\r') { _state = &ChunkedReader::onEndl; } else if (ch == '\n') { if (_chunkSize > 0) _state = &ChunkedReader::onData; else _state = 0; } else { _state = &ChunkedReader::onExtension; } } } void ChunkedReader::onEndl() { char ch = _ib->sbumpc(); log_trace("onEndl, ch=" << charToPrint(ch)); if (ch == '\n') { if (_chunkSize > 0) _state = &ChunkedReader::onData; else _state = &ChunkedReader::onTrailer; } else throwInvalidCharacter(ch); } void ChunkedReader::onExtension() { log_trace("onExtension"); char ch = _ib->sbumpc(); if (ch == '\r') { _state = &ChunkedReader::onEndl; } else if (ch == '\n') { if (_chunkSize > 0) _state = &ChunkedReader::onData; else _state = 0; } } void ChunkedReader::onData() { log_trace("onData"); unsigned n = static_cast(_ib->in_avail()); if (n > _bufsize) n = _bufsize; if (n > _chunkSize) n = _chunkSize; if (!_buffer) _buffer = new char[_bufsize]; n = _ib->sgetn(_buffer, n); setg(_buffer, _buffer, _buffer + n); _chunkSize -= n; if (_chunkSize <= 0) _state = &ChunkedReader::onDataEnd0; } void ChunkedReader::onDataEnd0() { char ch = _ib->sbumpc(); log_trace("onDataEnd0, ch=" << charToPrint(ch)); if (ch == '\r') { log_debug("=> onDataEnd"); _state = &ChunkedReader::onDataEnd; } else if (ch == '\n') { log_debug("=> onBegin"); _state = &ChunkedReader::onBegin; } else throwInvalidCharacter(ch); } void ChunkedReader::onDataEnd() { char ch = _ib->sbumpc(); log_trace("onDataEnd, ch=" << charToPrint(ch)); if (ch == '\n') { log_debug("=> onBegin"); _state = &ChunkedReader::onBegin; } else throwInvalidCharacter(ch); } void ChunkedReader::onTrailer() { char ch = _ib->sbumpc(); if (ch == '\n') _state = 0; else if (ch == '\r') ; else _state = &ChunkedReader::onTrailerData; } void ChunkedReader::onTrailerData() { // the trailer is actually ignored char ch = _ib->sbumpc(); if (ch == '\n') _state = &ChunkedReader::onTrailer; } } } cxxtools-3.0/src/http/notauthenticatedresponder.h0000664000175000017500000000376413644433072017406 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTAUTHENTICATEDRESPONDER_H #define CXXTOOLS_HTTP_NOTAUTHENTICATEDRESPONDER_H #include #include namespace cxxtools { namespace http { class NotAuthenticatedResponder : public Responder { std::string _realm; std::string _content; public: explicit NotAuthenticatedResponder(Service& service, const std::string& realm, const std::string& content) : Responder(service), _realm(realm), _content(content) { } void reply(std::ostream&, Request& request, Reply& reply); }; } } #endif // CXXTOOLS_HTTP_NOTAUTHENTICATEDRESPONDER_H cxxtools-3.0/src/http/notauthenticatedresponder.cpp0000664000175000017500000000345313644433072017734 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notauthenticatedresponder.h" #include namespace cxxtools { namespace http { void NotAuthenticatedResponder::reply(std::ostream& out, Request& /*request*/, Reply& reply) { reply.setHeader("WWW-Authenticate", ("Basic realm=\"" + _realm + '"').c_str()); reply.httpReturn(401, "not authorized"); if (_content.empty()) out << "

not authorized

"; else out << _content; } } } cxxtools-3.0/src/http/notauthenticatedservice.h0000664000175000017500000000360313644433072017035 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTAUTHENTICATEDSERVICE_H #define CXXTOOLS_HTTP_NOTAUTHENTICATEDSERVICE_H #include namespace cxxtools { namespace http { class NotAuthenticatedService : public Service { public: NotAuthenticatedService() { } Responder* createResponder(const Request&); Responder* createResponder(const Request&, const std::string& realm, const std::string& authContent); void releaseResponder(Responder* responder); }; } } #endif // CXXTOOLS_HTTP_NOTAUTHENTICATEDSERVICE_H cxxtools-3.0/src/http/mapper.h0000664000175000017500000000513513644433072013377 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_MAPPER_H #define CXXTOOLS_HTTP_MAPPER_H #include "notfoundservice.h" #include "notauthenticatedservice.h" #include #include namespace cxxtools { namespace http { class Mapper { public: void addService(const std::string& url, Service& service); void addService(const Regex& url, Service& service); void removeService(Service& service); Responder* getResponder(const Request& request); Responder* getDefaultResponder(const Request& request) { return _defaultService.createResponder(request); } private: struct Key { Regex regex; std::string url; Key() { } Key(const Regex& regex_) : regex(regex_) { } Key(const std::string& url_) : url(url_) { } bool match(const std::string& u) const { return regex.empty() ? url == u : regex.match(u); } }; typedef std::vector > ServicesType; ReadWriteMutex _serviceMutex; ServicesType _services; NotFoundService _defaultService; NotAuthenticatedService _noAuthService; }; } } #endif // CXXTOOLS_HTTP_MAPPER_H cxxtools-3.0/src/http/notfoundservice.cpp0000664000175000017500000000305413644433072015661 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notfoundservice.h" namespace cxxtools { namespace http { Responder* NotFoundService::createResponder(const Request&) { return &_responder; } void NotFoundService::releaseResponder(Responder*) { } } } cxxtools-3.0/src/http/serverimpl.cpp0000664000175000017500000002424213644433072014636 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "serverimpl.h" #include "worker.h" #include "socket.h" #include #include #include log_define("cxxtools.http.server.impl") namespace cxxtools { namespace http { class IdleSocketEvent : public BasicEvent { Socket* _socket; public: explicit IdleSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; class KeepAliveTimeoutEvent : public BasicEvent { Socket* _socket; public: explicit KeepAliveTimeoutEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; class ServerStartEvent : public BasicEvent { const ServerImpl* _server; public: explicit ServerStartEvent(const ServerImpl* server) : _server(server) { } const ServerImpl* server() const { return _server; } }; class NoWaitingThreadsEvent : public BasicEvent { }; class ThreadTerminatedEvent : public BasicEvent { Worker* _worker; public: explicit ThreadTerminatedEvent(Worker* worker) : _worker(worker) { } Worker* worker() const { return _worker; } }; class ActiveSocketEvent : public BasicEvent { Socket* _socket; public: explicit ActiveSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; ServerImpl::ServerImpl(EventLoopBase& eventLoop, Signal& runmodeChanged) : ServerImplBase(eventLoop, runmodeChanged), inputSlot(slot(*this, &ServerImpl::onInput)), timeoutSlot(slot(*this, &ServerImpl::onTimeout)) { _eventLoop.event.subscribe(slot(*this, &ServerImpl::onIdleSocket)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onActiveSocket)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onKeepAliveTimeout)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onNoWaitingThreads)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onThreadTerminated)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onServerStart)); connect(_eventLoop.exited, *this, &ServerImpl::terminate); _eventLoop.commitEvent(ServerStartEvent(this)); } ServerImpl::~ServerImpl() { if (runmode() == Server::Running) { try { terminate(); } catch (const std::exception& e) { log_fatal("exception in http-server termination occured: " << e.what()); } } } void ServerImpl::listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) { log_debug("listen on " << ip << " port " << port << " certificate \"" << certificateFile << "\" private key \"" << privateKeyFile << '"'); net::TcpServer* listener = new net::TcpServer(ip, port, 64, net::TcpServer::DEFER_ACCEPT|net::TcpServer::REUSEADDR); Socket* socket = 0; try { _listener.push_back(listener); socket = new Socket(*this, *listener, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); _queue.put(socket); } catch (...) { delete socket; delete listener; throw; } } void ServerImpl::start() { log_trace("start server"); runmode(Server::Starting); MutexLock lock(_threadMutex); while (_threads.size() < minThreads()) { Worker* worker = new Worker(*this); _threads.insert(worker); worker->start(); } runmode(Server::Running); } void ServerImpl::terminate() { log_trace("terminate"); _eventLoop.processEvents(); MutexLock lock(_threadMutex); runmode(Server::Terminating); try { log_debug("wake " << _listener.size() << " listeners"); for (ServerImpl::ListenerType::iterator it = _listener.begin(); it != _listener.end(); ++it) (*it)->terminateAccept(); _queue.put(0); log_debug("terminate " << _threads.size() << " threads"); while (!_threads.empty() || !_terminatedThreads.empty()) { if (!_threads.empty()) { log_debug("wait for terminated thread"); _threadTerminated.wait(lock); } for (Threads::iterator it = _terminatedThreads.begin(); it != _terminatedThreads.end(); ++it) { log_debug("join thread"); (*it)->join(); delete *it; } _terminatedThreads.clear(); } log_debug("delete " << _listener.size() << " listeners"); for (ServerImpl::ListenerType::iterator it = _listener.begin(); it != _listener.end(); ++it) delete *it; _listener.clear(); while (!_queue.empty()) delete _queue.get(); for (std::set::iterator it = _idleSockets.begin(); it != _idleSockets.end(); ++it) delete *it; _idleSockets.clear(); runmode(Server::Stopped); } catch (const std::exception& e) { runmode(Server::Failed); } } void ServerImpl::noWaitingThreads() { MutexLock lock(_threadMutex); if (runmode() == Server::Running) _eventLoop.commitEvent(NoWaitingThreadsEvent()); } void ServerImpl::threadTerminated(Worker* worker) { MutexLock lock(_threadMutex); _threads.erase(worker); if (runmode() == Server::Running) { _eventLoop.commitEvent(ThreadTerminatedEvent(worker)); } else { _terminatedThreads.insert(worker); _threadTerminated.signal(); } } void ServerImpl::addIdleSocket(Socket* socket) { log_debug("add idle socket " << static_cast(socket)); if (runmode() == Server::Running) { _eventLoop.commitEvent(IdleSocketEvent(socket)); } else { log_debug("server not running; delete " << static_cast(socket)); delete socket; } } void ServerImpl::onIdleSocket(const IdleSocketEvent& event) { Socket* socket = event.socket(); log_debug("add idle socket " << static_cast(socket) << " to selector"); _idleSockets.insert(socket); socket->setSelector(&_eventLoop); socket->inputConnection = connect(socket->inputReady, inputSlot); socket->timeoutConnection = connect(socket->timeout, timeoutSlot); } void ServerImpl::onActiveSocket(const ActiveSocketEvent& event) { _queue.put(event.socket()); } void ServerImpl::onNoWaitingThreads(const NoWaitingThreadsEvent& /*event*/) { MutexLock lock(_threadMutex); if (_threads.size() >= maxThreads()) { log_warn("thread limit " << maxThreads() << " reached"); return; } try { Worker* worker = new Worker(*this); try { log_debug("create thread " << static_cast(worker) << "; running threads=" << _threads.size()); worker->start(); _threads.insert(worker); log_debug(_threads.size() << " threads running"); } catch (const std::exception&) { delete worker; throw; } } catch (const std::exception& e) { log_warn("failed to create thread: " << e.what()); } } void ServerImpl::onThreadTerminated(const ThreadTerminatedEvent& event) { MutexLock lock(_threadMutex); log_debug("thread terminated (" << static_cast(event.worker()) << ") " << _threads.size() << " threads left"); try { event.worker()->join(); } catch (const std::exception& e) { log_error("failed to join thread: " << e.what()); } delete event.worker(); } void ServerImpl::onServerStart(const ServerStartEvent& event) { if (event.server() == this) { start(); } } void ServerImpl::onInput(Socket& socket) { socket.removeSelector(); log_debug("search socket " << static_cast(&socket) << " in idle sockets"); _idleSockets.erase(&socket); if (socket.isConnected()) { socket.inputConnection.close(); socket.timeoutConnection.close(); _eventLoop.commitEvent(ActiveSocketEvent(&socket)); } else { log_debug("onInput; delete " << static_cast(&socket)); delete &socket; } } void ServerImpl::onTimeout(Socket& socket) { log_debug("timeout; socket " << static_cast(&socket)); _eventLoop.commitEvent(KeepAliveTimeoutEvent(&socket)); } void ServerImpl::onKeepAliveTimeout(const KeepAliveTimeoutEvent& event) { Socket* socket = event.socket(); _idleSockets.erase(socket); log_debug("onKeepAliveTimeout; delete " << static_cast(&socket)); delete socket; } } } cxxtools-3.0/src/http/client.cpp0000664000175000017500000001310413644433072013717 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include "clientimpl.h" namespace cxxtools { namespace http { ClientImpl* Client::getImpl() { if (!_impl) { _impl = new ClientImpl(this); _impl->addRef(); } return _impl; } Client& Client::operator= (const Client& other) { if (_impl && _impl->release() <= 0) delete _impl; _impl = other._impl; if (_impl) _impl->addRef(); return *this; } Client::~Client() { if (_impl && _impl->release() <= 0) delete _impl; } void Client::prepareConnect(const net::AddrInfo& addrinfo, bool ssl) { getImpl()->prepareConnect(addrinfo, std::string()); getImpl()->ssl(ssl); } void Client::prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { getImpl()->prepareConnect(addrinfo, sslCertificate); } void Client::prepareConnect(const std::string& host, unsigned short int port, bool ssl) { prepareConnect(net::AddrInfo(host, port), ssl); } void Client::prepareConnect(const std::string& host, unsigned short int port, const std::string& sslCertificate) { prepareConnect(net::AddrInfo(host, port), sslCertificate); } void Client::prepareConnect(const net::Uri& uri) { #ifdef WITH_SSL if (uri.protocol() != "http" && uri.protocol() != "https") throw std::runtime_error("only protocols http and https are supported by http client"); prepareConnect(net::AddrInfo(uri.host(), uri.port()), uri.protocol() == "https"); #else if (uri.protocol() != "http") throw std::runtime_error("only protocol http is supported by http client"); prepareConnect(net::AddrInfo(uri.host(), uri.port())); #endif auth(uri.user(), uri.password()); } void Client::connect() { getImpl()->connect(); } void Client::close() { if (_impl) _impl->close(); } const ReplyHeader& Client::execute(const Request& request, Milliseconds timeout, Milliseconds connectTimeout) { try { return _impl->execute(request, timeout, connectTimeout); } catch (...) { cancel(); throw; } } const Reply& Client::reply() const { return _impl->reply(); } Reply& Client::reply() { return _impl->reply(); } const Reply& Client::readBody() { _impl->readBody(); return reply(); } const Reply& Client::get(const std::string& url, const QueryParams& qparams, Milliseconds timeout, Milliseconds connectTimeout) { Request request(url); request.method("GET"); request.qparams(qparams.getUrl()); execute(request, timeout, connectTimeout); readBody(); return _impl->reply(); } const Reply& Client::post(const std::string& url, const QueryParams& qparams, Milliseconds timeout, Milliseconds connectTimeout) { Request request(url); request.method("POST"); request.body() << qparams.getUrl(); request.addHeader("Content-Type", "application/x-www-form-urlencoded"); execute(request, timeout, connectTimeout); readBody(); return _impl->reply(); } void Client::beginExecute(const Request& request) { _impl->beginExecute(request); } void Client::endExecute() { _impl->endExecute(); } void Client::setSelector(SelectorBase* selector) { getImpl()->setSelector(selector); } void Client::setSelector(SelectorBase& selector) { getImpl()->setSelector(&selector); } void Client::setSslVerify(int level, const std::string& ca) { getImpl()->setSslVerify(level, ca); } SelectorBase* Client::selector() { return _impl ? _impl->selector() : 0; } bool Client::wait(Milliseconds msecs) { return _impl->wait(msecs); } std::istream& Client::in() { return _impl->in(); } const std::string& Client::host() const { return getImpl()->host(); } unsigned short int Client::port() const { return getImpl()->port(); } void Client::auth(const std::string& username, const std::string& password) { getImpl()->auth(username, password); } void Client::clearAuth() { getImpl()->clearAuth(); } void Client::cancel() { if (_impl) _impl->cancel(); } Delegate& Client::acceptSslCertificate() { return getImpl()->socket().acceptSslCertificate; } } // namespace http } // namespace cxxtools cxxtools-3.0/src/http/mapper.cpp0000664000175000017500000000617013644433072013732 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "mapper.h" log_define("cxxtools.http.mapper") namespace cxxtools { namespace http { void Mapper::addService(const std::string& url, Service& service) { log_debug("add service for url <" << url << '>'); WriteLock serviceLock(_serviceMutex); _services.push_back(ServicesType::value_type(url, &service)); } void Mapper::addService(const Regex& url, Service& service) { log_debug("add service for regex"); WriteLock serviceLock(_serviceMutex); _services.push_back(ServicesType::value_type(url, &service)); } void Mapper::removeService(Service& service) { WriteLock serviceLock(_serviceMutex); service.waitIdle(); ServicesType::size_type n = 0; while (n < _services.size()) { if (_services[n].second == &service) { _services.erase(_services.begin() + n); } else { ++n; } } } Responder* Mapper::getResponder(const Request& request) { log_debug("get responder for url <" << request.url() << '>'); ReadLock serviceLock(_serviceMutex); for (ServicesType::const_iterator it = _services.begin(); it != _services.end(); ++it) { if (it->first.match(request.url())) { if (!it->second->checkAuth(request)) { return _noAuthService.createResponder(request, it->second->realm(), it->second->authContent()); } Responder* resp = it->second->doCreateResponder(request); if (resp) { log_debug("got responder"); return resp; } } } log_debug("use default responder"); return _defaultService.createResponder(request); } } } cxxtools-3.0/src/http/parser.cpp0000664000175000017500000005541613644433072013751 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "parser.h" #include #include #include #include #include log_define("cxxtools.http.parser") namespace cxxtools { namespace http { namespace { std::string chartoprint(char ch) { const static char hex[] = "0123456789abcdef"; if (std::isprint(ch)) return std::string(1, '\'') + ch + '\''; else return std::string("'\\x") + hex[(ch >> 4) & 0xf] + hex[ch & 0xf] + '\''; } inline bool istokenchar(char ch) { static const char s[] = "\"(),/:;<=>?@[\\]{}"; return std::isalpha(ch) || std::binary_search(s, s + sizeof(s) - 1, ch); } inline bool isHexDigit(char ch) { return (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } inline unsigned valueOfHexDigit(char ch) { return ch >= '0' && ch <= '9' ? ch - '0' : ch >= 'a' && ch <= 'z' ? ch - 'a' + 10 : ch >= 'A' && ch <= 'Z' ? ch - 'A' + 10 : 0; } } void HeaderParser::Event::onMethod(const std::string& /*method*/) { } void HeaderParser::Event::onUrl(const std::string& /*url*/) { } void HeaderParser::Event::onUrlParam(const std::string& /*q*/) { } void HeaderParser::Event::onHttpVersion(unsigned /*major*/, unsigned /*minor*/) { } void HeaderParser::Event::onKey(const std::string& /*key*/) { } void HeaderParser::Event::onValue(const std::string& /*value*/) { } void HeaderParser::Event::onHttpReturn(unsigned /*ret*/, const std::string& /*text*/) { } void HeaderParser::Event::onEnd() { } void HeaderParser::MessageHeaderEvent::onHttpVersion(unsigned major, unsigned minor) { _header.httpVersion(major, minor); } void HeaderParser::MessageHeaderEvent::onKey(const std::string& key) { strncpy(_key, key.c_str(), MessageHeader::MAXHEADERSIZE); } void HeaderParser::MessageHeaderEvent::onValue(const std::string& value) { _header.addHeader(_key, value.c_str()); } std::size_t HeaderParser::advance(std::streambuf& sb) { std::size_t ret = 0; while (sb.in_avail() > 0) { ++ret; if (parse(sb.sbumpc())) return ret; } return ret; } void HeaderParser::state_cmd0(char ch) { if (istokenchar(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_cmd; return; } else if (ch != ' ' && ch != '\t') { log_warn("invalid character " << chartoprint(ch) << " in method"); state = &HeaderParser::state_error; return; } else { state = &HeaderParser::state_cmd; return; } } void HeaderParser::state_cmd(char ch) { if (istokenchar(ch)) { token += ch; return; } else if (ch == ' ') { log_debug("method=" << token); ev.onMethod(token); state = &HeaderParser::state_url0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in method"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_url0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '/' || ch == '*') { token.reserve(32); token = ch; state = &HeaderParser::state_url; return; } else if (std::isalpha(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_uri_protocol; return; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_uri_protocol(char ch) { if (std::isalpha(ch)) { } else if (ch == ':') { token.clear(); state = &HeaderParser::state_uri_protocol_e; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; } } void HeaderParser::state_uri_protocol_e(char ch) { if (token.size() < 2 && ch == '/') { token += ch; } else if (token.size() == 2 && std::isalpha(ch)) { token = ch; state = &HeaderParser::state_uri_host; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; } } void HeaderParser::state_uri_host(char ch) { if (std::isalnum(ch) || ch == '.' || ch == ':' || ch == '[' || ch == ']') { } else if (ch == '/') { token = ch; state = &HeaderParser::state_url; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; } } void HeaderParser::state_url(char ch) { if (ch == '?') { log_debug("url=" << token); ev.onUrl(token); token.clear(); token.reserve(32); state = &HeaderParser::state_qparam; return; } else if (ch == ' ' || ch == '\t') { log_debug("url=" << token); ev.onUrl(token); token.clear(); token.reserve(32); state = &HeaderParser::state_protocol0; return; } else if (ch == '+') { token += ' '; return; } else if (ch == '%') { token += ch; state = &HeaderParser::state_urlesc; return; } else if (ch > ' ') { token += ch; return; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_urlesc(char ch) { if (isHexDigit(ch)) { if (token.size() >= 2 && token[token.size() - 2] == '%') { unsigned v = (valueOfHexDigit(token[token.size() - 1]) << 4) | valueOfHexDigit(ch); if (v == 0) { log_warn("%00 not allowed in url"); state = &HeaderParser::state_error; return; } token[token.size() - 2] = static_cast(v); token.resize(token.size() - 1); state = &HeaderParser::state_url; return; } else { token += ch; return; } } else { log_warn("invalid hex digit " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_qparam(char ch) { if (ch == ' ' || ch == '\t') { log_debug("queryString=" << token); ev.onUrlParam(token); token.clear(); token.reserve(32); state = &HeaderParser::state_protocol0; return; } else { token += ch; return; } } void HeaderParser::state_protocol0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isalpha(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_protocol; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_protocol(char ch) { if (ch == ' ' || ch == '\t' || ch == '/') { if (token != "HTTP") { log_warn("invalid protocol " << token << " in http protocol field"); state = &HeaderParser::state_error; return; } else { state = (ch == '/' ? &HeaderParser::state_version_major : &HeaderParser::state_version0); return; } } else if (std::isalpha(ch)) { token += std::toupper(ch); return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '/') { state = &HeaderParser::state_version_major; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version_major(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '1') { state = &HeaderParser::state_version_major_e; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version_major_e(char ch) { if (ch == ' ' || ch == '\t') { state = &HeaderParser::state_version_major_e; return; } else if (ch == '.') { state = &HeaderParser::state_version_minor; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version_minor(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '0' || ch == '1') { ev.onHttpVersion(1, ch - '0'); state = &HeaderParser::state_end0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_end0(char ch) { if (ch == '\n') { state = &HeaderParser::state_h0; return; } else if (ch == ' ' || ch == '\t' || ch == '\r') { return; } else { log_warn("invalid character " << chartoprint(ch) << " in http request line"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_h0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch > 32 && ch < 127) { token.reserve(32); token = ch; state = &HeaderParser::state_hfieldname; return; } else if (ch == '\r') { state = &HeaderParser::state_hcr; return; } else if (ch == '\n') { ev.onEnd(); state = &HeaderParser::state_end; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http header"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hcr(char ch) { if (ch == '\n') { ev.onEnd(); state = &HeaderParser::state_end; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http header"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldname(char ch) { if (ch == ':') { ev.onKey(token); state = &HeaderParser::state_hfieldbody0; return; } else if (ch == ' ' || ch == '\t') { ev.onKey(token); state = &HeaderParser::state_hfieldnamespace; return; } else if (ch > 32 && ch < 127) { token += ch; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldname"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldnamespace(char ch) { if (ch == ':') { state = &HeaderParser::state_hfieldbody0; return; } else if (ch == ' ' || ch == '\t') { return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldname"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldbody0(char ch) { if (ch == '\r') { state = &HeaderParser::state_hfieldbody_cr; return; } else if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; return; } else if (std::isspace(ch)) { return; } else if (!std::isspace(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_hfieldbody; return; } } void HeaderParser::state_hfieldbody(char ch) { if (ch == '\r') { state = &HeaderParser::state_hfieldbody_cr; return; } else if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; return; } else { token += ch; return; } } void HeaderParser::state_hfieldbody_cr(char ch) { if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldbody"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldbody_crlf(char ch) { if (ch == '\r') { ev.onValue(token); state = &HeaderParser::state_hend_cr; return; } else if (ch == '\n') { ev.onValue(token); ev.onEnd(); state = &HeaderParser::state_end; return; } else if (ch == ' ' || ch == '\t') { token += ch; state = &HeaderParser::state_hfieldbody; return; } else if (ch > 32 && ch < 127) { ev.onValue(token); token.reserve(32); token = ch; state = &HeaderParser::state_hfieldname; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldbody"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hend_cr(char ch) { if (ch == '\n') { ev.onEnd(); state = &HeaderParser::state_end; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldbody"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_protocol0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isalpha(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_cl_protocol; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_protocol(char ch) { if (ch == ' ' || ch == '\t' || ch == '/') { if (token != "HTTP") { log_warn("invalid protocol " << token << " in http protocol field"); state = &HeaderParser::state_error; return; } else { state = (ch == '/' ? &HeaderParser::state_cl_version_major : &HeaderParser::state_cl_version0); return; } } else if (std::isalpha(ch)) { token += std::toupper(ch); return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '/') { state = &HeaderParser::state_cl_version_major; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version_major(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '1') { state = &HeaderParser::state_cl_version_major_e; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version_major_e(char ch) { if (ch == ' ' || ch == '\t') { state = &HeaderParser::state_cl_version_major_e; return; } else if (ch == '.') { state = &HeaderParser::state_cl_version_minor; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version_minor(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '0' || ch == '1') { ev.onHttpVersion(1, ch - '0'); state = &HeaderParser::state_cl_httpresult0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http result"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_httpresult0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isdigit(ch)) { value = (ch - '0'); state = &HeaderParser::state_cl_httpresult; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http result"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_httpresult(char ch) { if (std::isdigit(ch)) { value = value * 10 + (ch - '0'); return; } else if (ch == ' ' || ch == '\t') { token.clear(); token.reserve(32); state = &HeaderParser::state_cl_httpresulttext; } } void HeaderParser::state_cl_httpresulttext(char ch) { if (ch == '\r') { ev.onHttpReturn(value, token); state = &HeaderParser::state_cl_httpresult_cr; return; } else if (ch == '\n') { ev.onHttpReturn(value, token); state = &HeaderParser::state_h0; return; } else if (token.empty() && (ch == ' ' || ch == '\t')) { return; } else { token += ch; return; } } void HeaderParser::state_cl_httpresult_cr(char ch) { if (ch == '\n') { state = &HeaderParser::state_h0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in requestheader"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_end(char /*ch*/) { return; } void HeaderParser::state_error(char /*ch*/) { return; } } } cxxtools-3.0/src/http/chunkedreader.h0000664000175000017500000000532413644433072014717 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef HTTP_CHUNKEDHREADER_H #define HTTP_CHUNKEDHREADER_H #include #include namespace cxxtools { namespace http { class ChunkedReader : public std::streambuf { std::streambuf* _ib; char* _buffer; unsigned _bufsize; unsigned _chunkSize; void (ChunkedReader::*_state)(); void onBegin(); void onSize(); void onEndl(); void onExtension(); void onData(); void onDataEnd0(); void onDataEnd(); void onTrailer(); void onTrailerData(); public: explicit ChunkedReader(std::streambuf* ib, unsigned bufsize = 8192); ~ChunkedReader() { delete[] _buffer; } void reset() { _state = &ChunkedReader::onBegin; setg(0, 0, 0); } bool eod() const { return _state == 0; } std::streamsize showmanyc(); virtual int sync(); virtual int_type overflow(int_type ch); virtual int_type underflow(); }; class ChunkedIStream : public std::istream { ChunkedReader _streambuf; public: explicit ChunkedIStream(std::streambuf* ib) : std::istream(&_streambuf), _streambuf(ib) { } void reset() { _streambuf.reset(); clear(); } bool eod() const { return _streambuf.eod(); } }; } } #endif // HTTP_CHUNKEDHREADER_H cxxtools-3.0/src/http/serverimpl.h0000664000175000017500000000732613644433072014307 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_SERVERIMPL_H #define CXXTOOLS_HTTP_SERVERIMPL_H #include "serverimplbase.h" #include #include #include #include #include namespace cxxtools { class EventLoopBase; namespace net { class TcpServer; } namespace http { class Worker; class ServerImpl; class Socket; class IdleSocketEvent; class KeepAliveTimeoutEvent; class ServerStartEvent; class NoWaitingThreadsEvent; class ThreadTerminatedEvent; class ActiveSocketEvent; class ServerImpl : public ServerImplBase, public Connectable { public: ServerImpl(EventLoopBase& eventLoop, Signal& runmodeChanged); ~ServerImpl(); // override from ServerImplBase void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa); bool isTerminating() const { return runmode() == Server::Terminating; } // override from ServerImplBase void terminate(); private: void noWaitingThreads(); void onInput(Socket& _socket); void onTimeout(Socket& _socket); void addIdleSocket(Socket* socket); void onIdleSocket(const IdleSocketEvent& event); void onActiveSocket(const ActiveSocketEvent& event); void onKeepAliveTimeout(const KeepAliveTimeoutEvent& event); void onNoWaitingThreads(const NoWaitingThreadsEvent& event); void onThreadTerminated(const ThreadTerminatedEvent& event); void onServerStart(const ServerStartEvent& event); void start(); friend class Worker; //////////////////////////////////////////////////// MethodSlot inputSlot; MethodSlot timeoutSlot; Queue _queue; std::set _idleSockets; //////////////////////////////////////////////////// typedef std::vector ListenerType; ListenerType _listener; //////////////////////////////////////////////////// typedef std::set Threads; Threads _threads; Threads _terminatedThreads; Mutex _threadMutex; Condition _threadTerminated; void threadTerminated(Worker* worker); }; } } #endif // CXXTOOLS_HTTP_SERVERIMPL_H cxxtools-3.0/src/http/notfoundresponder.h0000664000175000017500000000341313644433072015666 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTFOUNDRESPONDER_H #define CXXTOOLS_HTTP_NOTFOUNDRESPONDER_H #include namespace cxxtools { namespace http { class NotFoundResponder : public Responder { public: explicit NotFoundResponder(Service& service) : Responder(service) { } void reply(std::ostream&, Request& request, Reply& reply); }; } } #endif // CXXTOOLS_HTTP_NOTFOUNDRESPONDER_H cxxtools-3.0/src/http/socket.cpp0000664000175000017500000002443613644433072013743 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "socket.h" #include "serverimpl.h" #include #include #include "config.h" log_define("cxxtools.http.socket") namespace cxxtools { namespace http { void Socket::ParseEvent::onMethod(const std::string& method) { _request.method(method); } void Socket::ParseEvent::onUrl(const std::string& url) { _request.url(url); } void Socket::ParseEvent::onUrlParam(const std::string& q) { _request.qparams(q); } Socket::Socket(ServerImpl& server, net::TcpServer& tcpServer, const std::string& certificateFile, const std::string& privateKeyFile, int sslVerifyLevel, const std::string& sslCa) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(tcpServer), _certificateFile(certificateFile), _privateKeyFile(privateKeyFile), _server(server), _parseEvent(_request), _parser(_parseEvent, false), _responder(0), _sslVerifyLevel(sslVerifyLevel), _sslCa(sslCa), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(_timer.timeout, *this, &Socket::onTimeout); cxxtools::connect(acceptSslCertificate, *this, &Socket::onAcceptSslCertificate); } Socket::Socket(Socket& socket) : net::TcpSocket(), Connectable(*this), inputSlot(slot(*this, &Socket::onInput)), _tcpServer(socket._tcpServer), _certificateFile(socket._certificateFile), _privateKeyFile(socket._privateKeyFile), _server(socket._server), _parseEvent(_request), _parser(_parseEvent, false), _responder(0), _sslVerifyLevel(socket._sslVerifyLevel), _sslCa(socket._sslCa), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(_timer.timeout, *this, &Socket::onTimeout); cxxtools::connect(acceptSslCertificate, *this, &Socket::onAcceptSslCertificate); } Socket::~Socket() { if (_responder) _responder->release(); } void Socket::accept() { net::TcpSocket::accept(_tcpServer, net::TcpSocket::DEFER_ACCEPT); if (!_certificateFile.empty()) { loadSslCertificateFile(_certificateFile, _privateKeyFile); setSslVerify(_sslVerifyLevel, _sslCa); beginSslAccept(); } } void Socket::postAccept() { log_trace("post accept"); if (!_certificateFile.empty()) { cxxtools::Timespan t = getTimeout(); setTimeout(cxxtools::Seconds(10)); endSslAccept(); setTimeout(t); } _accepted = true; _stream.buffer().beginRead(); log_debug("accepted"); _timer.start(_server.readTimeout()); } void Socket::setSelector(SelectorBase* s) { s->add(*this); s->add(_timer); } void Socket::removeSelector() { TcpSocket::setSelector(0); _timer.setSelector(0); } void Socket::onIODeviceInput(IODevice& /*iodevice*/) { log_debug("onIODeviceInput"); inputReady(*this); } void Socket::onInput(StreamBuffer& sb) { log_debug("onInput"); sb.endRead(); if (sb.in_avail() == 0 || sb.device()->eof()) { close(); return; } _timer.start(_server.readTimeout()); if ( _responder == 0 ) { _parser.advance(sb); if (_parser.fail()) { _responder = _server.getDefaultResponder(_request); _responder->replyError(_reply.bodyStream(), _request, _reply, std::runtime_error("invalid http header")); _responder->release(); _responder = 0; sendReply(); onOutput(sb); return; } if (_parser.end()) { log_info("request " << _request.method() << ' ' << _request.header().query() << " from client " << getPeerAddr()); _responder = _server.getResponder(_request); try { _responder->beginRequest(*this, _stream, _request); } catch (const std::exception& e) { _reply.setHeader("Connection", "close"); _responder->replyError(_reply.bodyStream(), _request, _reply, e); _responder->release(); _responder = 0; sendReply(); onOutput(sb); return; } _contentLength = _request.header().contentLength(); log_debug("content length of request is " << _contentLength); if (_contentLength == 0) { _timer.stop(); doReply(); return; } } else { sb.beginRead(); } } if (_responder) { if (sb.in_avail() > 0) { try { std::size_t s = _responder->readBody(_stream); assert(s > 0); _contentLength -= s; } catch (const std::exception& e) { _reply.setHeader("Connection", "close"); _responder->replyError(_reply.bodyStream(), _request, _reply, e); _responder->release(); _responder = 0; sendReply(); onOutput(sb); return; } } if (_contentLength <= 0) { _timer.stop(); doReply(); } else { sb.beginRead(); } } } bool Socket::doReply() { log_trace("http::Socket::doReply"); try { _responder->reply(_reply.bodyStream(), _request, _reply); } catch (const std::exception& e) { log_warn("responder reported error: " << e.what()); _reply.clear(); _responder->replyError(_reply.bodyStream(), _request, _reply, e); } _responder->release(); _responder = 0; sendReply(); return onOutput(_stream.buffer()); } bool Socket::onOutput(StreamBuffer& sb) { log_trace("onOutput"); log_debug("send data to " << getPeerAddr()); try { sb.endWrite(); if ( sb.out_avail() ) { sb.beginWrite(); _timer.start(_server.writeTimeout()); } else { bool keepAlive = _request.header().keepAlive() && _reply.header().keepAlive(); if (keepAlive) { log_debug("do keep alive"); _timer.start(_server.keepAliveTimeout()); _request.clear(); _reply.clear(); _parser.reset(false); if (sb.in_avail()) onInput(sb); else _stream.buffer().beginRead(); } else { log_debug("don't do keep alive"); close(); return false; } } } catch (const std::exception& e) { log_warn("exception occured when processing request: " << e.what()); close(); timeout(*this); return false; } return true; } void Socket::onTimeout() { log_debug("timeout"); timeout(*this); } void Socket::sendReply() { const char* contentLength = "Content-Length"; const char* server = "Server"; const char* connection = "Connection"; const char* date = "Date"; log_info("request " << _request.method() << ' ' << _request.header().query() << " ready, returncode " << _reply.httpReturnCode() << ' ' << _reply.httpReturnText()); _stream << "HTTP/" << _reply.header().httpVersionMajor() << '.' << _reply.header().httpVersionMinor() << ' ' << _reply.header().httpReturnCode() << ' ' << _reply.header().httpReturnText() << "\r\n"; for (ReplyHeader::const_iterator it = _reply.header().begin(); it != _reply.header().end(); ++it) { _stream << it->first << ": " << it->second << "\r\n"; } if (!_reply.header().hasHeader(contentLength)) { _stream << "Content-Length: " << _reply.bodySize() << "\r\n"; } if (!_reply.header().hasHeader(server)) { _stream << "Server: cxxtools-Http-Server " PACKAGE_VERSION "\r\n"; } if (!_reply.header().hasHeader(connection)) { _stream << "Connection: " << (_request.header().keepAlive() ? "keep-alive" : "close") << "\r\n"; } if (!_reply.header().hasHeader(date)) { char buffer[50]; _stream << "Date: " << MessageHeader::htdateCurrent(buffer) << "\r\n"; } _stream << "\r\n"; _reply.sendBody(_stream); } bool Socket::onAcceptSslCertificate(const SslCertificate& cert) { return !_server.acceptSslCertificate.isConnected() || _server.acceptSslCertificate(cert); } } // namespace http } // namespace cxxtools cxxtools-3.0/src/http/worker.h0000664000175000017500000000344113644433072013422 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_WORKER_H #define CXXTOOLS_HTTP_WORKER_H #include namespace cxxtools { namespace http { class ServerImpl; class Worker : public AttachedThread { public: explicit Worker(ServerImpl& server) : AttachedThread(callable(*this, &Worker::run)), _server(server) { } void run(); private: ServerImpl& _server; }; } } #endif // CXXTOOLS_HTTP_WORKER_H cxxtools-3.0/src/http/worker.cpp0000664000175000017500000001113413644433072013753 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "worker.h" #include "serverimpl.h" #include #include #include "socket.h" log_define("cxxtools.http.worker") namespace cxxtools { namespace http { void Worker::run() { log_info("new thread running"); while (!_server.isTerminating() && _server._queue.numWaiting() < _server.minThreads()) { Socket* socket = _server._queue.get(); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } if (_server._queue.numWaiting() == 0) _server.noWaitingThreads(); try { if (!socket->hasAccepted()) { try { // do blocking accept socket->accept(); log_debug("connection accepted from " << socket->getPeerAddr()); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } // new connection arrived - create new accept socket log_info("new connection accepted from " << socket->getPeerAddr()); _server._queue.put(new Socket(*socket)); socket->postAccept(); } catch (const std::exception&) { _server._queue.put(new Socket(*socket)); throw; } } else if (socket->isConnected()) { log_debug("process available input from " << socket->getPeerAddr()); socket->onInput(socket->buffer()); } else { log_debug("socket is not connected any more; delete " << static_cast(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; continue; } Connection inputConnection = connect(socket->buffer().inputReady, socket->inputSlot); while (socket->wait(10) && socket->isConnected()) ; if (socket->isConnected()) { log_debug("timeout processing socket"); inputConnection.close(); _server.addIdleSocket(socket); } else if (_server.isTerminating()) { _server._queue.put(socket); } else { log_debug("socket is not connected any more; delete " << static_cast(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; } } catch (const net::AcceptTerminated&) { delete socket; } catch (const std::exception& e) { log_warn("error occured in device: " << e.what() << "; delete " << static_cast(socket)); delete socket; } } log_info("thread terminated"); _server.threadTerminated(this); } } } cxxtools-3.0/src/http/clientimpl.cpp0000664000175000017500000004474613644433072014621 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "clientimpl.h" #include #include #include "parser.h" #include #include #include #include #include #include "config.h" #include log_define("cxxtools.http.client.impl") namespace cxxtools { namespace http { void ClientImpl::ParseEvent::onHttpReturn(unsigned ret, const std::string& text) { _replyHeader.httpReturn(ret, text); } ClientImpl::ClientImpl(Client* client) : _client(client), _request(0), _parseEvent(_reply.header()), _parser(_parseEvent, true), #ifdef WITH_SSL _ssl(false), #endif _stream(8192, true), _chunkedIStream(_stream.rdbuf()), _bodyStream(_stream.rdbuf()), _readHeader(true), _chunkedEncoding(false), _reconnectOnError(false), _errorPending(false) { _stream.attachDevice(_socket); cxxtools::connect(_socket.connected, *this, &ClientImpl::onConnect); #ifdef WITH_SSL cxxtools::connect(_socket.sslConnected, *this, &ClientImpl::onSslConnect); #endif cxxtools::connect(_stream.buffer().outputReady, *this, &ClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &ClientImpl::onInput); } void ClientImpl::prepareConnect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { #ifdef WITH_SSL if (addrinfo != _addrInfo || sslCertificate != _sslCertificate || _ssl != _sslCertificate.empty()) { _addrInfo = addrinfo; _sslCertificate = sslCertificate; _ssl = !sslCertificate.empty(); _socket.close(); } #else if (addrinfo != _addrInfo) { _addrInfo = addrinfo; _socket.close(); } #endif } void ClientImpl::reexecute(const Request& request) { log_debug("reexecute"); _stream.clear(); _stream.buffer().discard(); _socket.connect(_addrInfo); #ifdef WITH_SSL if (_ssl) { if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); _socket.sslConnect(); } #endif sendRequest(request); _stream.flush(); } void ClientImpl::reexecuteBegin(const Request& /*request*/) { log_debug("reexecuteBegin"); _stream.clear(); _stream.buffer().discard(); _socket.beginConnect(_addrInfo); _reconnectOnError = false; } void ClientImpl::doparse() { char ch; while (!_parser.end() && _stream.get(ch)) _parser.parse(ch); } const ReplyHeader& ClientImpl::execute(const Request& request, Timespan timeout, Timespan connectTimeout) { log_trace("execute request " << request.url()); if (_chunkedEncoding) { while (_chunkedIStream) _chunkedIStream.get(); } else { while (_bodyStream) _bodyStream.get(); } if (connectTimeout < Timespan(0)) connectTimeout = timeout; _reply.clear(); _socket.setTimeout(connectTimeout); bool shouldReconnect = _socket.isConnected(); if (!shouldReconnect) { log_debug("connect"); _socket.connect(_addrInfo); #ifdef WITH_SSL if (_ssl) { log_debug("ssl connect"); if (!_sslCertificate.empty()) _socket.loadSslCertificateFile(_sslCertificate); _socket.setSslVerify(_sslVerifyLevel, _sslCa); _socket.sslConnect(); } #endif } _socket.setTimeout(timeout); log_debug("send request"); sendRequest(request); _stream.flush(); if (!_stream && shouldReconnect) { // sending failed and we were not connected before, so try again reexecute(request); shouldReconnect = false; } if (!_stream) throw IOError("error sending HTTP request"); log_debug("read reply"); _parser.reset(true); _readHeader = true; doparse(); if (_parser.begin() && shouldReconnect) { // reading failed and we were not connected before, so try again reexecute(request); if (!_stream) throw IOError("error sending HTTP request"); doparse(); } log_debug("reply ready"); if (_stream.fail()) throw IOError("failed to read HTTP reply"); if (_parser.fail()) throw IOError("invalid HTTP reply"); if (!_parser.end()) throw IOError("incomplete HTTP reply header"); _chunkedEncoding = _reply.header().chunkedTransferEncoding(); if (_chunkedEncoding) { _chunkedIStream.reset(); } else { std::size_t n = _reply.header().contentLength(); _bodyStream.clear(); _bodyStream.icount(n); log_debug("content length " << n); } return _reply.header(); } void ClientImpl::readBody() { if (_chunkedEncoding) { log_debug("read body with chunked encoding"); _reply.bodyStream() << _chunkedIStream.rdbuf(); if (!_chunkedIStream.eod()) { _chunkedIStream.setstate(std::ios::failbit); throw IOError("error reading HTTP reply body: incomplete chunked data stream"); } } else if (_bodyStream.icount() > 0) { _reply.bodyStream() << _bodyStream.rdbuf(); if (_bodyStream.icount() > 0 || !_reply.bodyStream()) { _stream.setstate(std::ios::failbit); throw IOError("error reading HTTP reply body"); } } if (!_reply.header().keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } else { log_debug("do not close socket - keep alive"); } } void ClientImpl::beginExecute(const Request& request) { if (_socket.selector() == 0) throw std::logic_error("cannot run async http request without a selector"); log_trace("beginExecute"); _errorPending = false; _request = &request; _reply.clear(); if (_socket.isConnected()) { log_debug("we are connected already"); sendRequest(*_request); try { _stream.buffer().beginWrite(); _reconnectOnError = true; } catch (const IOError&) { log_debug("first write failed, so connection is not active any more"); _stream.clear(); _stream.buffer().discard(); _socket.beginConnect(_addrInfo); _reconnectOnError = false; } } else { log_debug("not yet connected - do it now"); _socket.beginConnect(_addrInfo); _reconnectOnError = false; } } void ClientImpl::endExecute() { if (_errorPending) { _errorPending = false; throw; } } bool ClientImpl::wait(std::size_t msecs) { return _socket.wait(msecs); } SelectorBase* ClientImpl::selector() { return _socket.selector(); } void ClientImpl::sendRequest(const Request& request) { log_debug("send request " << request.url()); static const char* contentLength = "Content-Length"; static const char* connection = "Connection"; static const char* date = "Date"; static const char* host = "Host"; static const char* authorization = "Authorization"; static const char* userAgent = "User-Agent"; _stream << request.method() << ' ' << request.url(); if (!request.qparams().empty() && request.method() == "GET") _stream << '?' << request.qparams(); _stream << " HTTP/" << request.header().httpVersionMajor() << '.' << request.header().httpVersionMinor() << "\r\n"; for (RequestHeader::const_iterator it = request.header().begin(); it != request.header().end(); ++it) { _stream << it->first << ": " << it->second << "\r\n"; } if (!request.header().hasHeader(contentLength)) { _stream << "Content-Length: " << request.bodySize() << "\r\n"; } if (!request.header().hasHeader(connection)) { _stream << "Connection: keep-alive\r\n"; } if (!request.header().hasHeader(date)) { char buffer[50]; _stream << "Date: " << MessageHeader::htdateCurrent(buffer) << "\r\n"; } if (!request.header().hasHeader(host)) { _stream << "Host: " << _addrInfo.host(); unsigned short port = _addrInfo.port(); if (port != 80) _stream << ':' << port; _stream << "\r\n"; } if (!request.header().hasHeader(userAgent)) { _stream << "User-Agent: " PACKAGE_STRING " http client\r\n"; } if (!_username.empty() && !request.header().hasHeader(authorization)) { std::ostringstream d; BasicTextOStream b(d, new Base64Codec()); b << _username << ':' << _password; b.terminate(); log_debug("set Authorization to " << d.str()); _stream << "Authorization: Basic " << d.str() << "\r\n"; } _stream << "\r\n"; log_debug("send body; " << request.bodySize() << " bytes"); request.sendBody(_stream); } void ClientImpl::onConnect(net::TcpSocket& socket) { try { log_trace("onConnect"); _errorPending = false; socket.endConnect(); #ifdef WITH_SSL if (_ssl) { if (!_sslCertificate.empty()) socket.loadSslCertificateFile(_sslCertificate); socket.setSslVerify(_sslVerifyLevel, _sslCa); socket.beginSslConnect(); return; } #endif sendRequest(*_request); log_debug("request sent - begin write"); _stream.buffer().beginWrite(); } catch (const std::exception& ) { _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } #ifdef WITH_SSL void ClientImpl::onSslConnect(net::TcpSocket& socket) { try { log_trace("onSslConnect"); _errorPending = false; socket.endSslConnect(); sendRequest(*_request); log_debug("request sent - begin write"); _stream.buffer().beginWrite(); } catch (const std::exception& ) { _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } #endif void ClientImpl::onOutput(StreamBuffer& sb) { log_trace("ClientImpl::onOutput; out_avail=" << sb.out_avail()); try { try { _errorPending = false; sb.endWrite(); if( sb.out_avail() > 0 ) { sb.beginWrite(); } else { sb.beginRead(); _client->requestSent(*_client); _parser.reset(true); _readHeader = true; } } catch (const IOError& e) { if (_reconnectOnError && _request != 0) { log_debug("reconnect on error"); _socket.close(); _reconnectOnError = false; reexecuteBegin(*_request); return; } throw; } } catch (const std::exception& e) { log_warn("error of type " << typeid(e).name() << " occured: " << e.what()); _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } void ClientImpl::onInput(StreamBuffer& sb) { try { try { log_trace("ClientImpl::onInput; readHeader=" << _readHeader); _errorPending = false; sb.endRead(); if (sb.device()->eof()) throw IOError("end of input"); _reconnectOnError = false; if (_readHeader) { processHeaderAvailable(sb); } else { processBodyAvailable(sb); } } catch (const IOError& e) { // after writing the request, the first read request may // detect, that the server has already closed the connection, // so check it here if (_readHeader && _reconnectOnError && _request != 0) { log_debug("reconnect on error"); _socket.close(); _reconnectOnError = false; reexecuteBegin(*_request); return; } throw; } } catch (const std::exception& e) { _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } void ClientImpl::processHeaderAvailable(StreamBuffer& sb) { _parser.advance(sb); if (_parser.fail()) throw std::runtime_error("http parser failed"); // TODO define exception class if( _parser.end() ) { _chunkedEncoding = _reply.header().chunkedTransferEncoding(); _client->headerReceived(*_client); _readHeader = false; if (_chunkedEncoding) { log_debug("chunked transfer encoding used"); _chunkedIStream.reset(); if( sb.in_avail() > 0 ) { processBodyAvailable(sb); } else { sb.beginRead(); } } else { _bodyStream.clear(); _bodyStream.icount(_reply.header().contentLength()); log_debug("header received - content-length=" << _bodyStream.icount()); if (_bodyStream.icount() > 0) { if( sb.in_avail() > 0 ) { processBodyAvailable(sb); } else { sb.beginRead(); } } else { if (!_reply.header().keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } _client->replyFinished(*_client); } } } else { sb.beginRead(); } } void ClientImpl::processBodyAvailable(StreamBuffer& sb) { log_trace("processBodyAvailable"); if (_chunkedEncoding) { if (_chunkedIStream.rdbuf()->in_avail() > 0) { if (!_chunkedIStream.eod()) { log_debug("read chunked encoding body"); while (_chunkedIStream.good() && _chunkedIStream.rdbuf()->in_avail() > 0 && !_chunkedIStream.eod()) { log_debug("bodyAvailable"); _client->bodyAvailable(*_client); } log_debug("in_avail=" << _chunkedIStream.rdbuf()->in_avail() << " eod=" << _chunkedIStream.eod()); if (_chunkedIStream.eod()) { _parser.readHeader(); } } if (_chunkedIStream.eod() && sb.in_avail() > 0) { log_debug("read chunked encoding post headers"); _parser.advance(sb); if (_parser.fail()) throw std::runtime_error("http parser failed"); // TODO define exception class if( _parser.end() ) { log_debug("reply finished"); if (!_reply.header().keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } _client->replyFinished(*_client); } } if (_chunkedIStream.fail()) throw IOError("error reading HTTP reply body"); } else if( _chunkedIStream.eod() ) { if( _reply.header().hasHeader("Trailer") ) _parser.readHeader(); else _client->replyFinished(*_client); } if (_socket.enabled()) { if ((!_chunkedIStream.eod() || !_parser.end())) { log_debug("call beginRead"); sb.beginRead(); } } else { cancel(); } } else { log_debug("content-length(pre)=" << _bodyStream.icount()); while (_stream.good() && _bodyStream.good() && _bodyStream.rdbuf()->in_avail() > 0) { _client->bodyAvailable(*_client); // TODO: may throw exception log_debug("content-length(post)=" << _bodyStream.icount()); } if (_stream.fail() || _bodyStream.fail()) throw IOError("error reading HTTP reply body"); if( _bodyStream.icount() <= 0 ) { log_debug("reply finished"); if (!_reply.header().keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } _client->replyFinished(*_client); } else if (_socket.enabled() && _stream.good()) { sb.beginRead(); } else { cancel(); } } } void ClientImpl::cancel() { _socket.close(); _stream.clear(); _stream.buffer().discard(); _chunkedIStream.reset(); } } // namespace http } // namespace cxxtools cxxtools-3.0/src/http/request.cpp0000664000175000017500000000373213644433072014137 00000000000000/* * Copyright (C) 2009 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace cxxtools { namespace http { Request::Auth Request::auth() const { Auth ret; const char* sp = getHeader("Authorization"); if (!sp) return ret; std::string s = sp; std::string::size_type p = s.find(' '); if (p == std::string::npos) return ret; std::istringstream in(s); in.ignore(p + 1); cxxtools::BasicTextIStream b(in, new cxxtools::Base64Codec()); std::getline(b, ret.user, ':'); std::getline(b, ret.password); return ret; } } } cxxtools-3.0/src/http/notauthenticatedservice.cpp0000664000175000017500000000362113644433072017370 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notauthenticatedservice.h" #include "notauthenticatedresponder.h" namespace cxxtools { namespace http { Responder* NotAuthenticatedService::createResponder(const Request& request) { return createResponder(request, std::string(), std::string()); } Responder* NotAuthenticatedService::createResponder(const Request& /*request*/, const std::string& realm, const std::string& authContent) { return new NotAuthenticatedResponder(*this, realm, authContent); } void NotAuthenticatedService::releaseResponder(Responder* responder) { delete responder; } } } cxxtools-3.0/src/http/responder.cpp0000664000175000017500000000432513644433072014447 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include namespace cxxtools { namespace http { void Responder::beginRequest(net::TcpSocket& /*socket*/, std::istream& /*in*/, Request& request) { _request = &request; } std::size_t Responder::readBody(std::istream& in) { std::streambuf* sb = in.rdbuf(); std::size_t ret = 0; while (sb->in_avail() > 0) { _request->body() << std::streambuf::traits_type::to_char_type(sb->sbumpc()); ++ret; } return ret; } void Responder::replyError(std::ostream& out, Request& /*request*/, Reply& reply, const std::exception& ex) { reply.httpReturn(500, "internal server error"); reply.setHeader("Content-Type", "text/plain"); reply.setHeader("Connection", "close"); out << ex.what(); } } // namespace http } // namespace cxxtools cxxtools-3.0/src/xml/0000775000175000017500000000000013672344760011645 500000000000000cxxtools-3.0/src/xml/xmldeserializer.cpp0000664000175000017500000003046313644433072015474 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmldeserializer.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/string.h" #include "cxxtools/utf8codec.h" #include "cxxtools/log.h" #include log_define("cxxtools.xml.deserializer") namespace cxxtools { namespace xml { namespace { std::ostream& operator<< (std::ostream& out, Node::Type type) { switch(type) { case Node::StartDocument: out << "StartDocument"; break; case Node::DocType: out << "DocType"; break; case Node::EndDocument: out << "EndDocument"; break; case Node::StartElement: out << "StartElement"; break; case Node::EndElement: out << "EndElement"; break; case Node::Characters: out << "Characters"; break; case Node::Comment: out << "Comment"; break; case Node::ProcessingInstruction: out << "ProcessingInstruction"; break; case Node::Unknown: default: out << "Unknown"; break; } return out; } } XmlDeserializer::XmlDeserializer(XmlReader& reader, bool readAttributes, const String& attributePrefix) : _readAttributes(readAttributes), _attributePrefix(attributePrefix) { parse(reader); } XmlDeserializer::XmlDeserializer(std::istream& is, bool readAttributes, const String& attributePrefix) : _readAttributes(readAttributes), _attributePrefix(attributePrefix) { parse(is); } void XmlDeserializer::parse(std::istream& is) { XmlReader reader(is); parse(reader); } void XmlDeserializer::parse(std::basic_istream& is) { XmlReader reader(is); parse(reader); } void XmlDeserializer::parse(XmlReader& reader) { begin(); if(reader.get().type() != Node::StartElement) reader.nextElement(); _processNode = &XmlDeserializer::beginDocument; _startDepth = reader.depth(); for(XmlReader::Iterator it = reader.current(); it != reader.end(); ++it) { (this->*_processNode)(reader); if( (it->type() == Node::EndElement) && (reader.depth() < _startDepth) ) { break; } } } void XmlDeserializer::beginDocument(XmlReader& reader) { const Node& node = reader.get(); log_debug("beginDocument; node type=" << node.type()); switch( node.type() ) { case Node::StartElement: { const StartElement& se = static_cast(node); _nodeName = se.name(); _nodeType = se.attribute(L"type"); _nodeCategory = se.attribute(L"category"); log_finer("node name=" << _nodeName); current()->setName(_nodeName.narrow()); current()->setTypeName(_nodeType.narrow()); current()->setCategory(nodeCategory()); if (_readAttributes) processAttributes(se.attributes()); _processNode = &XmlDeserializer::onRootElement; break; } default: throw std::logic_error("Expected start element"); }; } void XmlDeserializer::onRootElement(XmlReader& reader) { const Node& node = reader.get(); log_debug("onRootElement; node type=" << node.type()); switch( node.type() ) { case Node::Characters: { const Characters& chars = static_cast(node); if(cxxtools::String::npos != chars.content().find_first_not_of(L" \t\n\r") ) { setValue( chars.content() ); _processNode = &XmlDeserializer::onContent; } else { _processNode = &XmlDeserializer::onWhitespace; } break; } case Node::StartElement: { const StartElement& se = static_cast(node); _nodeName = se.name(); log_finer("node name=" << _nodeName); _nodeType = se.attribute(L"type"); _nodeCategory = se.attribute(L"category"); if (_readAttributes) _attributes = se.attributes(); _processNode = &XmlDeserializer::onStartElement; break; } case Node::EndElement: { if( _nodeName != static_cast(node).name() ) throw std::logic_error("Invalid element"); break; } default: throw std::logic_error("Invalid element"); }; } void XmlDeserializer::onStartElement(XmlReader& reader) { const Node& node = reader.get(); log_debug("onStartElement; node type=" << node.type()); switch( node.type() ) { case Node::Characters: { const Characters& chars = static_cast(node); if(cxxtools::String::npos != chars.content().find_first_not_of(L" \t\n\r") ) { std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); if (_readAttributes) { processAttributes(_attributes); _attributes.clear(); } setValue( chars.content() ); leaveMember(); //_current->addValue( _nodeName.narrow(), chars.content() ); _processNode = &XmlDeserializer::onContent; } else { std::string nodeName = _nodeName.narrow(); log_finer("node name=" << _nodeName); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); if (_readAttributes) { processAttributes(_attributes); _attributes.clear(); } _processNode = &XmlDeserializer::onWhitespace; } break; } case Node::StartElement: { std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); log_finer("beginMember " << nodeName); beginMember(nodeName, nodeType, nodeCategory()); const StartElement& se = static_cast(node); _nodeName = se.name(); log_finer("node name=" << se.name()); _nodeType = se.attribute(L"type"); _nodeCategory = se.attribute(L"category"); if (_readAttributes) { processAttributes(_attributes); _attributes = se.attributes(); } break; } case Node::EndElement: { if( _nodeName != static_cast(node).name() ) throw std::logic_error("Invalid element"); std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); if (_readAttributes) { processAttributes(_attributes); _attributes.clear(); } leaveMember(); _processNode = &XmlDeserializer::onEndElement; break; } default: throw std::logic_error("Invalid element"); }; } void XmlDeserializer::onWhitespace(XmlReader& reader) { const Node& node = reader.get(); log_debug("onWhitespaceElement; node type=" << node.type()); switch( node.type() ) { case Node::StartElement: { const StartElement& se = static_cast(node); _nodeName = se.name(); log_finer("node name=" << _nodeName); _nodeType = se.attribute(L"type"); _nodeCategory = se.attribute(L"category"); if (_readAttributes) _attributes = se.attributes(); _processNode = &XmlDeserializer::onStartElement; break; } case Node::EndElement: { _nodeName = static_cast(node).name(); if(reader.depth() >= _startDepth) leaveMember(); _processNode = &XmlDeserializer::onEndElement; break; } default: throw std::logic_error("Expected start element"); }; } void XmlDeserializer::onContent(XmlReader& reader) { const Node& node = reader.get(); log_debug("onContentElement; node type=" << node.type()); switch( node.type() ) { case Node::EndElement: { _processNode = &XmlDeserializer::onEndElement; break; } default: throw std::logic_error("Expected end element"); }; } void XmlDeserializer::onEndElement(XmlReader& reader) { const Node& node = reader.get(); log_debug("onEndElement; node type=" << node.type()); switch( node.type() ) { case Node::Characters: { _processNode = &XmlDeserializer::onWhitespace; break; } case Node::StartElement: { const StartElement& se = static_cast(node); _nodeName = se.name(); _nodeType = se.attribute(L"type"); _nodeCategory = se.attribute(L"category"); if (_readAttributes) { processAttributes(_attributes); _attributes = se.attributes(); } log_finer("node name=" << _nodeName); _processNode = &XmlDeserializer::onStartElement; break; } case Node::EndElement: { _nodeName = static_cast(node).name(); if(reader.depth() >= _startDepth) leaveMember(); break; } case Node::EndDocument: { break; } default: { throw std::logic_error("Expected start element"); } } } SerializationInfo::Category XmlDeserializer::nodeCategory() const { return _nodeCategory == L"array" ? SerializationInfo::Array : _nodeCategory == L"struct" || _nodeCategory == L"object" ? SerializationInfo::Object : _nodeCategory == L"scalar" || _nodeCategory == L"value" ? SerializationInfo::Value : SerializationInfo::Void; } void XmlDeserializer::processAttributes(const Attributes& attributes) { log_debug("processAttributes " << attributes.size() << " attributes"); SerializationInfo& si = *current(); for (Attributes::const_iterator it = attributes.begin(); it != attributes.end(); ++it) { SerializationInfo& m = si.addMember(cxxtools::encode(_attributePrefix + it->name())); m.setValue(it->value()); m.setTypeName("attribute"); } } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/entityresolver.cpp0000664000175000017500000002624013644433072015365 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace cxxtools { namespace xml { namespace { struct Ent { const wchar_t* entity; Char::value_type charValue; }; static const Ent ent[] = { { L"AElig", 0x00C6 }, { L"Acirc", 0x00C2 }, { L"Agrave", 0x00C0 }, { L"Alpha", 0x0391 }, { L"Aring", 0x00C5 }, { L"Atilde", 0x00C3 }, { L"Auml", 0x00C4 }, { L"Beta", 0x0392 }, { L"Ccedil", 0x00C7 }, { L"Chi", 0x03A7 }, { L"Dagger", 0x2021 }, { L"Delta", 0x0394 }, { L"ETH", 0x00D0 }, { L"Eacute", 0x00C9 }, { L"Ecirc", 0x00CA }, { L"Egrave", 0x00C8 }, { L"Epsilon", 0x0395 }, { L"Eta", 0x0397 }, { L"Euml", 0x00CB }, { L"Gamma", 0x0393 }, { L"Iacute", 0x00CD }, { L"Icirc", 0x00CE }, { L"Igrave", 0x00CC }, { L"Iota", 0x0399 }, { L"Iuml", 0x00CF }, { L"Kappa", 0x039A }, { L"Lambda", 0x039B }, { L"Mu", 0x039C }, { L"Ntilde", 0x00D1 }, { L"Nu", 0x039D }, { L"OElig", 0x0152 }, { L"Oacute", 0x00D3 }, { L"Ocirc", 0x00D4 }, { L"Ograve", 0x00D2 }, { L"Omega", 0x03A9 }, { L"Omicron", 0x039F }, { L"Oslash", 0x00D8 }, { L"Otilde", 0x00D5 }, { L"Ouml", 0x00D6 }, { L"Phi", 0x03A6 }, { L"Pi", 0x03A0 }, { L"Prime", 0x2033 }, { L"Psi", 0x03A8 }, { L"Rho", 0x03A1 }, { L"Scaron", 0x0160 }, { L"Sigma", 0x03A3 }, { L"THORN", 0x00DE }, { L"Tau", 0x03A4 }, { L"Theta", 0x0398 }, { L"Uacute", 0x00DA }, { L"Ucirc", 0x00DB }, { L"Ugrave", 0x00D9 }, { L"Upsilon", 0x03A5 }, { L"Uuml", 0x00DC }, { L"Xi", 0x039E }, { L"Yacute", 0x00DD }, { L"Yuml", 0x0178 }, { L"Zeta", 0x0396 }, { L"acirc", 0x00E2 }, { L"acute", 0x00B4 }, { L"aelig", 0x00E6 }, { L"agrave", 0x00E0 }, { L"alefsym", 0x2135 }, { L"alpha", 0x03B1 }, { L"amp", 0x0026 }, { L"and", 0x2227 }, { L"ang", 0x2220 }, { L"apos", 0x0027 }, { L"aring", 0x00E5 }, { L"asymp", 0x2248 }, { L"atilde", 0x00E3 }, { L"auml", 0x00E4 }, { L"bdquo", 0x201E }, { L"beta", 0x03B2 }, { L"brvbar", 0x00A6 }, { L"bull", 0x2022 }, { L"cap", 0x2229 }, { L"ccedil", 0x00E7 }, { L"cedil", 0x00B8 }, { L"cent", 0x00A2 }, { L"chi", 0x03C7 }, { L"circ", 0x02C6 }, { L"clubs", 0x2663 }, { L"cong", 0x2245 }, { L"copy", 0x00A9 }, { L"crarr", 0x21B5 }, { L"cup", 0x222A }, { L"curren", 0x00A4 }, { L"dArr", 0x21D3 }, { L"dagger", 0x2020 }, { L"darr", 0x2193 }, { L"deg", 0x00B0 }, { L"delta", 0x03B4 }, { L"diams", 0x2666 }, { L"divide", 0x00F7 }, { L"eacute", 0x00E9 }, { L"ecirc", 0x00EA }, { L"egrave", 0x00E8 }, { L"empty", 0x2205 }, { L"emsp", 0x2003 }, { L"ensp", 0x2002 }, { L"epsilon", 0x03B5 }, { L"equiv", 0x2261 }, { L"eta", 0x03B7 }, { L"eth", 0x00F0 }, { L"euml", 0x00EB }, { L"euro", 0x20AC }, { L"exist", 0x2203 }, { L"fnof", 0x0192 }, { L"forall", 0x2200 }, { L"frac12", 0x00BD }, { L"frac14", 0x00BC }, { L"frac34", 0x00BE }, { L"frasl", 0x2044 }, { L"gamma", 0x03B3 }, { L"ge", 0x2265 }, { L"gt", 0x003E }, { L"hArr", 0x21D4 }, { L"harr", 0x2194 }, { L"hearts", 0x2665 }, { L"hellip", 0x2026 }, { L"iacute", 0x00ED }, { L"icirc", 0x00EE }, { L"iexcl", 0x00A1 }, { L"igrave", 0x00EC }, { L"image", 0x2111 }, { L"infin", 0x221E }, { L"int", 0x222B }, { L"iota", 0x03B9 }, { L"iquest", 0x00BF }, { L"isin", 0x2208 }, { L"iuml", 0x00EF }, { L"kappa", 0x03BA }, { L"lArr", 0x21D0 }, { L"lambda", 0x03BB }, { L"lang", 0x2329 }, { L"laquo", 0x00AB }, { L"larr", 0x2190 }, { L"lceil", 0x2308 }, { L"ldquo", 0x201C }, { L"le", 0x2264 }, { L"lfloor", 0x230A }, { L"lowast", 0x2217 }, { L"loz", 0x25CA }, { L"lrm", 0x200E }, { L"lsaquo", 0x2039 }, { L"lsquo", 0x2018 }, { L"lt", 0x003C }, { L"macr", 0x00AF }, { L"mdash", 0x2014 }, { L"micro", 0x00B5 }, { L"middot", 0x00B7 }, { L"minus", 0x2212 }, { L"mu", 0x03BC }, { L"nabla", 0x2207 }, { L"nbsp", 0x00A0 }, { L"ndash", 0x2013 }, { L"ne", 0x2260 }, { L"ni", 0x220B }, { L"not", 0x00AC }, { L"notin", 0x2209 }, { L"nsub", 0x2284 }, { L"ntilde", 0x00F1 }, { L"nu", 0x03BD }, { L"oacute", 0x00F3 }, { L"ocirc", 0x00F4 }, { L"oelig", 0x0153 }, { L"ograve", 0x00F2 }, { L"oline", 0x203E }, { L"omega", 0x03C9 }, { L"omicron", 0x03BF }, { L"oplus", 0x2295 }, { L"or", 0x2228 }, { L"ordf", 0x00AA }, { L"ordm", 0x00BA }, { L"oslash", 0x00F8 }, { L"otilde", 0x00F5 }, { L"otimes", 0x2297 }, { L"ouml", 0x00F6 }, { L"para", 0x00B6 }, { L"part", 0x2202 }, { L"permil", 0x2030 }, { L"perp", 0x22A5 }, { L"phi", 0x03C6 }, { L"pi", 0x03C0 }, { L"piv", 0x03D6 }, { L"plusmn", 0x00B1 }, { L"pound", 0x00A3 }, { L"prime", 0x2032 }, { L"prod", 0x220F }, { L"prop", 0x221D }, { L"psi", 0x03C8 }, { L"quot", 0x0022 }, { L"rArr", 0x21D2 }, { L"radic", 0x221A }, { L"rang", 0x232A }, { L"raquo", 0x00BB }, { L"rarr", 0x2192 }, { L"rceil", 0x2309 }, { L"rdquo", 0x201D }, { L"real", 0x211C }, { L"reg", 0x00AE }, { L"rfloor", 0x230B }, { L"rho", 0x03C1 }, { L"rlm", 0x200F }, { L"rsaquo", 0x203A }, { L"rsquo", 0x2019 }, { L"sbquo", 0x201A }, { L"scaron", 0x0161 }, { L"sdot", 0x22C5 }, { L"sect", 0x00A7 }, { L"shy", 0x00AD }, { L"sigma", 0x03C3 }, { L"sigmaf", 0x03C2 }, { L"sim", 0x223C }, { L"spades", 0x2660 }, { L"sub", 0x2282 }, { L"sube", 0x2286 }, { L"sum", 0x2211 }, { L"sup", 0x2283 }, { L"sup1", 0x00B9 }, { L"sup2", 0x00B2 }, { L"sup3", 0x00B3 }, { L"supe", 0x2287 }, { L"szlig", 0x00DF }, { L"tau", 0x03C4 }, { L"there4", 0x2234 }, { L"theta", 0x03B8 }, { L"thetasym", 0x03D1 }, { L"thinsp", 0x2009 }, { L"thorn", 0x00FE }, { L"tilde", 0x02DC }, { L"times", 0x00D7 }, { L"trade", 0x2122 }, { L"uArr", 0x21D1 }, { L"uacute", 0x00FA }, { L"uarr", 0x2191 }, { L"ucirc", 0x00FB }, { L"ugrave", 0x00F9 }, { L"uml", 0x00A8 }, { L"upsih", 0x03D2 }, { L"upsilon", 0x03C5 }, { L"uuml", 0x00FC }, { L"weierp", 0x2118 }, { L"xi", 0x03BE }, { L"yacute", 0x00FD }, { L"yen", 0x00A5 }, { L"yuml", 0x00FF }, { L"zeta", 0x03B6 }, { L"zwj", 0x200D }, { L"zwnj", 0x200C } }; static const Ent rent[] = { { L"quot", 0x0022 }, { L"amp", 0x0026 }, { L"apos", 0x0027 }, { L"lt", 0x003C }, { L"gt", 0x003E } }; void printEntity(std::basic_ostream& os, const wchar_t* p) { os << Char('&'); while (*p) os << Char(*p++); os << Char(';'); } const Ent* findEntity(Char ch) { for (unsigned n = 0; n < sizeof(rent)/sizeof(Ent); ++n) if (rent[n].charValue == ch.value()) return &rent[n]; return 0; } } String EntityResolver::resolveEntity(const String& entity) const { if (!entity.empty() && entity[0] == L'#') { int code = 0; if (entity.size() > 2 && entity[1] == L'x') { // hex notation: ꯍ for (String::const_iterator it = entity.begin() + 2; it != entity.end(); ++it) { if (*it >= L'0' && *it <= L'9') code = code * 16 + (it->value() - L'0'); else if (*it >= L'A' && *it <= L'F') code = code * 16 + (it->value() - L'A' + 10); else if (*it >= L'a' && *it <= L'f') code = code * 16 + (it->value() - L'a' + 10); else throw std::runtime_error(std::string("invalid entity ") + entity.narrow()); } } else { // dec notation: ✏ for (String::const_iterator it = entity.begin() + 1; it != entity.end(); ++it) { if (*it >= L'0' && *it <= L'9') code = code * 10 + (it->value() - '0'); else throw std::runtime_error(std::string("invalid entity ") + entity.narrow()); } } return String( 1, Char(code) ); } unsigned u = 0; unsigned o = sizeof(ent)/sizeof(Ent) - 1; while (o - u > 1) { unsigned m = (o + u) / 2; int c = entity.compare(ent[m].entity); if (c == 0) return String(1, Char(ent[m].charValue)); else if (c < 0) o = m; else u = m; } if (entity.compare(ent[u].entity) == 0) return String(1, Char(ent[u].charValue)); if (entity.compare(ent[o].entity) == 0) return String(1, Char(ent[o].charValue)); EntityMap::const_iterator it = _entityMap.find(entity); if( it == _entityMap.end() ) { it = _entityMap.find(entity); if( it == _entityMap.end() ) throw std::runtime_error("invalid entity " + entity.narrow()); } return it->second; } String EntityResolver::getEntity(Char ch) const { const Ent* e = findEntity(ch); if (e) { String s; s += '&'; s += e->entity; s += ';'; return s; } if (ch.value() >= ' ' && ch.value() <= 0x7F) return String(1, ch); String s; s += '&'; s += '#'; s += convert(ch.value()); s += ';'; return s; } void EntityResolver::getEntity(std::basic_ostream& os, Char ch) const { const Ent* e = findEntity(ch); if (e) printEntity(os, e->entity); else if (ch.value() >= ' ' && ch.value() <= 0x7F) os << ch; else os << Char('&') << Char('#') << static_cast(ch.value()) << Char(';'); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/xmlreader.cpp0000664000175000017500000013602313644433072014253 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlreader.h" #include #include "cxxtools/xml/entityresolver.h" #include #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/xml/processinginstruction.h" #include "cxxtools/xml/comment.h" #include "cxxtools/xml/xmlerror.h" #include "cxxtools/textstream.h" #include "cxxtools/utf8codec.h" #include "cxxtools/log.h" #include #include #include #include log_define("cxxtools.xml.reader") namespace cxxtools { namespace xml { class XmlReaderImpl { XmlReaderImpl(const XmlReaderImpl&) { } XmlReaderImpl& operator=(const XmlReaderImpl&) { return *this; } struct State { virtual ~State() {} State* onChar(cxxtools::Char c, XmlReaderImpl& reader) { switch( c.value() ) { case '\n': case ' ': case '\t': case '\r': return this->onSpace(c, reader); case '<': return this->onOpenBracket(c, reader); case '>': return this->onCloseBracket(c, reader); case ':': return this->onColon(c, reader); case '/': return this->onSlash(c, reader); case '=': return this->onEqual(c, reader); case '"': case '\'': return this->onQuote(c, reader); case '!': return this->onExclam(c, reader); case '?': return this->onQuest(c, reader); default: return this->onAlpha(c, reader); } std::ostringstream msg; msg << "unexpected char '" << c.narrow() << '\''; syntaxError(msg.str().c_str(), reader.line()); return 0; } virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected space", reader.line() ); return this; } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected open bracket", reader.line()); return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected close bracket", reader.line()); return this; } virtual State* onColon(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected colon", reader.line()); return this; } virtual State* onSlash(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected slash", reader.line()); return this; } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected equal", reader.line()); return this; } virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected quote", reader.line()); return this; } virtual State* onExclam(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected exclamation mark", reader.line()); return this; } virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& reader) { syntaxError("unexpected questionmark", reader.line()); return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { std::ostringstream msg; msg << "unexpected alpha '" << c.narrow() << '\''; syntaxError(msg.str().c_str(), reader.line()); return this; } virtual State* onEof(XmlReaderImpl& reader) { syntaxError("unexpected end of file", reader.line()); return this; } static void syntaxError(const char* msg, unsigned line); }; struct OnCData : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { const String& content = reader._chars.content(); unsigned len = content.length(); if( len > 2 && content[len-2] == ']' && content[len-1] == ']') { reader._chars.content().resize(len-2); return AfterTag::instance(); } reader.appendContent(c); return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } static State* instance() { static OnCData _state; log_debug("OnCData"); return &_state; } }; struct BeforeCData : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { String& token = reader._token; token += c; if(token.length() < 7) return this; if(token == L"[CDATA[") { token.clear(); return OnCData::instance(); } syntaxError("CDATA expected", reader.line()); return this; } static State* instance() { static BeforeCData _state; log_debug("BeforeCData"); return &_state; } }; struct OnEntityReference : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == ';') { try { reader.resolveEntity(reader._token); } catch (const std::exception&) { throw XmlError("invalid entity " + reader._token.narrow(), reader.line()); } reader._chars.content() += reader._token; reader._token.clear(); return OnCharacters::instance(); } reader._token += c; return this; } static State* instance() { static OnEntityReference _state; log_debug("OnEntityReference"); return &_state; } }; struct OnAttributeEntityReference : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == ';') { reader.resolveEntity(reader._token); reader._attr.value() += reader._token; reader._token.clear(); return OnAttributeValue::instance(); } reader._token += c; return this; } static State* instance() { static OnAttributeEntityReference _state; log_debug("OnAttributeEntityReference"); return &_state; } }; struct OnCharacters : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnTag::instance(); } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '&') { reader._token.clear(); return OnEntityReference::instance(); } reader.appendContent(c); return this; } static State* instance() { static OnCharacters _state; log_debug("OnCharacters"); return &_state; } }; struct AfterEndElementName : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._endElem); reader._depth--; if(reader.depth() == 0) return OnEpilog::instance(); return AfterTag::instance(); } static State* instance() { static AfterEndElementName _state; log_debug("AfterEndElementName"); return &_state; } }; struct OnEndElementName : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return AfterEndElementName::instance(); } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { return onAlpha(c, reader); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._endElem.name() += c; return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._endElem); reader._depth--; if(reader.depth() == 0) return OnEpilog::instance(); return AfterTag::instance(); } static State* instance() { static OnEndElementName _state; log_debug("OnEndElementName"); return &_state; } }; struct OnEndElement : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._endElem.name() += c; return OnEndElementName::instance(); } static State* instance() { static OnEndElement _state; log_debug("OnEndElement"); return &_state; } }; struct OnEmptyElement : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._endElem.name() = reader._startElem.name(); reader._current = &(reader._endElem); reader._depth--; if(reader.depth() == 0) return OnEpilog::instance(); return AfterTag::instance(); } static State* instance() { static OnEmptyElement _state; log_debug("OnEmptyElement"); return &_state; } }; struct OnAttributeValue : public State { virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._startElem.addAttribute(reader._attr); return BeforeAttribute::instance(); } virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if (c == '&') { reader._token.clear(); return OnAttributeEntityReference::instance(); } reader._attr.value() += c; return this; } static State* instance() { static OnAttributeValue _state; log_debug("OnAttributeValue"); return &_state; } }; struct BeforeAttributeValue : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnAttributeValue::instance(); } static State* instance() { static BeforeAttributeValue _state; log_debug("BeforeAttributeValue"); return &_state; } }; struct AfterAttributeName : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return BeforeAttributeValue::instance(); } static State* instance() { static AfterAttributeName _state; log_debug("AfterAttributeName"); return &_state; } }; struct OnAttributeName : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return AfterAttributeName::instance(); } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return BeforeAttributeValue::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.name() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.name() += c; return this; } static State* instance() { static OnAttributeName _state; log_debug("OnAttributeName"); return &_state; } }; struct BeforeAttribute : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onSlash(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._current = &(reader._startElem); reader._depth++; return OnEmptyElement::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.clear(); reader._attr.name() += c; return OnAttributeName::instance(); } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._startElem); reader._depth++; return AfterTag::instance(); } static State* instance() { static BeforeAttribute _state; log_debug("BeforeAttribute"); return &_state; } }; struct OnStartElement : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return BeforeAttribute::instance(); } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { return onAlpha(c, reader); } virtual State* onSlash(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._startElem); reader._depth++; return OnEmptyElement::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._startElem.name() += c; return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._startElem); reader._depth++; return AfterTag::instance(); } static State* instance() { static OnStartElement _state; log_debug("OnStartElement"); return &_state; } }; struct OnCommentEnd : public State { virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { if(reader.depth() == 0) return OnProlog::instance(); return AfterTag::instance(); } static State* instance() { static OnCommentEnd _state; log_debug("OnCommentEnd"); return &_state; } }; struct AfterComment : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onColon(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onExclam(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onSlash(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnComment::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& /*reader*/) { if(c == '-') return OnCommentEnd::instance(); return OnComment::instance(); } static State* instance() { static AfterComment _state; log_debug("AfterComment"); return &_state; } }; struct OnComment : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onColon(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onExclam(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onSlash(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& /*reader*/) { if(c == '-') return AfterComment::instance(); return this; } static State* instance() { static OnComment _state; log_debug("OnComment"); return &_state; } }; struct BeforeComment: public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '-') return OnComment::instance(); State::onAlpha(c, reader); // throws syntax error // TODO DOCTYPE return this; } static State* instance() { static BeforeComment _state; log_debug("BeforeComment"); return &_state; } }; struct AfterTag : public OnCharacters { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { if(reader.depth() == 0) return OnProlog::instance(); reader.appendContent(c); return OnCharacters::instance(); } virtual State* onEof(XmlReaderImpl& reader) { if(reader.depth() > 0) return State::onEof(reader); // throws exception reader._current = &( reader._endDoc ); return this; } static State* instance() { static AfterTag _state; log_debug("AfterTag"); return &_state; } }; struct OnDocType : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._current = &(reader._docType); return OnProlog::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } static State* instance() { static OnDocType _state; log_debug("OnDocType"); return &_state; } }; struct BeforeDocType : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { String& token = reader._docType.content(); token += c; if(token.length() < 7) return this; if(token == L"DOCTYPE") { return OnDocType::instance(); } token.clear(); syntaxError("DOCTYPE expected", reader.line()); return this; } static State* instance() { static BeforeDocType _state; log_debug("BeforeDocType"); return &_state; } }; struct OnTagExclam : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '-') return BeforeComment::instance(); if(c == '[' && reader.depth() > 0) { reader._token.clear(); reader._token += c; return BeforeCData::instance(); } if(c == 'D' && reader.depth() == 0) { reader._docType.clear(); reader._docType.content() += c; return BeforeDocType::instance(); } return State::onAlpha(c, reader); // throws syntax error } static State* instance() { static OnTagExclam _state; log_debug("OnTagExclam"); return &_state; } }; struct OnTag : public State { virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._procInstr.clear(); return OnProcessingInstruction::instance(); } virtual State* onExclam(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnTagExclam::instance(); } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { return onAlpha(c, reader); } virtual State* onSlash(cxxtools::Char /*c*/, XmlReaderImpl& reader) { if( reader._chars.content().length() ) { reader._current = &(reader._chars); } reader._endElem.clear(); return OnEndElement::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if( reader._chars.content().length() ) { reader._current = &(reader._chars); } reader._startElem.clear(); reader._startElem.name() += c; return OnStartElement::instance(); } static State* instance() { static OnTag _state; log_debug("OnTag"); return &_state; } }; struct OnEpilog : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnTag::instance(); } virtual State* onEof(XmlReaderImpl& reader) { reader._current = &( reader._endDoc ); return this; } static State* instance() { static OnEpilog _state; log_debug("OnEpilog"); return &_state; } }; struct OnProlog : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnTag::instance(); } virtual State* onEof(XmlReaderImpl& reader) { reader._current = &( reader._endDoc ); return this; } static State* instance() { static OnProlog _state; log_debug("OnProlog"); return &_state; } }; struct OnProcessingInstructionEnd : public State { virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& reader) { reader._current = &(reader._procInstr); return AfterTag::instance(); } static State* instance() { static OnProcessingInstructionEnd _state; log_debug("OnProcessingInstructionEnd"); return &_state; } }; struct OnProcessingInstructionData : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnProcessingInstructionEnd::instance(); } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } static State* instance() { static OnProcessingInstructionData _state; log_debug("OnProcessingInstructionData"); return &_state; } }; struct OnProcessingInstruction : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnProcessingInstructionData::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.target() += c; return this; } static State* instance() { static OnProcessingInstruction _state; log_debug("OnProcessingInstruction"); return &_state; } }; struct OnXmlDeclValue : public State { virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& reader) { if(reader._attr.name() == L"version") { reader._version = reader._attr.value(); } else if(reader._attr.name() == L"encoding") { reader._encoding = reader._attr.value(); } else if(reader._attr.name() == L"standalone") { if(reader._attr.value() == L"true") reader._standalone = true; } return OnXmlDeclBeforeAttr::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } static State* instance() { static OnXmlDeclValue _state; log_debug("OnXmlDeclValue"); return &_state; } }; struct OnXmlDeclBeforeValue : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onQuote(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDeclValue::instance(); } static State* instance() { static OnXmlDeclBeforeValue _state; log_debug("OnXmlDeclBeforeValue"); return &_state; } }; struct OnXmlDeclAfterName : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDeclBeforeValue::instance(); } static State* instance() { static OnXmlDeclAfterName _state; log_debug("OnXmlDeclAfterName"); return &_state; } }; struct OnXmlDeclAttr : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDeclAfterName::instance(); } virtual State* onEqual(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDeclBeforeValue::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.name() += c; return this; } static State* instance() { static OnXmlDeclAttr _state; log_debug("OnXmlDeclAttr"); return &_state; } }; struct OnXmlDeclEnd : public State { virtual State* onCloseBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnProlog::instance(); } static State* instance() { static OnXmlDeclEnd _state; log_debug("OnXmlDeclEnd"); return &_state; } }; struct OnXmlDeclBeforeAttr : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.clear(); reader._attr.name() += c; return OnXmlDeclAttr::instance(); } virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDeclEnd::instance(); } static State* instance() { static OnXmlDeclBeforeAttr _state; log_debug("OnXmlDeclBeforeAttr"); return &_state; } }; struct OnXmlDeclName : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& reader) { if( reader._procInstr.target() == L"xml" ) return OnXmlDeclBeforeAttr::instance(); return OnProcessingInstructionData::instance(); } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.target() += c; return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.target() += c; return this; } static State* instance() { static OnXmlDeclName _state; log_debug("OnXmlDeclName"); return &_state; } }; struct OnXmlDeclQMark : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.clear(); reader._procInstr.target() += c; return OnXmlDeclName::instance(); } static State* instance() { static OnXmlDeclQMark _state; log_debug("OnXmlDeclQMark"); return &_state; } }; struct OnXmlDecl : public State { virtual State* onQuest(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDeclQMark::instance(); } virtual State* onExclam(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnTagExclam::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._startElem.clear(); reader._startElem.name() += c; return OnStartElement::instance(); } static State* instance() { static OnXmlDecl _state; log_debug("OnXmlDecl"); return &_state; } }; struct OnDocumentBegin : public State { virtual State* onSpace(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnProlog::instance(); } virtual State* onOpenBracket(cxxtools::Char /*c*/, XmlReaderImpl& /*reader*/) { return OnXmlDecl::instance(); } static State* instance() { static OnDocumentBegin _state; log_debug("OnDocumentBegin"); return &_state; } }; void readProlog() { while (_state != OnStartElement::instance() && _state != OnProlog::instance()) { std::basic_streambuf::int_type c = _textBuffer->sbumpc(); if (c == std::char_traits::eof()) { log_finer("eof"); _state = _state->onEof(*this); break; } Char ch = std::char_traits::to_char_type(c); log_finer("ch='" << ch << '\''); _state = _state->onChar(ch, *this); if (ch == L'\n') { ++_line; } } } public: XmlReaderImpl(std::basic_istream& is, int flags) : _textBuffer( is.rdbuf() ) , _buffer(0) , _flags(flags) , _standalone(true) , _depth(0) , _line(1) , _state(0) , _current(0) { _state = XmlReaderImpl::OnDocumentBegin::instance(); } XmlReaderImpl(std::istream& is, int flags) : _textBuffer(0) , _buffer(0) , _flags(flags) , _standalone(true) , _depth(0) , _line(1) , _state(0) , _current(0) { _state = XmlReaderImpl::OnDocumentBegin::instance(); _buffer = new TextBuffer( &is, new cxxtools::Utf8Codec() ); _textBuffer = _buffer; } ~XmlReaderImpl() { delete _buffer; } void reset(std::basic_istream& is, int flags) { delete _buffer; _buffer = 0; _textBuffer = is.rdbuf(); _state = XmlReaderImpl::OnDocumentBegin::instance(); _flags = flags; _version.clear(); _encoding.clear(); _standalone = true; _depth = 0; _line = 1; _current = 0; } void reset(std::istream& is, int flags) { delete _buffer; _buffer = new TextBuffer( &is, new cxxtools::Utf8Codec() ); _textBuffer = _buffer; _state = XmlReaderImpl::OnDocumentBegin::instance(); _flags = flags; _version.clear(); _encoding.clear(); _standalone = true; _depth = 0; _line = 1; _current = 0; } const cxxtools::String& version() const { if (_state == XmlReaderImpl::OnDocumentBegin::instance()) const_cast(this)->readProlog(); return _version; } const cxxtools::String& encoding() const { if (_state == XmlReaderImpl::OnDocumentBegin::instance()) const_cast(this)->readProlog(); return _encoding; } bool standalone() const { if (_state == XmlReaderImpl::OnDocumentBegin::instance()) const_cast(this)->readProlog(); return _standalone; } EntityResolver& entityResolver() { return _resolver; } const EntityResolver& entityResolver() const { return _resolver; } size_t depth() const { return _depth; } std::size_t line() const { return _line; } const Node& get() { if( ! _current ) { this->next(); } return *_current; } const Node& next() { _current = 0; do { std::basic_streambuf::int_type c = _textBuffer->sbumpc(); if (c == std::char_traits::eof()) { log_finer("eof"); _state = _state->onEof(*this); break; } Char ch = std::char_traits::to_char_type(c); log_finer("ch='" << ch << '\''); _state = _state->onChar(ch, *this); if (ch == L'\n') { ++_line; } } while (!_current); return *_current; } bool advance() { _current = 0; while( ! _current && _textBuffer->in_avail() > 0 ) { Char ch = std::char_traits::to_char_type(_textBuffer->sbumpc()); log_finer("ch='" << ch << '\''); _state = _state->onChar(ch, *this); if (ch == '\n') { ++_line; } } return _current != 0; } void resolveEntity(String& str) { str = entityResolver().resolveEntity( str ); } void appendContent(cxxtools::Char c) { String& content = _chars.content(); if (content.capacity() <= content.size() + 20) { if (content.capacity() < 16) content.reserve(16); else content.reserve(content.capacity() + content.capacity() / 2); } content += c; } private: std::basic_streambuf* _textBuffer; std::basic_streambuf* _buffer; int _flags; EntityResolver _resolver; cxxtools::String _version; cxxtools::String _encoding; bool _standalone; size_t _depth; std::size_t _line; State* _state; Node* _current; String _token; DocTypeDeclaration _docType; ProcessingInstruction _procInstr; StartElement _startElem; EndElement _endElem; Characters _chars; Attribute _attr; EndDocument _endDoc; }; void XmlReaderImpl::State::syntaxError(const char* msg, unsigned line) { std::ostringstream s; s << msg << " while parsing xml in line " << line; log_warn(s.str()); throw XmlError(s.str(), line); } XmlReader::XmlReader(std::istream& is, int flags) : _impl(0) { _impl = new XmlReaderImpl(is, flags); } XmlReader::XmlReader(std::basic_istream& is, int flags) : _impl(0) { _impl = new XmlReaderImpl(is, flags); } XmlReader::~XmlReader() { delete _impl; } void XmlReader::reset(std::basic_istream& is, int flags) { _impl->reset(is, flags); } void XmlReader::reset(std::istream& is, int flags) { _impl->reset(is, flags); } const cxxtools::String& XmlReader::documentVersion() const { return _impl->version(); } const cxxtools::String& XmlReader::documentEncoding() const { return _impl->encoding(); } bool XmlReader::standaloneDocument() const { return _impl->standalone(); } EntityResolver& XmlReader::entityResolver() { return _impl->entityResolver(); } const EntityResolver& XmlReader::entityResolver() const { return _impl->entityResolver(); } size_t XmlReader::depth() const { return _impl->depth(); } std::size_t XmlReader::line() const { return _impl->line(); } const Node& XmlReader::get() { return _impl->get(); } const Node& XmlReader::next() { return _impl->next(); } bool XmlReader::advance() { return _impl->advance(); } const StartElement& XmlReader::nextElement() { bool found = false; while( !found ) { const Node& node = this->next(); switch( node.type() ) { case Node::EndDocument: { throw XmlNoDocument(line()); } case Node::StartElement: found = true; break; default: break; } } return static_cast( this->get() ); } const Node& XmlReader::nextTag() { bool found = false; while( !found ) { const Node& node = this->next(); switch( node.type() ) { case Node::EndDocument: { throw XmlUnexpectedEndOfDocument(line()); } case Node::StartElement: case Node::EndElement: found = true; break; default: break; } } return this->get(); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/namespacecontext.cpp0000664000175000017500000000450713644433072015632 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/namespacecontext.h" #include "cxxtools/string.h" namespace cxxtools { namespace xml { namespace { static const String null; } const String& NamespaceContext::namespaceUri(const String& prefix) const { std::multimap::const_iterator it; for( it = _namespaceScopes.begin(); it != _namespaceScopes.end(); ++it) { if(it->second.prefix() == prefix) { return it->second.namespaceUri(); } } return null; } const String& NamespaceContext::prefix(const String& namespaceUri) const { std::multimap::const_iterator it; for( it = _namespaceScopes.begin(); it != _namespaceScopes.end(); ++it) { if(it->second.namespaceUri() == namespaceUri) { return it->second.prefix(); } } return null; } void NamespaceContext::addNamespace(const String& elementName, const Namespace& ns) { ScopeMap::value_type elem(elementName, ns); _namespaceScopes.insert(elem); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/characters.cpp0000664000175000017500000000311513644433072014402 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/characters.h" namespace cxxtools { namespace xml { bool Characters::operator==(const Node& node) const { const Characters* chars = dynamic_cast(&node); if (!chars) return false; return ( chars->content() == content() ); } } } cxxtools-3.0/src/xml/xmlerror.cpp0000664000175000017500000000300613644433072014134 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlerror.h" namespace cxxtools { namespace xml { XmlError::XmlError(const std::string& what, unsigned line) : std::runtime_error(what) , _line(line) { } } // namespace Xml } // namespace cxxtools cxxtools-3.0/src/xml/xmlserializer.cpp0000664000175000017500000000363213644433072015161 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlserializer.h" namespace cxxtools { namespace xml { XmlSerializer::XmlSerializer() { } XmlSerializer::XmlSerializer(std::ostream& os) : _formatter(os) { } XmlSerializer::XmlSerializer(XmlWriter* writer) : _formatter(writer) { } XmlSerializer::~XmlSerializer() { finish(); } void XmlSerializer::attach(std::ostream& os) { _formatter.attach(os); } void XmlSerializer::attach(XmlWriter& writer) { _formatter.attach(writer); } void XmlSerializer::detach() { _formatter.detach(); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/xmlwriter.cpp0000664000175000017500000001120213644433072014314 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlwriter.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/entityresolver.h" #include "cxxtools/utf8codec.h" #include #include namespace cxxtools { namespace xml { namespace { static const String xmlPrefix(L""); } XmlWriter::XmlWriter() : _tos(new Utf8Codec) , _flags(UseXmlDeclaration | UseIndent | UseEndl) { } XmlWriter::XmlWriter(std::ostream& os, int flags) : _tos(os, new Utf8Codec) , _flags(flags) { if (useXmlDeclaration()) { _tos << xmlPrefix; if (useEndl()) endl(); } } void XmlWriter::begin(std::ostream& os) { _tos.attach(os); if (useXmlDeclaration()) { _tos << xmlPrefix; if (useEndl()) endl(); } } void XmlWriter::writeStartElement(const String& localName) { writeStartElement(localName, 0, 0); } void XmlWriter::writeStartElement(const String& localName, const Attribute* attr, size_t attrCount) { if (localName.empty()) throw std::runtime_error("local name must not be empty in xml writer"); if (useIndent()) indent(); _tos << Char('<') << localName; for (size_t n = 0; n < attrCount; ++n) { if (useEndl()) endl(); if (useIndent()) indent(_elements.size() + 1); else _tos << Char(' '); _tos << attr[n].name() << Char('=') << Char('"'); writeCharacters(attr[n].value()); _tos << Char('"'); } _tos << Char('>'); if (useEndl()) endl(); _elements.push(localName); } void XmlWriter::writeEndElement() { if( _elements.empty() ) return; if (useIndent()) indent(_elements.size() - 1); _tos << Char(L'<') << Char(L'/') << _elements.top() << Char(L'>'); if (useEndl()) endl(); _elements.pop(); } void XmlWriter::writeElement(const String& localName, const String& content) { writeElement(localName, 0, 0, content); } void XmlWriter::writeElement(const String& localName, const Attribute* attr, size_t attrCount, const String& content) { if (useIndent()) indent(); _tos << Char(L'<') << localName; for (size_t n = 0; n < attrCount; ++n) { if (useEndl()) endl(); if (useIndent()) indent(_elements.size() + 1); else _tos << Char(' '); _tos << attr[n].name() << Char('=') << Char('"'); writeCharacters(attr[n].value()); _tos << Char('"'); } _tos << Char('>'); writeCharacters(content); _tos << Char('<') << Char('/') << localName << Char('>'); if (useEndl()) endl(); } void XmlWriter::writeCharacters(const String& text) { static EntityResolver resolver; String::const_iterator it; for (it = text.begin(); it != text.end(); ++it) resolver.getEntity(_tos, *it); } void XmlWriter::flush() { _tos.flush(); } void XmlWriter::endl() { _tos << Char('\n'); } void XmlWriter::indent(size_t size) { for (size_t n = 0; n < size; ++n) _tos << Char(' ') << Char(' '); } void XmlWriter::Element::writeContent(const String& text) { if (_writer.useIndent()) _writer.indent(); _writer.writeCharacters(text); if (_writer.useEndl()) _writer.endl(); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/endelement.cpp0000664000175000017500000000314013644433072014401 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/endelement.h" namespace cxxtools { namespace xml { bool EndElement::operator==(const Node& node) const { const EndElement* e = dynamic_cast(&node); if(!e) return false; return ( e->name() == this->name() ); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/xmlformatter.cpp0000664000175000017500000001042113644433072015005 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlformatter.h" #include "cxxtools/xml/startelement.h" #include namespace cxxtools { namespace xml { XmlFormatter::XmlFormatter() : _writer(0) , _useAttributes(true) { } XmlFormatter::XmlFormatter(std::ostream& os) : _writer( new XmlWriter(os) ) , _deleter( _writer ) , _useAttributes(true) { } XmlFormatter::XmlFormatter(XmlWriter* writer) : _writer(writer) { } XmlFormatter::~XmlFormatter() { this->detach(); } void XmlFormatter::attach(std::ostream& os) { if (_writer) throw std::logic_error("XmlSerizalizer is already open"); _deleter = _writer = new XmlWriter(os); } void XmlFormatter::attach(XmlWriter& writer) { if (_writer) throw std::logic_error("XmlSerizalizer is already open"); _deleter = 0; _writer = &writer; } void XmlFormatter::detach() { if (_writer) { this->flush(); _deleter = 0; _writer = 0; } } void XmlFormatter::flush() { if (_writer) _writer->flush(); } void XmlFormatter::addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) { cxxtools::String tag(name.empty() ? type : name); Attribute attrs[1]; size_t countAttrs = 0; if (_useAttributes) { if ( ! name.empty() && ! type.empty() ) { attrs[countAttrs].name() = L"type"; attrs[countAttrs].value() = type; ++countAttrs; } } _writer->writeElement( tag, attrs, countAttrs, value ); } void XmlFormatter::beginComplexElement(const std::string& name, const std::string& type, const String& category) { cxxtools::String tag(name.empty() ? type : name); if (tag.empty()) throw std::logic_error("type name or element name must be set in xml formatter"); Attribute attrs[2]; size_t countAttrs = 0; if (_useAttributes) { if ( ! name.empty() && ! type.empty() ) { attrs[countAttrs].name() = L"type"; attrs[countAttrs].value() = type; ++countAttrs; } if ( ! category.empty() ) { attrs[countAttrs].name().assign(L"category"); attrs[countAttrs].value().assign(category); ++countAttrs; } } _writer->writeStartElement( tag, attrs, countAttrs ); } void XmlFormatter::beginArray(const std::string& name, const std::string& type) { beginComplexElement(name, type, L"array"); } void XmlFormatter::finishArray() { _writer->writeEndElement(); } void XmlFormatter::beginObject(const std::string& name, const std::string& type) { beginComplexElement(name, type, L"struct"); } void XmlFormatter::beginMember(const std::string& /*name*/) { } void XmlFormatter::finishMember() { } void XmlFormatter::finishObject() { _writer->writeEndElement(); } void XmlFormatter::finish() { } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/xml/startelement.cpp0000664000175000017500000000427313644433072015000 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/startelement.h" namespace cxxtools { namespace xml { const String& StartElement::attribute(const String& attributeName) const { static const String null; for(Attributes::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it) { if(it->name() == attributeName) { return it->value(); } } return null; } bool StartElement::hasAttribute(const String& attributeName) const { for(Attributes::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it) { if(it->name() == attributeName) { return true; } } return false; } bool StartElement::operator==(const Node& node) const { const StartElement* se = dynamic_cast(&node); if(!se) return false; return ( se->name() == this->name() ); } } // namespace xml } // namespace cxxtools cxxtools-3.0/src/directoryimpl.h0000664000175000017500000000477013644433072014026 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { class DirectoryIteratorImpl { public: DirectoryIteratorImpl(); DirectoryIteratorImpl(const char* path, bool skipHidden); ~DirectoryIteratorImpl(); const std::string& name() const; const std::string& path() const; int ref(); int deref(); bool advance(); private: unsigned int _refs; mutable std::string _path; mutable std::string _name; DIR* _handle; ::dirent* _current; bool _dirty; bool _skipHidden; }; class DirectoryImpl { public: static void create(const std::string& path); static void remove(const std::string& path); static void move(const std::string& oldName, const std::string& newName); static bool exists(const std::string& path); static void chdir(const std::string& path); static std::string cwd(); static std::string curdir(); static std::string updir(); static std::string rootdir(); static std::string tmpdir(); static std::string sep(); }; } // namespace cxxtools cxxtools-3.0/src/net.cpp0000664000175000017500000000770013644433072012255 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "tcpsocketimpl.h" #include #include #include #include #include #include #include #include #include #include "config.h" log_define("cxxtools.net.net") namespace cxxtools { namespace net { //////////////////////////////////////////////////////////////////////// // implementation of Socket // Socket::Socket(int domain, int type, int protocol) : m_timeout(-1) { if ((m_sockFd = ::socket(domain, type, protocol)) < 0) throw SystemError("socket"); } Socket::~Socket() { if (m_sockFd >= 0) { if (::close(m_sockFd) < 0) fprintf(stderr, "error in close(%d)\n", (int)m_sockFd); } } void Socket::create(int domain, int type, int protocol) { close(); log_debug("create socket"); int fd = ::socket(domain, type, protocol); if (fd < 0) throw SystemError("socket"); setFd(fd); } void Socket::close() { if (m_sockFd >= 0) { log_debug("close socket"); ::close(m_sockFd); m_sockFd = -1; } } std::string Socket::getSockAddr() const { return net::getSockAddr(getFd()); } void Socket::setTimeout(int t) { if (m_timeout != t) { log_debug("set timeout " << t << ", fd=" << getFd() << ", previous=" << m_timeout); if (getFd() >= 0 && ((t >= 0 && m_timeout < 0) || (t < 0 && m_timeout >= 0))) { long a = t >= 0 ? O_NONBLOCK : 0; log_debug("fcntl(" << getFd() << ", F_SETFL, " << a << ')'); int ret = fcntl(getFd(), F_SETFL, a); if (ret < 0) throw SystemError("fcntl"); } m_timeout = t; } } void Socket::setFd(int sockFd) { close(); m_sockFd = sockFd; long a = m_timeout >= 0 ? O_NONBLOCK : 0; log_debug("fcntl(" << getFd() << ", F_SETFL, " << a << ')'); int ret = ::fcntl(getFd(), F_SETFL, a); if (ret < 0) throw SystemError("fcntl"); } short Socket::poll(short events) const { struct pollfd fds; fds.fd = getFd(); fds.events = events; log_debug("poll timeout " << getTimeout()); int p = ::poll(&fds, 1, getTimeout()); log_debug("poll returns " << p << " revents " << fds.revents); if (p < 0) { log_error("error in poll; errno=" << errno); throw SystemError("poll"); } else if (p == 0) { log_debug("poll timeout (" << getTimeout() << ')'); throw IOTimeout(); } return fds.revents; } } // namespace net } // namespace cxxtools cxxtools-3.0/src/filedeviceimpl.cpp0000664000175000017500000000625213644433072014451 00000000000000/* * Copyright (C) 2005 by Marc Boris Drner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "filedeviceimpl.h" #include "cxxtools/iodevice.h" #include "error.h" #include #include #include #include #include #include namespace cxxtools { FileDeviceImpl::FileDeviceImpl(FileDevice& device) : IODeviceImpl(device) { } FileDeviceImpl::~FileDeviceImpl() { } bool FileDeviceImpl::seekable() const { struct stat s; int ret = fstat(_fd, &s); if(ret == 0) { if(S_ISREG(s.st_mode) || S_ISBLK(s.st_mode)) return true; } return false; } FileDeviceImpl::pos_type FileDeviceImpl::seek(off_type offset, std::ios::seekdir sd ) { int whence = std::ios::cur; switch(sd) { case std::ios::beg: whence = SEEK_SET; break; case std::ios::cur: whence = SEEK_CUR; break; case std::ios::end: whence = SEEK_END; break; default: break; } off_t ret = lseek(fd(), offset, whence); if( ret == (off_t)-1 ) throw IOError(getErrnoString("lseek")); return ret; } void FileDeviceImpl::resize(off_type size) { int ret = ::ftruncate(fd(), size); if(ret != 0) throw IOError(getErrnoString("ftruncate")); } size_t FileDeviceImpl::size() const { struct stat buff; int ret = fstat(fd(), &buff); if(ret != 0) throw IOError(getErrnoString("fstat")); return buff.st_size; } size_t FileDeviceImpl::peek(char* buffer, size_t count) { bool eof; size_t ret = this->read(buffer, count, eof); // if we could read data seek back if(ret > 0) this->seek(-((off_type)ret), std::ios::cur); return ret; } void FileDeviceImpl::sync() const { int ret = fsync(_fd); if(ret != 0) throw IOError(getErrnoString("fsync")); } } //namespace cxxtools cxxtools-3.0/src/threadpoolimpl.h0000664000175000017500000000715413644433072014162 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_THREADPOOLIMPL_H #define CXXTOOLS_THREADPOOLIMPL_H #include #include #include #include namespace cxxtools { class ThreadPool::Future::FutureImpl : public AtomicRefCounted { friend class ThreadPoolImpl; public: enum State { Waiting, Running, Finished, Canceled, Failed }; private: Callable* _callable; State _state; mutable Condition _stateChanged; mutable Mutex _mutex; FutureImpl(FutureImpl&); FutureImpl& operator=(FutureImpl&); public: explicit FutureImpl(const Callable& callable) : _callable(callable.clone()), _state(Waiting) { } ~FutureImpl() { delete _callable; } State state() const { MutexLock lock(_mutex); return _state; } bool wait(Timespan timeout) const; void setState(State state); void setFinished() { setState(Finished); } void setCanceled() { setState(Canceled); } void setFailed() { setState(Failed); } }; class ThreadPoolImpl { public: explicit ThreadPoolImpl(unsigned size) : _state(Stopped), _size(size) { } ~ThreadPoolImpl(); void start(); void stop(bool cancel); ThreadPool::Future schedule(const Callable& cb); bool running() const { return _state == Running; } bool stopped() const { return _state == Stopped; } private: void threadFunc(); enum { Stopped, Starting, Running, Stopping } _state; Queue _queue; typedef std::vector ThreadsType; ThreadsType _threads; unsigned _size; }; } #endif // CXXTOOLS_THREADPOOLIMPL_H cxxtools-3.0/src/threadpool.cpp0000664000175000017500000000734313644433072013633 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "threadpoolimpl.h" namespace cxxtools { ThreadPool::ThreadPool(unsigned size, bool doStart) : _impl(new ThreadPoolImpl(size)) { if (doStart) start(); } ThreadPool::~ThreadPool() { if (running()) stop(); delete _impl; } void ThreadPool::start() { _impl->start(); } void ThreadPool::stop(bool cancel) { _impl->stop(cancel); } ThreadPool::Future ThreadPool::schedule(const Callable& cb) { return _impl->schedule(cb); } bool ThreadPool::running() const { return _impl->running(); } bool ThreadPool::stopped() const { return _impl->stopped(); } ThreadPool::Future::Future(FutureImpl* impl) : _impl(impl) { if (impl) _impl->addRef(); } ThreadPool::Future::Future(const Future& f) : _impl(f._impl) { if (_impl) _impl->addRef(); } ThreadPool::Future& ThreadPool::Future::operator=(const Future& f) { if (_impl != f._impl) { if (_impl && _impl->release() == 0) delete _impl; _impl = f._impl; if (_impl) _impl->addRef(); } return *this; } ThreadPool::Future::~Future() { if (_impl && _impl->release() == 0) delete _impl; } bool ThreadPool::Future::wait(Seconds timeout) const { return _impl->wait(timeout); } bool ThreadPool::Future::isWaiting() const { return _impl->state() == ThreadPool::Future::FutureImpl::Waiting; } bool ThreadPool::Future::isRunning() const { return _impl->state() == ThreadPool::Future::FutureImpl::Running; } bool ThreadPool::Future::isFinished() const { ThreadPool::Future::FutureImpl::State state = _impl->state(); return state == ThreadPool::Future::FutureImpl::Finished || state == ThreadPool::Future::FutureImpl::Failed || state == ThreadPool::Future::FutureImpl::Canceled; } bool ThreadPool::Future::isCanceled() const { return _impl->state() == ThreadPool::Future::FutureImpl::Canceled; } bool ThreadPool::Future::isFailed() const { return _impl->state() == ThreadPool::Future::FutureImpl::Failed; } } cxxtools-3.0/src/regex.cpp0000664000175000017500000001437413644433072012606 00000000000000/* * Copyright (C) 2005-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/regex.h" #include "cxxtools/log.h" #include #include #include log_define("cxxtools.regex") namespace cxxtools { unsigned RegexSMatch::size() const { unsigned n; for (n = 0; n < 10 && matchbuf[n].rm_so >= 0; ++n) ; return n; } std::string RegexSMatch::get(unsigned n) const { return has(n) ? str.substr(matchbuf[n].rm_so, matchbuf[n].rm_eo - matchbuf[n].rm_so) : std::string(); } std::string RegexSMatch::format(const std::string& s) const { enum state_type { state_0, state_esc, state_var0, state_var1, state_brace, state_brace_end, state_1 } state; state = state_0; std::string ret; for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) { char ch = *it; switch (state) { case state_0: if (ch == '$') state = state_var0; else if (ch == '\\') state = state_esc; break; case state_esc: ret += ch; state = state_1; break; case state_var0: if (std::isdigit(ch)) { ret = std::string(s.begin(), it - 1); regoff_t b = matchbuf[ch - '0'].rm_so; regoff_t e = matchbuf[ch - '0'].rm_eo; if (b >= 0 && e >= 0) ret.append(str, b, e-b); state = state_1; } else if (ch == '{') state = state_brace; else state = state_0; break; case state_brace: if (std::isdigit(ch)) { ret = std::string(s.begin(), it - 2); regoff_t b = matchbuf[ch - '0'].rm_so; regoff_t e = matchbuf[ch - '0'].rm_eo; if (b >= 0 && e >= 0) ret.append(str, b, e-b); state = state_brace_end; } else throw std::runtime_error("invalid replace string <" + s + '>'); break; case state_brace_end: if (ch == '}') state = state_1; else throw std::runtime_error("invalid replace string <" + s + '>'); break; case state_1: if (ch == '$') state = state_var1; else if (ch == '\\') state = state_esc; else ret += ch; break; case state_var1: if (std::isdigit(ch)) { regoff_t b = matchbuf[ch - '0'].rm_so; regoff_t e = matchbuf[ch - '0'].rm_eo; if (b >= 0 && e >= 0) ret.append(str, b, e-b); state = state_1; } else if (ch == '$') ret += '$'; else { ret += '$'; ret += ch; } break; } } switch (state) { case state_0: case state_var0: return s; case state_esc: return ret + '\\'; case state_var1: return ret + '$'; case state_1: return ret; } return ret; } void Regex::checkerr(int ret) const { if (ret != 0) { char errbuf[256]; regerror(ret, expr.getPointer(), errbuf, sizeof(errbuf)); throw std::runtime_error(errbuf); } } bool Regex::matchp(const std::string& str_, std::string::size_type p, int eflags) const { RegexSMatch smatch; return matchp(str_, p, smatch, eflags); } bool Regex::matchp(const std::string& str_, std::string::size_type p, RegexSMatch& smatch, int eflags) const { if (expr.getPointer() == 0) { smatch.matchbuf[0].rm_so = 0; return true; } smatch.str = str_; int ret = regexec(expr.getPointer(), str_.c_str() + p, sizeof(smatch.matchbuf) / sizeof(regmatch_t), smatch.matchbuf, eflags); if (ret == REG_NOMATCH) return false; checkerr(ret); if (p > 0) { for (unsigned n = 0; n < 10; ++n) { if (smatch.matchbuf[n].rm_so >= 0) { smatch.matchbuf[n].rm_so += p; smatch.matchbuf[n].rm_eo += p; } } } return true; } std::string Regex::subst(const std::string& str, const std::string& expr, bool all) { RegexSMatch m; std::string ret = str; std::string::size_type p = 0; log_debug("str=" << str); while (matchp(ret, p, m)) { // match at m.matchbuf[0] log_debug("matched: <" << ret.substr(m.offsetBegin(0), m.size(0)) << '>'); std::string r = m.format(expr); log_debug("replace <" << r << '>'); ret.erase(m.offsetBegin(0), m.size(0)); log_debug("removed <" << ret << '>'); ret.insert(m.offsetBegin(0), r); log_debug("inserted <" << ret << '>'); if (!all) break; p = m.offsetBegin(0) + r.size(); log_debug("pos=" << p); } log_debug("ret=<" << ret << '>'); return ret; } } cxxtools-3.0/src/hdstream.cpp0000664000175000017500000000470513644433072013300 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/hdstream.h" #include #include #include namespace cxxtools { const unsigned Hdstreambuf::BUFFERSIZE; std::streambuf::int_type Hdstreambuf::overflow(std::streambuf::int_type ch) { static const char hexdigit[] = "0123456789abcdef"; std::ostream out(Dest); size_t count = pptr() - pbase(); if(count > 0) { out << std::setw(7) << std::setfill('0') << std::hex << offset << '|'; offset += count; size_t i; for(i = 0; i < count; ++i) { unsigned char ch = static_cast(pbase()[i]); out << hexdigit[ch >> 4] << hexdigit[ch & 0xf] << (i == 7 ? ':' : ' '); } for( ; i < BUFFERSIZE; ++i) out << " "; out << '|'; for(i = 0; i < count; ++i) out << (char)(std::isprint(pbase()[i]) ? pbase()[i] : '.'); for( ; i < BUFFERSIZE; ++i) out << ' '; out << std::endl; } setp(pbase(), epptr()); if (ch != -1) return sputc(ch); return 0; } std::streambuf::int_type Hdstreambuf::underflow() { return traits_type::eof(); } int Hdstreambuf::sync() { return overflow(traits_type::eof()); } } cxxtools-3.0/src/textbuffer.cpp0000664000175000017500000000302113644433072013635 00000000000000/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/textbuffer.h" namespace cxxtools { TextBuffer::TextBuffer(std::ios* s, Codec* codec) : BasicTextBuffer(s, codec) { } } // namespace cxxtools cxxtools-3.0/src/libraryimpl.cpp0000664000175000017500000000415513644433072014016 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libraryimpl.h" namespace cxxtools { void LibraryImpl::open(const std::string& path) { if(_handle) return; /* RTLD_NOW: since lazy loading is not supported by every target platform RTLD_GLOBAL: make the external symbols in the loaded library available for subsequent libraries. see also http://gcc.gnu.org/faq.html#dso */ int flags = RTLD_NOW | RTLD_GLOBAL; _handle = ::dlopen(path.c_str(), flags); if( !_handle ) { throw OpenLibraryFailed(dlerror()); } } void LibraryImpl::close() { if(_handle) ::dlclose(_handle); } void* LibraryImpl::resolve(const char* symbol) const { if(_handle) { return ::dlsym(_handle, symbol); } return 0; } } // namespace cxxtools cxxtools-3.0/src/tcpserverimpl.cpp0000664000175000017500000003253413644433072014371 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "tcpserverimpl.h" #include "tcpsocketimpl.h" #include "addrinfoimpl.h" #include "error.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "error.h" #ifdef HAVE_TCP_DEFER_ACCEPT # include # include # include #endif #ifdef HAVE_SO_NOSIGPIPE # include # include #endif log_define("cxxtools.net.tcpserver.impl") namespace cxxtools { namespace net { static const int noPendingAccept = -1; TcpServerImpl::TcpServerImpl(TcpServer& server) : _server(server), _pendingAccept(noPendingAccept), _pfd(0) #ifdef HAVE_TCP_DEFER_ACCEPT , _deferAccept(false) #endif { int ret = ::pipe(_wakePipe); if (ret == 1) throwSystemError("pipe"); log_debug("wake pipe read fd=" << _wakePipe[0] << " write fd=" << _wakePipe[1]); } TcpServerImpl::~TcpServerImpl() { ::close(_wakePipe[0]); ::close(_wakePipe[1]); } int TcpServerImpl::create(int domain, int type, int protocol) { log_debug("create socket"); int fd = ::socket(domain, type, protocol); if (fd < 0) throwSystemError("socket"); return fd; } void TcpServerImpl::close() { for (Listeners::const_iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if (it->_fd >= 0) { log_debug("close socket " << it->_fd); ::close(it->_fd); } } _listeners.clear(); _pfd = 0; #ifdef HAVE_TCP_DEFER_ACCEPT _deferAccept = false; #endif } void TcpServerImpl::listen(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags) { log_debug("listen on " << ipaddr << " port " << port << " backlog " << backlog << " flags " << flags); bool inherit = (flags & TcpServer::INHERIT) != 0; AddrInfo ai(ipaddr, port, true); static const int on = 1; const char* fn = ""; // getaddrinfo() may return more than one addrinfo structure, so work // them all out try { for (AddrInfoImpl::const_iterator it = ai.impl()->begin(); it != ai.impl()->end(); ++it) { int fd; try { fd = create(it->ai_family, SOCK_STREAM, 0); } catch (const SystemError& e) { // if we have at least one listener created succesfully then we // can ignore that entry if (_listeners.size() > 0) { log_debug("failed to create socket for ip <" << formatIp(*reinterpret_cast(it->ai_addr)) << ">; have already " << _listeners.size() << " listeners"); continue; } // check if there are more entries to listen on AddrInfoImpl::const_iterator itNext = it; ++itNext; if (itNext == ai.impl()->end()) { // Since this was the last entry and we have no listeners, we // propagate that error. throw; } // We have no listeners yet but the next entry might be successful // so we just skip that entry. log_debug("failed to create socket for ip <" << formatIp(*reinterpret_cast(it->ai_addr)) << '>'); continue; } _listeners.push_back(Listener()); _listeners.back()._fd = fd; if (flags & TcpServer::REUSEADDR) { log_debug("setsockopt SO_REUSEADDR"); if (::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { log_debug("could not set socket option SO_REUSEADDR " << fd << ": " << getErrnoString()); throwSystemError("setsockopt"); } } #ifdef HAVE_IPV6 if (it->ai_family == AF_INET6) { if (::setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { log_debug("could not set socket option IPV6_V6ONLY " << fd << ": " << getErrnoString()); throwSystemError("setsockopt"); } } #endif log_debug("bind " << formatIp(*reinterpret_cast(it->ai_addr))); if (::bind(fd, it->ai_addr, it->ai_addrlen) != 0) { log_debug("could not bind " << fd << ": " << getErrnoString()); if (errno == EADDRINUSE) throw AddressInUse(ipaddr, port); else throwSystemError("bind"); } log_debug("listen"); if ( ::listen(fd, backlog) < 0 ) throwSystemError("listen"); // save our information std::memmove(&_listeners.back()._servaddr, it->ai_addr, it->ai_addrlen); if (!inherit) { int flags = ::fcntl(fd, F_GETFD); flags |= FD_CLOEXEC ; fn = "fcntl"; int ret = ::fcntl(fd, F_SETFD, flags); if (ret == -1) throwSystemError("fcntl(FD_CLOEXEC)"); } } #ifdef HAVE_TCP_DEFER_ACCEPT deferAccept(flags & TcpServer::DEFER_ACCEPT); #endif } catch (const std::exception& e) { close(); throw; } if (_listeners.empty()) { if (errno == EADDRINUSE) throw AddressInUse(ipaddr, port); else throwSystemError(fn); } } void TcpServerImpl::terminateAccept() { char ch = 'A'; int ret = ::write(_wakePipe[1], &ch, 1); if (ret == -1) throwSystemError("write(wake pipe)"); } #ifdef HAVE_TCP_DEFER_ACCEPT void TcpServerImpl::deferAccept(bool sw) { if (sw == _deferAccept) return; int deferSecs = sw ? 30 : 0; log_debug("set TCP_DEFER_ACCEPT to " << deferSecs); for (Listeners::const_iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if (::setsockopt(it->_fd, SOL_TCP, TCP_DEFER_ACCEPT, &deferSecs, sizeof(deferSecs)) < 0) { throwSystemError("setsockopt(TCP_DEFER_ACCEPT)"); } } } #endif bool TcpServerImpl::wait(Timespan timeout) { int msecs = timeout < Timespan(0) ? -1 : timeout.totalMSecs() > std::numeric_limits::max() ? std::numeric_limits::max() : int(Milliseconds(timeout).ceil()); log_debug("wait " << msecs); Resetter resetter(_pfd); std::vector fds(_listeners.size()); initializePoll(&fds[0], fds.size()); log_debug("poll timeout " << msecs); while (true) { int p = ::poll(&fds[0], fds.size(), msecs); if (p > 0) { break; } else if (p < 0) { if (errno == EINTR) continue; log_error("error in poll; errno=" << errno); throwSystemError("poll"); } else if (p == 0) { log_debug("poll timeout (" << msecs << ')'); throw IOTimeout(); } } return checkPollEvent(); } void TcpServerImpl::attach(SelectorBase& /*s*/) { log_debug("attach to selector"); } void TcpServerImpl::detach(SelectorBase& /*s*/) { log_debug("detach from selector"); _pfd = 0; } std::size_t TcpServerImpl::pollSize() const { return _listeners.size(); } std::size_t TcpServerImpl::initializePoll(pollfd* pfd, std::size_t pollSize) { assert(pfd != 0); assert(pollSize == _listeners.size()); log_debug("initializePoll " << pollSize); for (std::size_t n = 0; n < pollSize; ++n) { pfd[n].fd = _listeners[n]._fd; pfd[n].revents = 0; pfd[n].events = POLLIN; } _pfd = pfd; return pollSize; } bool TcpServerImpl::checkPollEvent() { assert(_pfd != 0); bool ret = false; Resetter resetter(_pendingAccept, noPendingAccept); for (Listeners::size_type n = 0; n < _listeners.size(); ++n) { if (_pfd[n].revents & POLLIN) { _pendingAccept = n; _server.connectionPending.send(_server); ret = true; } } return ret; } int TcpServerImpl::accept(int flags, struct sockaddr* sa, socklen_t& sa_len) { Resetter resetter(_pendingAccept); if (_pendingAccept == noPendingAccept) { Resetter resetter(_pfd); std::vector fds(_listeners.size() + 1); fds[0].fd = _wakePipe[0]; fds[0].revents = 0; fds[0].events = POLLIN; initializePoll(&fds[1], _listeners.size()); while (true) { log_debug("poll"); int p = ::poll(&fds[0], fds.size(), -1); if (p > 0) { break; } else if (p < 0) { if (errno == EINTR) continue; log_error("error in poll; errno=" << errno); throwSystemError("poll"); } } if (fds[0].revents & POLLIN) { char buffer; log_debug("wake accept event detected"); int ret = ::read(_wakePipe[0], &buffer, 1); if (ret == -1) throwSystemError("read(wake pipe)"); log_debug("accept terminated"); throw AcceptTerminated(); } for (std::vector::size_type n = 0; n < _listeners.size(); ++n) { if (fds[n + 1].revents & POLLIN) { log_debug("detected accept on fd " << fds[n + 1].fd); _pendingAccept = n; break; } } if (_pendingAccept == noPendingAccept) { // TODO ??? // poll reported activity but there is no POLLIN set??? return -1; } } else if (_pfd != 0) // should be always true here { _pfd[_pendingAccept].revents = 0; } int listenerFd = _listeners[_pendingAccept]._fd; log_debug( "accept fd=" << listenerFd << ", flags=" << flags ); bool inherit = (flags & TcpSocket::INHERIT) != 0; #ifdef HAVE_ACCEPT4 int clientFd; static bool useAccept4 = true; if (useAccept4) { int f = SOCK_NONBLOCK; if (!inherit) f |= SOCK_CLOEXEC; do { clientFd = ::accept4(listenerFd, sa, &sa_len, f); } while (clientFd < 0 && errno == EINTR); if( clientFd < 0 ) { if (errno == ENOSYS) { log_info("accept4 system call not available - fallback to accept"); useAccept4 = false; } else throwSystemError("accept4"); } } if (!useAccept4) { do { clientFd = ::accept(listenerFd, sa, &sa_len); } while (clientFd < 0 && errno == EINTR); if( clientFd < 0 ) throwSystemError("accept"); } #else int clientFd; do { clientFd = ::accept(listenerFd, sa, &sa_len); } while (clientFd < 0 && errno == EINTR); if( clientFd < 0 ) throwSystemError("accept"); if (!inherit) { int flags = ::fcntl(clientFd, F_GETFD); flags |= FD_CLOEXEC ; int ret = ::fcntl(clientFd, F_SETFD, flags); if (ret == -1) throw IOError(getErrnoString("fcntl(FD_CLOEXEC)")); } #endif #ifdef HAVE_SO_NOSIGPIPE static const int on = 1; if (::setsockopt(clientFd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)) < 0) throw cxxtools::SystemError("setsockopt(SO_NOSIGPIPE)"); #endif log_debug( "accepted on " << listenerFd << " => " << clientFd); return clientFd; } } // namespace net } // namespace cxxtools cxxtools-3.0/src/selector.cpp0000664000175000017500000001357513644433072013316 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "selectorimpl.h" #include "cxxtools/selector.h" #include "cxxtools/timer.h" #include "cxxtools/timespan.h" #include "cxxtools/log.h" log_define("cxxtools.selector") namespace cxxtools { const int SelectorBase::WaitInfinite; SelectorBase::~SelectorBase() { while( _timers.size() ) { Timer* timer = _timers.begin()->second; timer->setSelector(0); } } void SelectorBase::add(Selectable& s) { s.setSelector(this); } void SelectorBase::remove(Selectable& s) { if(s.selector() == this) s.setSelector(0); } void SelectorBase::add(Timer& timer) { timer.setSelector(this); } void SelectorBase::remove( Timer& timer ) { if(timer.selector() == this) timer.setSelector(0); } void SelectorBase::onAddTimer(Timer& timer) { if( timer.active() ) { TimerMap::value_type elem(timer.finished(), &timer); _timers.insert(elem); //_timers.insert( std::make_pair(timer.finished(), &timer) ); } } void SelectorBase::onRemoveTimer( Timer& timer ) { std::multimap::iterator it; for(it = _timers.begin(); it != _timers.end(); ++it) { if(it->second == &timer) { _timers.erase(it); return; } } } void SelectorBase::onTimerChanged(Timer& timer) { if( timer.active() ) { TimerMap::value_type elem(timer.finished(), &timer); _timers.insert(elem); //_timers.insert( std::make_pair(timer.finished(), &timer) ); } else { SelectorBase::onRemoveTimer(timer); } } bool SelectorBase::updateTimer(Timespan& lowestTimeout) { if( _timers.empty() ) return false; Timespan now = Timespan::gettimeofday(); Timer* timer = _timers.begin()->second; bool timerActive = now >= timer->finished(); while( ! _timers.empty() ) { timer = _timers.begin()->second; if ( now < timer->finished() ) { lowestTimeout = timer->finished(); log_debug("lowestTimeout => " << lowestTimeout); break; } timer->update(now); if( ! _timers.empty() ) { timer = _timers.begin()->second; _timers.erase( _timers.begin() ); TimerMap::value_type elem(timer->finished(), timer); _timers.insert(elem); //_timers.insert( std::make_pair(timer->finished(), timer) ); } } return timerActive; } bool SelectorBase::wait(Milliseconds msecs) { if (msecs <= Timespan(0)) return waitUntil(msecs); else return waitUntil(Timespan::gettimeofday() + msecs); } bool SelectorBase::waitUntil(Timespan t) { log_debug("waitUntil(" << t << ')'); Timespan timerTimeout = Timespan(Selector::WaitInfinite); // If a timer is immediately ready, still check for an // active selectable to avoid timer preemption if ( updateTimer(timerTimeout) ) { onWaitUntil(Timespan(0)); return true; } // This handles the case when no timer will become // active in the given timeout. The result of the // wait call indicates activity if (timerTimeout < Timespan(0) || (t >= Timespan(0) && t < timerTimeout)) { return onWaitUntil(t); } // A timer will become active before the timeout expires while(true) { log_debug("wait(" << timerTimeout << ')'); if (onWaitUntil(timerTimeout)) return true; if (updateTimer(timerTimeout)) return true; } } Timespan SelectorBase::waitTimer() { log_debug("waitTimer()"); while (true) { Timespan timerTimeout = Timespan(Selector::WaitInfinite); updateTimer(timerTimeout); onWaitUntil(Timespan(0)); if (timerTimeout < Timespan(0)) return timerTimeout; Timespan now = Timespan::gettimeofday(); if (timerTimeout > now) return timerTimeout - now; } } void SelectorBase::wake() { onWake(); } SelectorBase::SelectorBase() {} Selector::Selector() : _impl( 0 ) { _impl = new SelectorImpl(); } Selector::~Selector() { delete _impl; } void Selector::onAdd( Selectable& selectable ) { _impl->add(selectable); } void Selector::onRemove( Selectable& selectable ) { _impl->remove(selectable); } void Selector::onChanged(Selectable& s) { _impl->changed(s); } void Selector::onReinit(Selectable& /*s*/) { } bool Selector::onWaitUntil(Timespan timeout) { return _impl->waitUntil(timeout); } void Selector::onWake() { _impl->wake(); } SelectorImpl& Selector::impl() { return *_impl; } }//namespace cxxtools cxxtools-3.0/src/threadpoolimpl.cpp0000664000175000017500000001171713644433072014515 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "threadpoolimpl.h" #include #include log_define("cxxtools.threadpool.impl") namespace cxxtools { bool ThreadPool::Future::FutureImpl::wait(Timespan timeout) const { MutexLock lock(_mutex); if (timeout > Timespan(0)) { Timespan until = Timespan::gettimeofday() + timeout; Timespan remaining; while (_state != Finished && _state != Failed && (remaining = until - Timespan::gettimeofday()) > Timespan(0)) { _stateChanged.wait(_mutex, remaining); } } else { while (_state != Finished && _state != Failed) _stateChanged.wait(_mutex); } return _state == Finished || _state == Failed; } void ThreadPool::Future::FutureImpl::setState(State state) { MutexLock lock(_mutex); _state = state; _stateChanged.broadcast(); } ThreadPoolImpl::~ThreadPoolImpl() { log_debug("delete " << _threads.size() << " threads"); for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) delete *it; log_debug("delete " << _queue.size() << " left tasks"); while (!_queue.empty()) _queue.get()._impl->setCanceled(); } void ThreadPoolImpl::start() { if (_state != Stopped) throw std::logic_error("invalid state"); _state = Starting; while (_threads.size() < _size) _threads.push_back(new AttachedThread(callable(*this, &ThreadPoolImpl::threadFunc))); _state = Running; for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) { log_debug("start thread " << static_cast(*it)); (*it)->start(); } } void ThreadPoolImpl::stop(bool cancel) { if (_state != Running) throw std::logic_error("thread pool not running"); log_debug("stop " << _threads.size() << " threads"); _state = Stopping; if (cancel) { std::pair p; while ((p = _queue.tryGet()).second) p.first._impl->setCanceled(); } for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) _queue.put(0); for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) { (*it)->join(); log_debug("joined thread " << static_cast(*it)); delete *it; } _threads.clear(); _state = Stopped; } ThreadPool::Future ThreadPoolImpl::schedule(const Callable& cb) { ThreadPool::Future future(new ThreadPool::Future::FutureImpl(cb)); log_debug("queue new task " << static_cast(future._impl->_callable)); _queue.put(future); log_debug("queue size " << _queue.size()); return future; } void ThreadPoolImpl::threadFunc() { ThreadPool::Future future; while ((future = _queue.get()), future._impl != 0) { log_debug("new task " << static_cast(future._impl->_callable) << " received " << _queue.size() << " tasks left"); try { (*future._impl->_callable)(); future._impl->setFinished(); } catch (...) { future._impl->setFailed(); } log_debug("task " << static_cast(future._impl->_callable) << " finished"); } log_debug("end thread"); } } cxxtools-3.0/src/md5.h0000664000175000017500000000714213644433072011621 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* RSAREF types and constants */ /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef SRC_CXXTOOLS_MD5_H #define SRC_CXXTOOLS_MD5_H #ifndef PROTOTYPES #define PROTOTYPES 1 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ typedef unsigned int UINT4; /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif /* MD5 context. */ struct cxxtools_MD5_CTX { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ }; #ifdef __cplusplus extern "C" { #endif void cxxtools_MD5Init PROTO_LIST ((struct cxxtools_MD5_CTX *)); void cxxtools_MD5Update PROTO_LIST ((struct cxxtools_MD5_CTX *, const unsigned char *, unsigned int)); void cxxtools_MD5Final PROTO_LIST ((unsigned char [16], struct cxxtools_MD5_CTX *)); #ifdef __cplusplus } #endif #endif /* SRC_CXXTOOLS_MD5_H */ cxxtools-3.0/src/muteximpl.h0000664000175000017500000000431513644433072013157 00000000000000/* * Copyright (C) 2005 - 2007 by Marc Boris Duerner * Copyright (C) 2005 - 2007 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MUTEXIMPL_H #define CXXTOOLS_MUTEXIMPL_H #include namespace cxxtools { class MutexImpl { public: MutexImpl(); explicit MutexImpl(bool recursive); ~MutexImpl(); void lock(); bool tryLock(); void unlock(); pthread_mutex_t* handle() { return &_handle; } const pthread_mutex_t* handle() const { return &_handle; } private: pthread_mutex_t _handle; }; class ReadWriteMutexImpl { public: ReadWriteMutexImpl(); ~ReadWriteMutexImpl(); void readLock(); bool tryReadLock(); void writeLock(); bool tryWriteLock(); void unlock(); private: pthread_rwlock_t _rwl; }; } // !namespace cxxtools #endif // CXXTOOLS_MUTEXIMPL_H cxxtools-3.0/missing0000755000175000017500000001533613644433103011570 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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; either version 2, or (at your option) # any later version. # 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: cxxtools-3.0/configure.ac0000664000175000017500000001611613644433072012463 00000000000000AC_INIT(cxxtools, 3.0, [Tommi Maekitalo ]) AM_INIT_AUTOMAKE AC_USE_SYSTEM_EXTENSIONS LT_INIT([disable-static]) AC_PREREQ([2.5.9]) abi_current=10 abi_revision=0 abi_age=0 sonumber=${abi_current}:${abi_revision}:${abi_age} AC_SUBST(sonumber) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h ]) AC_CONFIG_FILES([include/cxxtools/config.h]) AC_CONFIG_SRCDIR([src/log.cpp]) AC_HEADER_DIRENT AC_PROG_CC AC_PROG_CXX AC_LANG(C++) AX_CXX_COMPILE_STDCXX_11(noext, mandatory) AX_COMPILER_VENDOR AS_IF([test "$ax_cv_cxx_compiler_vendor" = "ibm"], [CPPFLAGS="$CPPFLAGS -qrtti -qlanglvl=newexcp -D__NOLOCK_ON_INPUT -D__NOLOCK_ON_OUTPUT"], AX_CHECK_COMPILE_FLAG([-Wno-long-long], [CPPFLAGS="$CPPFLAGS -Wno-long-long"]) AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"]) AX_CHECK_COMPILE_FLAG([-pedantic], [CPPFLAGS="$CPPFLAGS -pedantic"])) AC_CHECK_HEADERS(sys/filio.h) AC_CHECK_HEADERS(csignal) AC_CHECK_HEADERS([sys/sendfile.h]) AC_CHECK_LIB(nsl, setsockopt) AC_CHECK_LIB(socket, accept) AC_CHECK_LIB(rt, sem_destroy) AC_SEARCH_LIBS(dlopen, dl, , AC_MSG_ERROR([dlopen not found])) AC_SEARCH_LIBS(inet_ntop, nsl socket resolv) AC_SEARCH_LIBS(clock_gettime, rt) AC_CHECK_FUNCS(inet_ntop accept4) AC_CHECK_FUNCS(clock_gettime) AC_CHECK_FUNCS(nanosleep) AC_CHECK_FUNCS(sendfile) AC_CHECK_FUNCS(ppoll) AC_TYPE_LONG_LONG_INT AC_TYPE_UNSIGNED_LONG_LONG_INT AS_IF([test "$ac_cv_type_long_long_int" = yes], [ HAVE_LONG_LONG=HAVE_LONG_LONG AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include void f(short); void f(int); void f(long); void f(long long); void f() { int64_t v = 1; f(v); } ])], [AC_DEFINE(INT64_IS_BASETYPE, 1, [defined if int64_t is one of the base types])]) ], [ AC_MSG_WARN([long long not found]); HAVE_LONG_LONG=NO_LONG_LONG AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include void f(short); void f(int); void f(long); void f() { int64_t v = 1; f(v); } ])], [AC_DEFINE(INT64_IS_BASETYPE, 1, [defined if int64_t is one of the base types])]) ]) AC_SUBST(HAVE_LONG_LONG, "$HAVE_LONG_LONG") AS_IF([test "$ac_cv_type_unsigned_long_long_int" = yes], [ HAVE_UNSIGNED_LONG_LONG=HAVE_UNSIGNED_LONG_LONG ], [ AC_MSG_WARN([unsigned long long not found ($ac_cv_type_unsigned_long_long_int)]); HAVE_UNSIGNED_LONG_LONG=NO_UNSIGNED_LONG_LONG ]) AC_SUBST(HAVE_UNSIGNED_LONG_LONG, "$HAVE_UNSIGNED_LONG_LONG") AC_ARG_WITH([iconvstream], AS_HELP_STRING([--with-iconvstream=yes|no], [compile iconv stream (default: no)]), [with_iconvstream=$withval], [with_iconvstream=no]) AS_IF([test "$with_iconvstream" = yes], [ AM_ICONV AS_IF([test "$am_cv_func_iconv" != yes], AC_MSG_ERROR(iconv not found)) ]) AM_CONDITIONAL(MAKE_ICONVSTREAM, test $with_iconvstream = yes) ACX_PTHREAD CC="$PTHREAD_CC" CXX="$PTHREAD_CXX" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" LIBS="$LIBS $PTHREAD_LIBS" CXXTOOLS_CXXFLAGS='-I${includedir}' CXXTOOLS_LDFLAGS='-L${libdir} -lcxxtools' AC_SUBST(CXXTOOLS_CXXFLAGS) AC_SUBST(CXXTOOLS_LDFLAGS) case "${host_cpu}-${host_os}" in *-aix*) SHARED_LIB_FLAG=-qmkshrobj ;; *) SHARED_LIB_FLAG= ;; esac AC_SUBST(SHARED_LIB_FLAG) # # checking existence of suseconds_t, needed by hirestime.h # AC_CHECKING(for suseconds_t) AC_CHECK_TYPE( suseconds_t, [CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_T], [CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_TIME_T], [#include ]) AC_SUBST(CXXTOOLS_SUSECONDS) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include void foo() { std::numpunct* np; } ])], [CXXTOOLS_STD_LOCALE=CXXTOOLS_WITH_STD_LOCALE], [CXXTOOLS_STD_LOCALE=CXXTOOLS_WITHOUT_STD_LOCALE]) AC_SUBST(CXXTOOLS_STD_LOCALE) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include int i = TCP_DEFER_ACCEPT; ])], AC_DEFINE(HAVE_TCP_DEFER_ACCEPT, 1, [defined if TCP_DEFER_ACCEPT is defined])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include #include int i = IPPROTO_IPV6; ])], AC_DEFINE(HAVE_IPV6, 1, [defined if IPV6 is supported])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include #include int i = SO_NOSIGPIPE; ])], AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [defined if socket option SO_NOSIGPIPE is supported])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include #include int i = MSG_NOSIGNAL; ])], AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [defined if MSG_NOSIGNAL is defined])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include std::reverse_iterator r;])], [HAVE_REVERSE_ITERATOR=HAVE_REVERSE_ITERATOR], [HAVE_REVERSE_ITERATOR=NO_REVERSE_ITERATOR]) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include std::reverse_iterator r;])], [HAVE_REVERSE_ITERATOR_4=HAVE_REVERSE_ITERATOR_4], [HAVE_REVERSE_ITERATOR_4=NO_REVERSE_ITERATOR_4]) AC_SUBST(HAVE_REVERSE_ITERATOR, "$HAVE_REVERSE_ITERATOR") AC_SUBST(HAVE_REVERSE_ITERATOR_4, "$HAVE_REVERSE_ITERATOR_4") AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include void foo() { try {} catch (const abi::__forced_unwind&) {} } ])], AC_DEFINE(HAVE_ABI_FORCED_UNWIND, 1, [defined if exception abi::__forced_unwind exists])) # # SSL # AC_ARG_WITH([ssl], AS_HELP_STRING([--with-ssl=yes|no], [build with SSL support]), [ssl_option=$withval], [ssl_option=yes]) AS_IF([test $ssl_option = yes], [ AC_CHECK_HEADER([openssl/ssl.h], [ AC_MSG_RESULT([building with ssl support]) AC_DEFINE(WITH_SSL, [], [Define to build with openssl]) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include ASN1_TIME* t; void foo() { ASN1_TIME_diff(0, 0, t, t); } ])], [AC_DEFINE(HAVE_ASN1_TIME_diff, [], [Defined when openssl supports ASN1_TIME_diff (openssl 1.0.2)])], [] ) ], AC_MSG_ERROR([header for openssl not found; install openssl developent package or use --without-ssl]) ) ]) AM_CONDITIONAL(MAKE_OPENSSL, test $ssl_option = yes) AC_ARG_ENABLE([demos], AS_HELP_STRING([--disable-demos], [disable building demos]), [enable_demos=$enableval], [enable_demos=enable_demos]) AM_CONDITIONAL(MAKE_DEMOS, test "$enable_demos" = "enable_demos") AC_ARG_ENABLE([unittest], AS_HELP_STRING([--disable-unittest], [disable building unittest]), [enable_unittest=$enableval], [enable_unittest=enable_unittest]) AM_CONDITIONAL(MAKE_UNITTEST, test "$enable_unittest" = "enable_unittest") AC_CONFIG_FILES([cxxtools-config], [chmod +x cxxtools-config]) AC_CONFIG_FILES([ Makefile src/Makefile src/unit/Makefile src/http/Makefile src/xmlrpc/Makefile src/bin/Makefile src/json/Makefile include/Makefile tools/Makefile demo/Makefile demo/async/Makefile demo/ssl/Makefile test/Makefile ]) AC_CONFIG_FILES([ pkgconfig/cxxtools-bin.pc pkgconfig/cxxtools-http.pc pkgconfig/cxxtools-json.pc pkgconfig/cxxtools.pc pkgconfig/cxxtools-unit.pc pkgconfig/cxxtools-xmlrpc.pc ]) AC_OUTPUT cxxtools-3.0/AUTHORS0000664000175000017500000000006613644433072011242 00000000000000Tommi Mäkitalo Marc Boris Dürner cxxtools-3.0/demo/0000775000175000017500000000000013672344761011203 500000000000000cxxtools-3.0/demo/Makefile.in0000664000175000017500000014520213644433103013160 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = arg$(EXEEXT) arg-set$(EXEEXT) commandoutput$(EXEEXT) \ cxxlog$(EXEEXT) deserialization$(EXEEXT) dir$(EXEEXT) \ dlloader$(EXEEXT) execLs$(EXEEXT) future$(EXEEXT) \ getini$(EXEEXT) hd$(EXEEXT) httpclient$(EXEEXT) \ httprequest$(EXEEXT) httpserver$(EXEEXT) insrv$(EXEEXT) \ json$(EXEEXT) jsonbeautify$(EXEEXT) log$(EXEEXT) \ logsh$(EXEEXT) md5sum$(EXEEXT) mime$(EXEEXT) \ mime2json$(EXEEXT) mimeextract$(EXEEXT) mimemultipart$(EXEEXT) \ msgclient$(EXEEXT) msgserver$(EXEEXT) multifstream$(EXEEXT) \ netcat$(EXEEXT) netio$(EXEEXT) netmsg$(EXEEXT) \ pipestream$(EXEEXT) pool$(EXEEXT) regex$(EXEEXT) \ rpcaddclient$(EXEEXT) rpcasyncaddclient$(EXEEXT) \ rpcechoclient$(EXEEXT) rpcparallelecho$(EXEEXT) \ rpcserver$(EXEEXT) saml2$(EXEEXT) serialization$(EXEEXT) \ signals$(EXEEXT) splitter$(EXEEXT) sslshowcert$(EXEEXT) \ thread$(EXEEXT) threadpool$(EXEEXT) timer$(EXEEXT) \ uuencode$(EXEEXT) xmlmsgclient$(EXEEXT) xmlmsgserver$(EXEEXT) \ xmlreader$(EXEEXT) $(am__EXEEXT_1) @MAKE_ICONVSTREAM_TRUE@am__append_1 = iconv subdir = demo ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @MAKE_ICONVSTREAM_TRUE@am__EXEEXT_1 = iconv$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_arg_OBJECTS = arg.$(OBJEXT) arg_OBJECTS = $(am_arg_OBJECTS) arg_LDADD = $(LDADD) arg_DEPENDENCIES = $(top_builddir)/src/libcxxtools.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_arg_set_OBJECTS = arg-set.$(OBJEXT) arg_set_OBJECTS = $(am_arg_set_OBJECTS) arg_set_LDADD = $(LDADD) arg_set_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_commandoutput_OBJECTS = commandoutput.$(OBJEXT) commandoutput_OBJECTS = $(am_commandoutput_OBJECTS) commandoutput_LDADD = $(LDADD) commandoutput_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_cxxlog_OBJECTS = cxxlog.$(OBJEXT) cxxlog_OBJECTS = $(am_cxxlog_OBJECTS) cxxlog_LDADD = $(LDADD) cxxlog_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_deserialization_OBJECTS = deserialization.$(OBJEXT) deserialization_OBJECTS = $(am_deserialization_OBJECTS) deserialization_LDADD = $(LDADD) deserialization_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_dir_OBJECTS = dir.$(OBJEXT) dir_OBJECTS = $(am_dir_OBJECTS) dir_LDADD = $(LDADD) dir_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_dlloader_OBJECTS = dlloader.$(OBJEXT) dlloader_OBJECTS = $(am_dlloader_OBJECTS) dlloader_LDADD = $(LDADD) dlloader_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_execLs_OBJECTS = execLs.$(OBJEXT) execLs_OBJECTS = $(am_execLs_OBJECTS) execLs_LDADD = $(LDADD) execLs_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_future_OBJECTS = future.$(OBJEXT) future_OBJECTS = $(am_future_OBJECTS) future_LDADD = $(LDADD) future_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_getini_OBJECTS = getini.$(OBJEXT) getini_OBJECTS = $(am_getini_OBJECTS) getini_LDADD = $(LDADD) getini_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_hd_OBJECTS = hd.$(OBJEXT) hd_OBJECTS = $(am_hd_OBJECTS) hd_LDADD = $(LDADD) hd_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_httpclient_OBJECTS = httpclient.$(OBJEXT) httpclient_OBJECTS = $(am_httpclient_OBJECTS) httpclient_DEPENDENCIES = $(HTTP_LIBS) am_httprequest_OBJECTS = httprequest.$(OBJEXT) httprequest_OBJECTS = $(am_httprequest_OBJECTS) httprequest_DEPENDENCIES = $(HTTP_LIBS) am_httpserver_OBJECTS = httpserver.$(OBJEXT) httpserver_OBJECTS = $(am_httpserver_OBJECTS) httpserver_DEPENDENCIES = $(HTTP_LIBS) am__iconv_SOURCES_DIST = iconv.cpp @MAKE_ICONVSTREAM_TRUE@am_iconv_OBJECTS = iconv.$(OBJEXT) iconv_OBJECTS = $(am_iconv_OBJECTS) iconv_LDADD = $(LDADD) iconv_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_insrv_OBJECTS = insrv.$(OBJEXT) insrv_OBJECTS = $(am_insrv_OBJECTS) insrv_LDADD = $(LDADD) insrv_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_json_OBJECTS = json.$(OBJEXT) json_OBJECTS = $(am_json_OBJECTS) json_DEPENDENCIES = $(HTTP_LIBS) am_jsonbeautify_OBJECTS = jsonbeautify.$(OBJEXT) jsonbeautify_OBJECTS = $(am_jsonbeautify_OBJECTS) jsonbeautify_DEPENDENCIES = $(HTTP_LIBS) am_log_OBJECTS = log.$(OBJEXT) log_OBJECTS = $(am_log_OBJECTS) log_LDADD = $(LDADD) log_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_logsh_OBJECTS = logsh.$(OBJEXT) logsh_OBJECTS = $(am_logsh_OBJECTS) logsh_LDADD = $(LDADD) logsh_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_md5sum_OBJECTS = md5sum.$(OBJEXT) md5sum_OBJECTS = $(am_md5sum_OBJECTS) md5sum_LDADD = $(LDADD) md5sum_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_mime_OBJECTS = mime.$(OBJEXT) mime_OBJECTS = $(am_mime_OBJECTS) mime_LDADD = $(LDADD) mime_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_mime2json_OBJECTS = mime2json.$(OBJEXT) mime2json_OBJECTS = $(am_mime2json_OBJECTS) mime2json_LDADD = $(LDADD) mime2json_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_mimeextract_OBJECTS = mimeextract.$(OBJEXT) mimeextract_OBJECTS = $(am_mimeextract_OBJECTS) mimeextract_LDADD = $(LDADD) mimeextract_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_mimemultipart_OBJECTS = mimemultipart.$(OBJEXT) mimemultipart_OBJECTS = $(am_mimemultipart_OBJECTS) mimemultipart_LDADD = $(LDADD) mimemultipart_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_msgclient_OBJECTS = msgclient.$(OBJEXT) msgclient_OBJECTS = $(am_msgclient_OBJECTS) msgclient_DEPENDENCIES = $(BIN_LIBS) am_msgserver_OBJECTS = msgserver.$(OBJEXT) msgserver_OBJECTS = $(am_msgserver_OBJECTS) msgserver_DEPENDENCIES = $(BIN_LIBS) am_multifstream_OBJECTS = multifstream.$(OBJEXT) multifstream_OBJECTS = $(am_multifstream_OBJECTS) multifstream_LDADD = $(LDADD) multifstream_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_netcat_OBJECTS = netcat.$(OBJEXT) netcat_OBJECTS = $(am_netcat_OBJECTS) netcat_LDADD = $(LDADD) netcat_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_netio_OBJECTS = netio.$(OBJEXT) netio_OBJECTS = $(am_netio_OBJECTS) netio_LDADD = $(LDADD) netio_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_netmsg_OBJECTS = netmsg.$(OBJEXT) netmsg_OBJECTS = $(am_netmsg_OBJECTS) netmsg_LDADD = $(LDADD) netmsg_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_pipestream_OBJECTS = pipestream.$(OBJEXT) pipestream_OBJECTS = $(am_pipestream_OBJECTS) pipestream_LDADD = $(LDADD) pipestream_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_pool_OBJECTS = pool.$(OBJEXT) pool_OBJECTS = $(am_pool_OBJECTS) pool_LDADD = $(LDADD) pool_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_regex_OBJECTS = regex.$(OBJEXT) regex_OBJECTS = $(am_regex_OBJECTS) regex_LDADD = $(LDADD) regex_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_rpcaddclient_OBJECTS = rpcaddclient.$(OBJEXT) rpcaddclient_OBJECTS = $(am_rpcaddclient_OBJECTS) rpcaddclient_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) am_rpcasyncaddclient_OBJECTS = rpcasyncaddclient.$(OBJEXT) rpcasyncaddclient_OBJECTS = $(am_rpcasyncaddclient_OBJECTS) rpcasyncaddclient_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) \ $(JSON_LIBS) am_rpcechoclient_OBJECTS = rpcechoclient.$(OBJEXT) rpcechoclient_OBJECTS = $(am_rpcechoclient_OBJECTS) rpcechoclient_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) am_rpcparallelecho_OBJECTS = rpcparallelecho.$(OBJEXT) rpcparallelecho_OBJECTS = $(am_rpcparallelecho_OBJECTS) rpcparallelecho_DEPENDENCIES = $(BIN_LIBS) am_rpcserver_OBJECTS = rpcserver.$(OBJEXT) rpcserver_OBJECTS = $(am_rpcserver_OBJECTS) rpcserver_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) am_saml2_OBJECTS = saml2.$(OBJEXT) saml2_OBJECTS = $(am_saml2_OBJECTS) saml2_LDADD = $(LDADD) saml2_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_serialization_OBJECTS = serialization.$(OBJEXT) serialization_OBJECTS = $(am_serialization_OBJECTS) serialization_LDADD = $(LDADD) serialization_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_signals_OBJECTS = signals.$(OBJEXT) signals_OBJECTS = $(am_signals_OBJECTS) signals_LDADD = $(LDADD) signals_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_splitter_OBJECTS = splitter.$(OBJEXT) splitter_OBJECTS = $(am_splitter_OBJECTS) splitter_LDADD = $(LDADD) splitter_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_sslshowcert_OBJECTS = sslshowcert.$(OBJEXT) sslshowcert_OBJECTS = $(am_sslshowcert_OBJECTS) sslshowcert_LDADD = $(LDADD) sslshowcert_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_thread_OBJECTS = thread.$(OBJEXT) thread_OBJECTS = $(am_thread_OBJECTS) thread_LDADD = $(LDADD) thread_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_threadpool_OBJECTS = threadpool.$(OBJEXT) threadpool_OBJECTS = $(am_threadpool_OBJECTS) threadpool_LDADD = $(LDADD) threadpool_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_timer_OBJECTS = timer.$(OBJEXT) timer_OBJECTS = $(am_timer_OBJECTS) timer_LDADD = $(LDADD) timer_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_uuencode_OBJECTS = uuencode.$(OBJEXT) uuencode_OBJECTS = $(am_uuencode_OBJECTS) uuencode_LDADD = $(LDADD) uuencode_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_xmlmsgclient_OBJECTS = xmlmsgclient.$(OBJEXT) xmlmsgclient_OBJECTS = $(am_xmlmsgclient_OBJECTS) xmlmsgclient_DEPENDENCIES = $(XMLRPC_LIBS) am_xmlmsgserver_OBJECTS = xmlmsgserver.$(OBJEXT) xmlmsgserver_OBJECTS = $(am_xmlmsgserver_OBJECTS) xmlmsgserver_DEPENDENCIES = $(XMLRPC_LIBS) am_xmlreader_OBJECTS = xmlreader.$(OBJEXT) xmlreader_OBJECTS = $(am_xmlreader_OBJECTS) xmlreader_LDADD = $(LDADD) xmlreader_DEPENDENCIES = $(top_builddir)/src/libcxxtools.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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/arg-set.Po ./$(DEPDIR)/arg.Po \ ./$(DEPDIR)/commandoutput.Po ./$(DEPDIR)/cxxlog.Po \ ./$(DEPDIR)/deserialization.Po ./$(DEPDIR)/dir.Po \ ./$(DEPDIR)/dlloader.Po ./$(DEPDIR)/execLs.Po \ ./$(DEPDIR)/future.Po ./$(DEPDIR)/getini.Po ./$(DEPDIR)/hd.Po \ ./$(DEPDIR)/httpclient.Po ./$(DEPDIR)/httprequest.Po \ ./$(DEPDIR)/httpserver.Po ./$(DEPDIR)/iconv.Po \ ./$(DEPDIR)/insrv.Po ./$(DEPDIR)/json.Po \ ./$(DEPDIR)/jsonbeautify.Po ./$(DEPDIR)/log.Po \ ./$(DEPDIR)/logsh.Po ./$(DEPDIR)/md5sum.Po ./$(DEPDIR)/mime.Po \ ./$(DEPDIR)/mime2json.Po ./$(DEPDIR)/mimeextract.Po \ ./$(DEPDIR)/mimemultipart.Po ./$(DEPDIR)/msgclient.Po \ ./$(DEPDIR)/msgserver.Po ./$(DEPDIR)/multifstream.Po \ ./$(DEPDIR)/netcat.Po ./$(DEPDIR)/netio.Po \ ./$(DEPDIR)/netmsg.Po ./$(DEPDIR)/pipestream.Po \ ./$(DEPDIR)/pool.Po ./$(DEPDIR)/regex.Po \ ./$(DEPDIR)/rpcaddclient.Po ./$(DEPDIR)/rpcasyncaddclient.Po \ ./$(DEPDIR)/rpcechoclient.Po ./$(DEPDIR)/rpcparallelecho.Po \ ./$(DEPDIR)/rpcserver.Po ./$(DEPDIR)/saml2.Po \ ./$(DEPDIR)/serialization.Po ./$(DEPDIR)/signals.Po \ ./$(DEPDIR)/splitter.Po ./$(DEPDIR)/sslshowcert.Po \ ./$(DEPDIR)/thread.Po ./$(DEPDIR)/threadpool.Po \ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/uuencode.Po \ ./$(DEPDIR)/xmlmsgclient.Po ./$(DEPDIR)/xmlmsgserver.Po \ ./$(DEPDIR)/xmlreader.Po am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(arg_SOURCES) $(arg_set_SOURCES) $(commandoutput_SOURCES) \ $(cxxlog_SOURCES) $(deserialization_SOURCES) $(dir_SOURCES) \ $(dlloader_SOURCES) $(execLs_SOURCES) $(future_SOURCES) \ $(getini_SOURCES) $(hd_SOURCES) $(httpclient_SOURCES) \ $(httprequest_SOURCES) $(httpserver_SOURCES) $(iconv_SOURCES) \ $(insrv_SOURCES) $(json_SOURCES) $(jsonbeautify_SOURCES) \ $(log_SOURCES) $(logsh_SOURCES) $(md5sum_SOURCES) \ $(mime_SOURCES) $(mime2json_SOURCES) $(mimeextract_SOURCES) \ $(mimemultipart_SOURCES) $(msgclient_SOURCES) \ $(msgserver_SOURCES) $(multifstream_SOURCES) $(netcat_SOURCES) \ $(netio_SOURCES) $(netmsg_SOURCES) $(pipestream_SOURCES) \ $(pool_SOURCES) $(regex_SOURCES) $(rpcaddclient_SOURCES) \ $(rpcasyncaddclient_SOURCES) $(rpcechoclient_SOURCES) \ $(rpcparallelecho_SOURCES) $(rpcserver_SOURCES) \ $(saml2_SOURCES) $(serialization_SOURCES) $(signals_SOURCES) \ $(splitter_SOURCES) $(sslshowcert_SOURCES) $(thread_SOURCES) \ $(threadpool_SOURCES) $(timer_SOURCES) $(uuencode_SOURCES) \ $(xmlmsgclient_SOURCES) $(xmlmsgserver_SOURCES) \ $(xmlreader_SOURCES) DIST_SOURCES = $(arg_SOURCES) $(arg_set_SOURCES) \ $(commandoutput_SOURCES) $(cxxlog_SOURCES) \ $(deserialization_SOURCES) $(dir_SOURCES) $(dlloader_SOURCES) \ $(execLs_SOURCES) $(future_SOURCES) $(getini_SOURCES) \ $(hd_SOURCES) $(httpclient_SOURCES) $(httprequest_SOURCES) \ $(httpserver_SOURCES) $(am__iconv_SOURCES_DIST) \ $(insrv_SOURCES) $(json_SOURCES) $(jsonbeautify_SOURCES) \ $(log_SOURCES) $(logsh_SOURCES) $(md5sum_SOURCES) \ $(mime_SOURCES) $(mime2json_SOURCES) $(mimeextract_SOURCES) \ $(mimemultipart_SOURCES) $(msgclient_SOURCES) \ $(msgserver_SOURCES) $(multifstream_SOURCES) $(netcat_SOURCES) \ $(netio_SOURCES) $(netmsg_SOURCES) $(pipestream_SOURCES) \ $(pool_SOURCES) $(regex_SOURCES) $(rpcaddclient_SOURCES) \ $(rpcasyncaddclient_SOURCES) $(rpcechoclient_SOURCES) \ $(rpcparallelecho_SOURCES) $(rpcserver_SOURCES) \ $(saml2_SOURCES) $(serialization_SOURCES) $(signals_SOURCES) \ $(splitter_SOURCES) $(sslshowcert_SOURCES) $(thread_SOURCES) \ $(threadpool_SOURCES) $(timer_SOURCES) $(uuencode_SOURCES) \ $(xmlmsgclient_SOURCES) $(xmlmsgserver_SOURCES) \ $(xmlreader_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(noinst_DATA) HEADERS = $(noinst_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = \ msg.h arg_set_SOURCES = arg-set.cpp arg_SOURCES = arg.cpp commandoutput_SOURCES = commandoutput.cpp cxxlog_SOURCES = cxxlog.cpp deserialization_SOURCES = deserialization.cpp dir_SOURCES = dir.cpp dlloader_SOURCES = dlloader.cpp execLs_SOURCES = execLs.cpp future_SOURCES = future.cpp getini_SOURCES = getini.cpp hd_SOURCES = hd.cpp httpclient_SOURCES = httpclient.cpp httprequest_SOURCES = httprequest.cpp httpserver_SOURCES = httpserver.cpp insrv_SOURCES = insrv.cpp jsonbeautify_SOURCES = jsonbeautify.cpp json_SOURCES = json.cpp logsh_SOURCES = logsh.cpp log_SOURCES = log.cpp md5sum_SOURCES = md5sum.cpp mime2json_SOURCES = mime2json.cpp mimeextract_SOURCES = mimeextract.cpp mimemultipart_SOURCES = mimemultipart.cpp mime_SOURCES = mime.cpp msgclient_SOURCES = msgclient.cpp msgserver_SOURCES = msgserver.cpp multifstream_SOURCES = multifstream.cpp netcat_SOURCES = netcat.cpp netio_SOURCES = netio.cpp netmsg_SOURCES = netmsg.cpp pipestream_SOURCES = pipestream.cpp pool_SOURCES = pool.cpp regex_SOURCES = regex.cpp rpcaddclient_SOURCES = rpcaddclient.cpp rpcasyncaddclient_SOURCES = rpcasyncaddclient.cpp rpcechoclient_SOURCES = rpcechoclient.cpp rpcparallelecho_SOURCES = rpcparallelecho.cpp rpcserver_SOURCES = rpcserver.cpp saml2_SOURCES = saml2.cpp serialization_SOURCES = serialization.cpp signals_SOURCES = signals.cpp splitter_SOURCES = splitter.cpp sslshowcert_SOURCES = sslshowcert.cpp threadpool_SOURCES = threadpool.cpp thread_SOURCES = thread.cpp timer_SOURCES = timer.cpp uuencode_SOURCES = uuencode.cpp xmlmsgclient_SOURCES = xmlmsgclient.cpp xmlmsgserver_SOURCES = xmlmsgserver.cpp xmlreader_SOURCES = xmlreader.cpp @MAKE_ICONVSTREAM_TRUE@iconv_SOURCES = iconv.cpp BASE_LIBS = $(top_builddir)/src/libcxxtools.la HTTP_LIBS = $(BASE_LIBS) $(top_builddir)/src/http/libcxxtools-http.la XMLRPC_LIBS = $(HTTP_LIBS) $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la BIN_LIBS = $(BASE_LIBS) $(top_builddir)/src/bin/libcxxtools-bin.la JSON_LIBS = $(HTTP_LIBS) $(top_builddir)/src/json/libcxxtools-json.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = $(top_builddir)/src/libcxxtools.la httpclient_LDADD = $(HTTP_LIBS) httprequest_LDADD = $(HTTP_LIBS) httpserver_LDADD = $(HTTP_LIBS) rpcserver_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcechoclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) json_LDADD = $(HTTP_LIBS) jsonbeautify_LDADD = $(HTTP_LIBS) rpcasyncaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcparallelecho_LDADD = $(BIN_LIBS) msgclient_LDADD = $(BIN_LIBS) msgserver_LDADD = $(BIN_LIBS) xmlmsgclient_LDADD = $(XMLRPC_LIBS) xmlmsgserver_LDADD = $(XMLRPC_LIBS) noinst_DATA = log.xml CLEANFILES = log.xml EXTRA_DIST = README all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu demo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu demo/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list arg$(EXEEXT): $(arg_OBJECTS) $(arg_DEPENDENCIES) $(EXTRA_arg_DEPENDENCIES) @rm -f arg$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(arg_OBJECTS) $(arg_LDADD) $(LIBS) arg-set$(EXEEXT): $(arg_set_OBJECTS) $(arg_set_DEPENDENCIES) $(EXTRA_arg_set_DEPENDENCIES) @rm -f arg-set$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(arg_set_OBJECTS) $(arg_set_LDADD) $(LIBS) commandoutput$(EXEEXT): $(commandoutput_OBJECTS) $(commandoutput_DEPENDENCIES) $(EXTRA_commandoutput_DEPENDENCIES) @rm -f commandoutput$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(commandoutput_OBJECTS) $(commandoutput_LDADD) $(LIBS) cxxlog$(EXEEXT): $(cxxlog_OBJECTS) $(cxxlog_DEPENDENCIES) $(EXTRA_cxxlog_DEPENDENCIES) @rm -f cxxlog$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(cxxlog_OBJECTS) $(cxxlog_LDADD) $(LIBS) deserialization$(EXEEXT): $(deserialization_OBJECTS) $(deserialization_DEPENDENCIES) $(EXTRA_deserialization_DEPENDENCIES) @rm -f deserialization$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(deserialization_OBJECTS) $(deserialization_LDADD) $(LIBS) dir$(EXEEXT): $(dir_OBJECTS) $(dir_DEPENDENCIES) $(EXTRA_dir_DEPENDENCIES) @rm -f dir$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) dlloader$(EXEEXT): $(dlloader_OBJECTS) $(dlloader_DEPENDENCIES) $(EXTRA_dlloader_DEPENDENCIES) @rm -f dlloader$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(dlloader_OBJECTS) $(dlloader_LDADD) $(LIBS) execLs$(EXEEXT): $(execLs_OBJECTS) $(execLs_DEPENDENCIES) $(EXTRA_execLs_DEPENDENCIES) @rm -f execLs$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(execLs_OBJECTS) $(execLs_LDADD) $(LIBS) future$(EXEEXT): $(future_OBJECTS) $(future_DEPENDENCIES) $(EXTRA_future_DEPENDENCIES) @rm -f future$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(future_OBJECTS) $(future_LDADD) $(LIBS) getini$(EXEEXT): $(getini_OBJECTS) $(getini_DEPENDENCIES) $(EXTRA_getini_DEPENDENCIES) @rm -f getini$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(getini_OBJECTS) $(getini_LDADD) $(LIBS) hd$(EXEEXT): $(hd_OBJECTS) $(hd_DEPENDENCIES) $(EXTRA_hd_DEPENDENCIES) @rm -f hd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(hd_OBJECTS) $(hd_LDADD) $(LIBS) httpclient$(EXEEXT): $(httpclient_OBJECTS) $(httpclient_DEPENDENCIES) $(EXTRA_httpclient_DEPENDENCIES) @rm -f httpclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(httpclient_OBJECTS) $(httpclient_LDADD) $(LIBS) httprequest$(EXEEXT): $(httprequest_OBJECTS) $(httprequest_DEPENDENCIES) $(EXTRA_httprequest_DEPENDENCIES) @rm -f httprequest$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(httprequest_OBJECTS) $(httprequest_LDADD) $(LIBS) httpserver$(EXEEXT): $(httpserver_OBJECTS) $(httpserver_DEPENDENCIES) $(EXTRA_httpserver_DEPENDENCIES) @rm -f httpserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(httpserver_OBJECTS) $(httpserver_LDADD) $(LIBS) iconv$(EXEEXT): $(iconv_OBJECTS) $(iconv_DEPENDENCIES) $(EXTRA_iconv_DEPENDENCIES) @rm -f iconv$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(iconv_OBJECTS) $(iconv_LDADD) $(LIBS) insrv$(EXEEXT): $(insrv_OBJECTS) $(insrv_DEPENDENCIES) $(EXTRA_insrv_DEPENDENCIES) @rm -f insrv$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(insrv_OBJECTS) $(insrv_LDADD) $(LIBS) json$(EXEEXT): $(json_OBJECTS) $(json_DEPENDENCIES) $(EXTRA_json_DEPENDENCIES) @rm -f json$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(json_OBJECTS) $(json_LDADD) $(LIBS) jsonbeautify$(EXEEXT): $(jsonbeautify_OBJECTS) $(jsonbeautify_DEPENDENCIES) $(EXTRA_jsonbeautify_DEPENDENCIES) @rm -f jsonbeautify$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(jsonbeautify_OBJECTS) $(jsonbeautify_LDADD) $(LIBS) log$(EXEEXT): $(log_OBJECTS) $(log_DEPENDENCIES) $(EXTRA_log_DEPENDENCIES) @rm -f log$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(log_OBJECTS) $(log_LDADD) $(LIBS) logsh$(EXEEXT): $(logsh_OBJECTS) $(logsh_DEPENDENCIES) $(EXTRA_logsh_DEPENDENCIES) @rm -f logsh$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(logsh_OBJECTS) $(logsh_LDADD) $(LIBS) md5sum$(EXEEXT): $(md5sum_OBJECTS) $(md5sum_DEPENDENCIES) $(EXTRA_md5sum_DEPENDENCIES) @rm -f md5sum$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(md5sum_OBJECTS) $(md5sum_LDADD) $(LIBS) mime$(EXEEXT): $(mime_OBJECTS) $(mime_DEPENDENCIES) $(EXTRA_mime_DEPENDENCIES) @rm -f mime$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(mime_OBJECTS) $(mime_LDADD) $(LIBS) mime2json$(EXEEXT): $(mime2json_OBJECTS) $(mime2json_DEPENDENCIES) $(EXTRA_mime2json_DEPENDENCIES) @rm -f mime2json$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(mime2json_OBJECTS) $(mime2json_LDADD) $(LIBS) mimeextract$(EXEEXT): $(mimeextract_OBJECTS) $(mimeextract_DEPENDENCIES) $(EXTRA_mimeextract_DEPENDENCIES) @rm -f mimeextract$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(mimeextract_OBJECTS) $(mimeextract_LDADD) $(LIBS) mimemultipart$(EXEEXT): $(mimemultipart_OBJECTS) $(mimemultipart_DEPENDENCIES) $(EXTRA_mimemultipart_DEPENDENCIES) @rm -f mimemultipart$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(mimemultipart_OBJECTS) $(mimemultipart_LDADD) $(LIBS) msgclient$(EXEEXT): $(msgclient_OBJECTS) $(msgclient_DEPENDENCIES) $(EXTRA_msgclient_DEPENDENCIES) @rm -f msgclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(msgclient_OBJECTS) $(msgclient_LDADD) $(LIBS) msgserver$(EXEEXT): $(msgserver_OBJECTS) $(msgserver_DEPENDENCIES) $(EXTRA_msgserver_DEPENDENCIES) @rm -f msgserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(msgserver_OBJECTS) $(msgserver_LDADD) $(LIBS) multifstream$(EXEEXT): $(multifstream_OBJECTS) $(multifstream_DEPENDENCIES) $(EXTRA_multifstream_DEPENDENCIES) @rm -f multifstream$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(multifstream_OBJECTS) $(multifstream_LDADD) $(LIBS) netcat$(EXEEXT): $(netcat_OBJECTS) $(netcat_DEPENDENCIES) $(EXTRA_netcat_DEPENDENCIES) @rm -f netcat$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(netcat_OBJECTS) $(netcat_LDADD) $(LIBS) netio$(EXEEXT): $(netio_OBJECTS) $(netio_DEPENDENCIES) $(EXTRA_netio_DEPENDENCIES) @rm -f netio$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(netio_OBJECTS) $(netio_LDADD) $(LIBS) netmsg$(EXEEXT): $(netmsg_OBJECTS) $(netmsg_DEPENDENCIES) $(EXTRA_netmsg_DEPENDENCIES) @rm -f netmsg$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(netmsg_OBJECTS) $(netmsg_LDADD) $(LIBS) pipestream$(EXEEXT): $(pipestream_OBJECTS) $(pipestream_DEPENDENCIES) $(EXTRA_pipestream_DEPENDENCIES) @rm -f pipestream$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(pipestream_OBJECTS) $(pipestream_LDADD) $(LIBS) pool$(EXEEXT): $(pool_OBJECTS) $(pool_DEPENDENCIES) $(EXTRA_pool_DEPENDENCIES) @rm -f pool$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(pool_OBJECTS) $(pool_LDADD) $(LIBS) regex$(EXEEXT): $(regex_OBJECTS) $(regex_DEPENDENCIES) $(EXTRA_regex_DEPENDENCIES) @rm -f regex$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(regex_OBJECTS) $(regex_LDADD) $(LIBS) rpcaddclient$(EXEEXT): $(rpcaddclient_OBJECTS) $(rpcaddclient_DEPENDENCIES) $(EXTRA_rpcaddclient_DEPENDENCIES) @rm -f rpcaddclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcaddclient_OBJECTS) $(rpcaddclient_LDADD) $(LIBS) rpcasyncaddclient$(EXEEXT): $(rpcasyncaddclient_OBJECTS) $(rpcasyncaddclient_DEPENDENCIES) $(EXTRA_rpcasyncaddclient_DEPENDENCIES) @rm -f rpcasyncaddclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcasyncaddclient_OBJECTS) $(rpcasyncaddclient_LDADD) $(LIBS) rpcechoclient$(EXEEXT): $(rpcechoclient_OBJECTS) $(rpcechoclient_DEPENDENCIES) $(EXTRA_rpcechoclient_DEPENDENCIES) @rm -f rpcechoclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcechoclient_OBJECTS) $(rpcechoclient_LDADD) $(LIBS) rpcparallelecho$(EXEEXT): $(rpcparallelecho_OBJECTS) $(rpcparallelecho_DEPENDENCIES) $(EXTRA_rpcparallelecho_DEPENDENCIES) @rm -f rpcparallelecho$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcparallelecho_OBJECTS) $(rpcparallelecho_LDADD) $(LIBS) rpcserver$(EXEEXT): $(rpcserver_OBJECTS) $(rpcserver_DEPENDENCIES) $(EXTRA_rpcserver_DEPENDENCIES) @rm -f rpcserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcserver_OBJECTS) $(rpcserver_LDADD) $(LIBS) saml2$(EXEEXT): $(saml2_OBJECTS) $(saml2_DEPENDENCIES) $(EXTRA_saml2_DEPENDENCIES) @rm -f saml2$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(saml2_OBJECTS) $(saml2_LDADD) $(LIBS) serialization$(EXEEXT): $(serialization_OBJECTS) $(serialization_DEPENDENCIES) $(EXTRA_serialization_DEPENDENCIES) @rm -f serialization$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(serialization_OBJECTS) $(serialization_LDADD) $(LIBS) signals$(EXEEXT): $(signals_OBJECTS) $(signals_DEPENDENCIES) $(EXTRA_signals_DEPENDENCIES) @rm -f signals$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(signals_OBJECTS) $(signals_LDADD) $(LIBS) splitter$(EXEEXT): $(splitter_OBJECTS) $(splitter_DEPENDENCIES) $(EXTRA_splitter_DEPENDENCIES) @rm -f splitter$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(splitter_OBJECTS) $(splitter_LDADD) $(LIBS) sslshowcert$(EXEEXT): $(sslshowcert_OBJECTS) $(sslshowcert_DEPENDENCIES) $(EXTRA_sslshowcert_DEPENDENCIES) @rm -f sslshowcert$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(sslshowcert_OBJECTS) $(sslshowcert_LDADD) $(LIBS) thread$(EXEEXT): $(thread_OBJECTS) $(thread_DEPENDENCIES) $(EXTRA_thread_DEPENDENCIES) @rm -f thread$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(thread_OBJECTS) $(thread_LDADD) $(LIBS) threadpool$(EXEEXT): $(threadpool_OBJECTS) $(threadpool_DEPENDENCIES) $(EXTRA_threadpool_DEPENDENCIES) @rm -f threadpool$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(threadpool_OBJECTS) $(threadpool_LDADD) $(LIBS) timer$(EXEEXT): $(timer_OBJECTS) $(timer_DEPENDENCIES) $(EXTRA_timer_DEPENDENCIES) @rm -f timer$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(timer_OBJECTS) $(timer_LDADD) $(LIBS) uuencode$(EXEEXT): $(uuencode_OBJECTS) $(uuencode_DEPENDENCIES) $(EXTRA_uuencode_DEPENDENCIES) @rm -f uuencode$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(uuencode_OBJECTS) $(uuencode_LDADD) $(LIBS) xmlmsgclient$(EXEEXT): $(xmlmsgclient_OBJECTS) $(xmlmsgclient_DEPENDENCIES) $(EXTRA_xmlmsgclient_DEPENDENCIES) @rm -f xmlmsgclient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xmlmsgclient_OBJECTS) $(xmlmsgclient_LDADD) $(LIBS) xmlmsgserver$(EXEEXT): $(xmlmsgserver_OBJECTS) $(xmlmsgserver_DEPENDENCIES) $(EXTRA_xmlmsgserver_DEPENDENCIES) @rm -f xmlmsgserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xmlmsgserver_OBJECTS) $(xmlmsgserver_LDADD) $(LIBS) xmlreader$(EXEEXT): $(xmlreader_OBJECTS) $(xmlreader_DEPENDENCIES) $(EXTRA_xmlreader_DEPENDENCIES) @rm -f xmlreader$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xmlreader_OBJECTS) $(xmlreader_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg-set.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandoutput.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cxxlog.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deserialization.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlloader.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execLs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/future.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getini.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httprequest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/insrv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonbeautify.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logsh.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5sum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime2json.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mimeextract.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mimemultipart.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multifstream.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netio.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netmsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipestream.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcaddclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcasyncaddclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcechoclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcparallelecho.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saml2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serialization.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splitter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sslshowcert.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadpool.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuencode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlmsgclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlmsgserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlreader.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/arg-set.Po -rm -f ./$(DEPDIR)/arg.Po -rm -f ./$(DEPDIR)/commandoutput.Po -rm -f ./$(DEPDIR)/cxxlog.Po -rm -f ./$(DEPDIR)/deserialization.Po -rm -f ./$(DEPDIR)/dir.Po -rm -f ./$(DEPDIR)/dlloader.Po -rm -f ./$(DEPDIR)/execLs.Po -rm -f ./$(DEPDIR)/future.Po -rm -f ./$(DEPDIR)/getini.Po -rm -f ./$(DEPDIR)/hd.Po -rm -f ./$(DEPDIR)/httpclient.Po -rm -f ./$(DEPDIR)/httprequest.Po -rm -f ./$(DEPDIR)/httpserver.Po -rm -f ./$(DEPDIR)/iconv.Po -rm -f ./$(DEPDIR)/insrv.Po -rm -f ./$(DEPDIR)/json.Po -rm -f ./$(DEPDIR)/jsonbeautify.Po -rm -f ./$(DEPDIR)/log.Po -rm -f ./$(DEPDIR)/logsh.Po -rm -f ./$(DEPDIR)/md5sum.Po -rm -f ./$(DEPDIR)/mime.Po -rm -f ./$(DEPDIR)/mime2json.Po -rm -f ./$(DEPDIR)/mimeextract.Po -rm -f ./$(DEPDIR)/mimemultipart.Po -rm -f ./$(DEPDIR)/msgclient.Po -rm -f ./$(DEPDIR)/msgserver.Po -rm -f ./$(DEPDIR)/multifstream.Po -rm -f ./$(DEPDIR)/netcat.Po -rm -f ./$(DEPDIR)/netio.Po -rm -f ./$(DEPDIR)/netmsg.Po -rm -f ./$(DEPDIR)/pipestream.Po -rm -f ./$(DEPDIR)/pool.Po -rm -f ./$(DEPDIR)/regex.Po -rm -f ./$(DEPDIR)/rpcaddclient.Po -rm -f ./$(DEPDIR)/rpcasyncaddclient.Po -rm -f ./$(DEPDIR)/rpcechoclient.Po -rm -f ./$(DEPDIR)/rpcparallelecho.Po -rm -f ./$(DEPDIR)/rpcserver.Po -rm -f ./$(DEPDIR)/saml2.Po -rm -f ./$(DEPDIR)/serialization.Po -rm -f ./$(DEPDIR)/signals.Po -rm -f ./$(DEPDIR)/splitter.Po -rm -f ./$(DEPDIR)/sslshowcert.Po -rm -f ./$(DEPDIR)/thread.Po -rm -f ./$(DEPDIR)/threadpool.Po -rm -f ./$(DEPDIR)/timer.Po -rm -f ./$(DEPDIR)/uuencode.Po -rm -f ./$(DEPDIR)/xmlmsgclient.Po -rm -f ./$(DEPDIR)/xmlmsgserver.Po -rm -f ./$(DEPDIR)/xmlreader.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/arg-set.Po -rm -f ./$(DEPDIR)/arg.Po -rm -f ./$(DEPDIR)/commandoutput.Po -rm -f ./$(DEPDIR)/cxxlog.Po -rm -f ./$(DEPDIR)/deserialization.Po -rm -f ./$(DEPDIR)/dir.Po -rm -f ./$(DEPDIR)/dlloader.Po -rm -f ./$(DEPDIR)/execLs.Po -rm -f ./$(DEPDIR)/future.Po -rm -f ./$(DEPDIR)/getini.Po -rm -f ./$(DEPDIR)/hd.Po -rm -f ./$(DEPDIR)/httpclient.Po -rm -f ./$(DEPDIR)/httprequest.Po -rm -f ./$(DEPDIR)/httpserver.Po -rm -f ./$(DEPDIR)/iconv.Po -rm -f ./$(DEPDIR)/insrv.Po -rm -f ./$(DEPDIR)/json.Po -rm -f ./$(DEPDIR)/jsonbeautify.Po -rm -f ./$(DEPDIR)/log.Po -rm -f ./$(DEPDIR)/logsh.Po -rm -f ./$(DEPDIR)/md5sum.Po -rm -f ./$(DEPDIR)/mime.Po -rm -f ./$(DEPDIR)/mime2json.Po -rm -f ./$(DEPDIR)/mimeextract.Po -rm -f ./$(DEPDIR)/mimemultipart.Po -rm -f ./$(DEPDIR)/msgclient.Po -rm -f ./$(DEPDIR)/msgserver.Po -rm -f ./$(DEPDIR)/multifstream.Po -rm -f ./$(DEPDIR)/netcat.Po -rm -f ./$(DEPDIR)/netio.Po -rm -f ./$(DEPDIR)/netmsg.Po -rm -f ./$(DEPDIR)/pipestream.Po -rm -f ./$(DEPDIR)/pool.Po -rm -f ./$(DEPDIR)/regex.Po -rm -f ./$(DEPDIR)/rpcaddclient.Po -rm -f ./$(DEPDIR)/rpcasyncaddclient.Po -rm -f ./$(DEPDIR)/rpcechoclient.Po -rm -f ./$(DEPDIR)/rpcparallelecho.Po -rm -f ./$(DEPDIR)/rpcserver.Po -rm -f ./$(DEPDIR)/saml2.Po -rm -f ./$(DEPDIR)/serialization.Po -rm -f ./$(DEPDIR)/signals.Po -rm -f ./$(DEPDIR)/splitter.Po -rm -f ./$(DEPDIR)/sslshowcert.Po -rm -f ./$(DEPDIR)/thread.Po -rm -f ./$(DEPDIR)/threadpool.Po -rm -f ./$(DEPDIR)/timer.Po -rm -f ./$(DEPDIR)/uuencode.Po -rm -f ./$(DEPDIR)/xmlmsgclient.Po -rm -f ./$(DEPDIR)/xmlmsgserver.Po -rm -f ./$(DEPDIR)/xmlreader.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles 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 .PRECIOUS: Makefile log.xml: $(AM_V_GEN)$(SHELL) $(top_builddir)/cxxtools-config --logxml cxxtools >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/demo/netcat.cpp0000664000175000017500000000627713644433072013112 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 1234); cxxtools::Arg bufsize(argc, argv, 'b', 8192); cxxtools::Arg listen(argc, argv, 'l'); cxxtools::Arg read_reply(argc, argv, 'r'); cxxtools::Arg ssl(argc, argv, 's'); cxxtools::Arg cert(argc, argv, "--cert"); cxxtools::Arg ca(argc, argv, "--CA"); if (listen) { // I'm a server // listen to a port cxxtools::net::TcpServer server(ip.getValue(), port); // accept a connetion cxxtools::net::TcpStream worker(server, bufsize); if (ssl) { if (cert.isSet()) worker.loadSslCertificateFile(cert); if (ca.isSet()) worker.setSslVerify(2, ca); worker.sslAccept(); } // copy to stdout std::cout << worker.rdbuf(); } else { // I'm a client // connect to server cxxtools::net::TcpStream peer(ip, port, bufsize); if (ssl) { if (cert.isSet()) peer.loadSslCertificateFile(cert); peer.sslConnect(); } if (argc > 1) { for (int a = 1; a < argc; ++a) { std::ifstream in(argv[a]); peer << in.rdbuf() << std::flush; } } else { // copy stdin to server peer << std::cin.rdbuf() << std::flush; } if (read_reply) // copy answer to stdout std::cout << peer.rdbuf() << std::flush; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/cxxlog.cpp0000664000175000017500000000666313644433072013137 00000000000000/* * Copyright (C) 2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include // Normally the category parameter is a constant. // // log_define defines a function, which fetches a logger class using that // constant. Since this is done only the first time something is logged, it is // important to set the category before the first logging output statement. // std::string category; log_define(category) int main(int argc, char* argv[]) { try { cxxtools::Arg fatal(argc, argv, 'f'); cxxtools::Arg fatal_l(argc, argv, "--fatal"); cxxtools::Arg error(argc, argv, 'e'); cxxtools::Arg error_l(argc, argv, "--error"); cxxtools::Arg warn(argc, argv, 'w'); cxxtools::Arg warn_l(argc, argv, "--warn"); cxxtools::Arg info(argc, argv, 'i'); cxxtools::Arg info_l(argc, argv, "--info"); cxxtools::Arg debug(argc, argv, 'd'); cxxtools::Arg debug_l(argc, argv, "--debug"); cxxtools::Arg properties(argc, argv, 'p', "log.properties"); cxxtools::Arg properties_l(argc, argv, "--properties", properties); if (argc <= 2) { std::cerr << "usage: " << argv[0] << " options category message\n" "\toptions: -f|--fatal\n" "\t -e|--error\n" "\t -w|--warn\n" "\t -i|--info\n" "\t -d|--debug\n" "\t -p|--properties filename" << std::endl; return -1; } category = argv[1]; log_init(properties_l.getValue()); std::ostringstream msg; std::copy(argv + 2, argv + argc, std::ostream_iterator(msg, " ")); if (fatal || fatal_l) log_fatal(msg.str()); if (error || error_l) log_error(msg.str()); if (warn || warn_l) log_warn(msg.str()); if (info || info_l) log_info(msg.str()); if (debug || debug_l) log_debug(msg.str()); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/httpclient.cpp0000664000175000017500000000474713644433072014012 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This demo is a very simple http client. It just fetches one or more pages from a web server and prints the content. It is called with one or more http requests as parameters. */ #include #include #include #include #include int main(int argc, char* argv[]) { try { log_init(); // We default construct a http client cxxtools::http::Client client; for (int a = 1; a < argc; ++a) { // This parses the argument, e.g. "http://www.tntnet.org/cxxtools.html" // See documentation of cxxtools::net::Uri for details cxxtools::net::Uri uri(argv[a]); // This passes the host and port to the http client. // Note that in case the client is connected already and the same host // and port is specified, the connection is kept open. client.prepareConnect(uri); // Fetch the content from the web server and print out. std::cout << client.get(uri.path(), cxxtools::QueryParams(uri.query())).body(); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/pipestream.cpp0000664000175000017500000000532413644433072013775 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * This demo shows, how to create a child-process, use a pipe to signal * from child to parent and another pipe to send a datastream. */ #include #include #include #include int main(int argc, char* argv[]) { try { // create pipe, where child signals, that he is initialized cxxtools::posix::Pipe pipe; cxxtools::posix::Pipestream pstream; // fork child-process cxxtools::posix::Fork fork; if (fork.parent()) { pipe.closeWriteFd(); pstream.closeWriteFd(); std::cout << "waiting for child to become ready" << std::endl; char ch = pipe.read(); std::cout << "child is ready - he sent '" << ch << '\'' << std::endl; // now we copy everything, the child sends through the stream std::cout << pstream.rdbuf() << std::flush; fork.wait(); std::cout << "child terminated normally" << std::endl; } else // child { pipe.closeReadFd(); pstream.closeReadFd(); // we simulate some long initialization: cxxtools::Thread::sleep(cxxtools::Seconds(1)); pipe.write('a'); // make another break cxxtools::Thread::sleep(cxxtools::Seconds(1)); pstream << "Hello World!" << std::endl; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/msgclient.cpp0000664000175000017500000000517313644433072013613 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include "msg.h" int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7010); // We instantiate a network iostream and connect to a server cxxtools::net::TcpStream inp(ip, port); // ... and read messages until the stream fails. Msg msg; while (inp >> cxxtools::bin::Bin(msg)) { std::cout << msg.value << '\t' << msg.str << std::endl; } /* As an alternative the deserializer can be used directly. This gives more control about the input operation. It is especially useful when non blocking I/O is used. The deserializer keeps the current state between the calls to `advance`. @code char ch; cxxtools::bin::Deserializer deserializer; deserializer.begin(); while (inp.get(ch)) { if (deserializer.advance(ch) == true) { Msg msg; deserializer.deserialize(msg); std::cout << msg.value << '\t' << msg.str << std::endl; deserializer.begin(); } } @endcode */ } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/logsh.cpp0000664000175000017500000000576713644433072012753 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include const char* category = "logsh"; log_define(category) int main(int argc, char* argv[]) { try { cxxtools::Arg fatal; fatal.set(argc, argv, 'f'); fatal.set(argc, argv, "--fatal"); cxxtools::Arg error; error.set(argc, argv, 'e'); error.set(argc, argv, "--error"); cxxtools::Arg warn; warn.set(argc, argv, 'w'); warn.set(argc, argv, "--warn"); cxxtools::Arg info; info.set(argc, argv, 'i'); info.set(argc, argv, "--info"); cxxtools::Arg debug; debug.set(argc, argv, 'd'); debug.set(argc, argv, "--debug"); cxxtools::Arg properties("log4j.properties"); properties.set(argc, argv, 'p'); properties.set(argc, argv, "--properties"); if (argc <= 2) { std::cerr << "usage: " << argv[0] << " [options] category message\n" "\toptions: -f|--fatal\n" "\t -e|--error\n" "\t -w|--warn\n" "\t -i|--info\n" "\t -d|--debug\n" "\t -p|--properties filename" << std::endl; return -1; } log_init(properties.getValue()); category = argv[1]; for (int a = 2; a < argc; ++a) { if (fatal) log_fatal(argv[a]); else if (error) log_error(argv[a]); else if (warn) log_warn(argv[a]); else if (info) log_info(argv[a]); else if (debug) log_debug(argv[a]); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return -1; } } cxxtools-3.0/demo/Makefile.am0000664000175000017500000000674013644433072013157 00000000000000noinst_HEADERS = \ msg.h noinst_PROGRAMS = \ arg \ arg-set \ commandoutput \ cxxlog \ deserialization \ dir \ dlloader \ execLs \ future \ getini hd \ httpclient \ httprequest \ httpserver \ insrv \ json \ jsonbeautify \ log \ logsh \ md5sum \ mime \ mime2json \ mimeextract \ mimemultipart \ msgclient \ msgserver \ multifstream \ netcat \ netio \ netmsg \ pipestream \ pool \ regex \ rpcaddclient \ rpcasyncaddclient \ rpcechoclient \ rpcparallelecho \ rpcserver \ saml2 \ serialization \ signals \ splitter \ sslshowcert \ thread \ threadpool \ timer \ uuencode \ xmlmsgclient \ xmlmsgserver \ xmlreader arg_set_SOURCES = arg-set.cpp arg_SOURCES = arg.cpp commandoutput_SOURCES = commandoutput.cpp cxxlog_SOURCES = cxxlog.cpp deserialization_SOURCES = deserialization.cpp dir_SOURCES = dir.cpp dlloader_SOURCES = dlloader.cpp execLs_SOURCES = execLs.cpp future_SOURCES = future.cpp getini_SOURCES = getini.cpp hd_SOURCES = hd.cpp httpclient_SOURCES = httpclient.cpp httprequest_SOURCES = httprequest.cpp httpserver_SOURCES = httpserver.cpp insrv_SOURCES = insrv.cpp jsonbeautify_SOURCES = jsonbeautify.cpp json_SOURCES = json.cpp logsh_SOURCES = logsh.cpp log_SOURCES = log.cpp md5sum_SOURCES = md5sum.cpp mime2json_SOURCES = mime2json.cpp mimeextract_SOURCES = mimeextract.cpp mimemultipart_SOURCES = mimemultipart.cpp mime_SOURCES = mime.cpp msgclient_SOURCES = msgclient.cpp msgserver_SOURCES = msgserver.cpp multifstream_SOURCES = multifstream.cpp netcat_SOURCES = netcat.cpp netio_SOURCES = netio.cpp netmsg_SOURCES = netmsg.cpp pipestream_SOURCES = pipestream.cpp pool_SOURCES = pool.cpp regex_SOURCES = regex.cpp rpcaddclient_SOURCES = rpcaddclient.cpp rpcasyncaddclient_SOURCES = rpcasyncaddclient.cpp rpcechoclient_SOURCES = rpcechoclient.cpp rpcparallelecho_SOURCES = rpcparallelecho.cpp rpcserver_SOURCES = rpcserver.cpp saml2_SOURCES = saml2.cpp serialization_SOURCES = serialization.cpp signals_SOURCES = signals.cpp splitter_SOURCES = splitter.cpp sslshowcert_SOURCES = sslshowcert.cpp threadpool_SOURCES = threadpool.cpp thread_SOURCES = thread.cpp timer_SOURCES = timer.cpp uuencode_SOURCES = uuencode.cpp xmlmsgclient_SOURCES = xmlmsgclient.cpp xmlmsgserver_SOURCES = xmlmsgserver.cpp xmlreader_SOURCES = xmlreader.cpp if MAKE_ICONVSTREAM noinst_PROGRAMS += iconv iconv_SOURCES = iconv.cpp endif BASE_LIBS = $(top_builddir)/src/libcxxtools.la HTTP_LIBS = $(BASE_LIBS) $(top_builddir)/src/http/libcxxtools-http.la XMLRPC_LIBS = $(HTTP_LIBS) $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la BIN_LIBS = $(BASE_LIBS) $(top_builddir)/src/bin/libcxxtools-bin.la JSON_LIBS = $(HTTP_LIBS) $(top_builddir)/src/json/libcxxtools-json.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = $(top_builddir)/src/libcxxtools.la httpclient_LDADD = $(HTTP_LIBS) httprequest_LDADD = $(HTTP_LIBS) httpserver_LDADD = $(HTTP_LIBS) rpcserver_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcechoclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) json_LDADD = $(HTTP_LIBS) jsonbeautify_LDADD = $(HTTP_LIBS) rpcasyncaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcparallelecho_LDADD = $(BIN_LIBS) msgclient_LDADD = $(BIN_LIBS) msgserver_LDADD = $(BIN_LIBS) xmlmsgclient_LDADD = $(XMLRPC_LIBS) xmlmsgserver_LDADD = $(XMLRPC_LIBS) log.xml: $(AM_V_GEN)$(SHELL) $(top_builddir)/cxxtools-config --logxml cxxtools >$@ noinst_DATA = log.xml CLEANFILES = log.xml EXTRA_DIST = README cxxtools-3.0/demo/mime.cpp0000664000175000017500000000473413644433072012557 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg binary(argc, argv, 'b'); cxxtools::MimeMultipart mime; for (int a = 1; a < argc; ++a) { std::string fname = argv[a]; std::ifstream ifile(argv[a]); if (!ifile) throw std::runtime_error("cannot open file " + fname); if (fname.size() >= 4 && fname.compare(fname.size() - 4, 4, ".jpg") == 0) mime.attachBinaryFile(ifile, fname, "image/jpg"); else if (fname.size() >= 4 && fname.compare(fname.size() - 4, 4, ".gif") == 0) mime.attachBinaryFile(ifile, fname, "image/gif"); else if (fname.size() >= 4 && fname.compare(fname.size() - 4, 4, ".png") == 0) mime.attachBinaryFile(ifile, fname, "image/png"); else if (binary) mime.attachBinaryFile(ifile, fname); else mime.addObject(ifile, "text/plain; charset=UTF-8"); } std::cout << mime; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/xmlreader.cpp0000664000175000017500000000556413644433072013615 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This program demonstrates how to read a xml structure with xml attributes. */ #include #include #include #include // We define a object, which describes the structure, we read from xml. class MyObject { friend void operator>>= (const cxxtools::SerializationInfo& si, MyObject& obj); std::string _stringValue; int _intValue; public: const std::string& stringValue() const { return _stringValue; } int intValue() const { return _intValue; } }; // The deserialization helper operator converts the SerializationInfo to our object void operator>>= (const cxxtools::SerializationInfo& si, MyObject& obj) { si.getMember("stringValue") >>= obj._stringValue; si.getMember("intValue") >>= obj._intValue; } int main(int argc, char* argv[]) { try { // Xml is read from a std::istream std::istringstream in(""); // We define a object and use the deserialization helper function cxxtools::xml::Xml // which makes it easy to use the xml deserializer // // By default the values are read from sub nodes. Here we want to read the // xml attributes. MyObject o; in >> cxxtools::xml::Xml(o).readAttributes(true); // To see the result, we print our object to std::cout. std::cout << "string value=" << o.stringValue() << '\n' << "int value=" << o.intValue() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/arg.cpp0000664000175000017500000000605713644433072012401 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include void print_int(const char* txt, int i) { std::cout << txt << ": " << i << std::endl; } void print_charp(const char* txt, const char* p) { std::cout << txt << ": " << (p ? p : "NULL") << std::endl; } void print_string(const char* txt, const std::string& s) { std::cout << txt << ": " << s << std::endl; } int main(int argc, char* argv[]) { try { cxxtools::Arg int_param(argc, argv, 'i'); cxxtools::Arg long_int_param(argc, argv, "--int"); cxxtools::Arg int_param_def(argc, argv, 'I', 5); print_int("option -i", int_param); print_int("option --int", long_int_param); print_int("option -I", int_param_def); cxxtools::Arg charp_param(argc, argv, 'p'); cxxtools::Arg long_charp_param(argc, argv, "--charp"); cxxtools::Arg charp_param_def(argc, argv, 'P', "hi"); print_charp("option -p", charp_param); print_charp("option --charp", long_charp_param); print_charp("option -P", charp_param_def); cxxtools::Arg string_param(argc, argv, 's'); cxxtools::Arg long_string_param(argc, argv, "--string"); cxxtools::Arg string_param_def(argc, argv, 'S', "hi"); cxxtools::Arg string_arg(argc, argv); print_string("option -s", string_param); print_string("option --string", long_string_param); print_string("option -S", string_param_def); print_string("string-Arg", string_arg); std::cout << "unprocessed arguments:\n"; for (int i = 1; i < argc; ++i) std::cout << '\t' << i << ": " << argv[i] << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } cxxtools-3.0/demo/timer.cpp0000664000175000017500000001262713644433072012750 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include log_define("timertest") void onInterval() { static unsigned count = 0; ++count; log_info("interval " << count); } void onIntervalFullSecond() { static unsigned count = 0; ++count; log_info("interval full second " << count); } void onIntervalFuture() { static unsigned count = 0; ++count; log_info("delayed start interval second " << count); } void onIntervalFutureFullSecond(cxxtools::DateTime ts) { static unsigned count = 0; ++count; log_info("future full second interval " << count << ' ' << ts.toString()); } void onIntervalPast(cxxtools::DateTime ts) { static unsigned count = 0; ++count; log_info("late start " << count << ' ' << ts.toString()); } void onIntervalPastUtc(cxxtools::DateTime ts) { static unsigned count = 0; ++count; log_info("utc " << ts.toString()); } void onOneShot() { log_info("one shot"); } int main(int argc, char* argv[]) { try { // the command line switch -d enables debug log for the selector cxxtools::Arg debug(argc, argv, 'd'); // with -l we may pass a own logging configuration // the configuration may be xml or properties format cxxtools::Arg logfile(argc, argv, 'l'); // initialize logging if (logfile.isSet()) { log_init(logfile); } else { // when no logfile is passed, we configure the logging without it cxxtools::LogConfiguration logConfiguration; logConfiguration.setRootLevel(cxxtools::Logger::LOG_LEVEL_INFO); logConfiguration.setLogLevel("cxxtools.timer", cxxtools::Logger::LOG_LEVEL_DEBUG); if (debug) logConfiguration.setLogLevel("cxxtools.selector.impl", cxxtools::Logger::LOG_LEVEL_DEBUG); log_init(logConfiguration); } // we need a event loop which controls the timers cxxtools::EventLoop loop; // timer to tick just once after 1500 ms cxxtools::Timer oneShotTimer(&loop); oneShotTimer.after(cxxtools::Milliseconds(1500)); cxxtools::connect(oneShotTimer.timeout, onOneShot); // timer tick once per second cxxtools::Timer intervalTimer(&loop); intervalTimer.start(cxxtools::Seconds(1)); cxxtools::connect(intervalTimer.timeout, onInterval); // timer tick once per second but start at full second cxxtools::Timer intervalFullSecondTimer(&loop); intervalFullSecondTimer.start(cxxtools::DateTime(1970, 1, 1, 0, 0, 0), cxxtools::Seconds(1)); cxxtools::connect(intervalFullSecondTimer.timeout, onIntervalFullSecond); // timer tick once per second but start after 5 seconds cxxtools::Timer intervalFutureTimer(&loop); intervalFutureTimer.start(cxxtools::Clock::getLocalTime() + cxxtools::Seconds(5), cxxtools::Seconds(1)); cxxtools::connect(intervalFutureTimer.timeout, onIntervalFuture); // timer tick once per second but start after 2 seconds at full second cxxtools::Timer intervalFutureFullSecondTimer(&loop); cxxtools::DateTime dt = cxxtools::Clock::getLocalTime() + cxxtools::Seconds(2); int year; unsigned month, day, hour, min, sec, msec; dt.get(year, month, day, hour, min, sec, msec); dt.set(year, month, day, hour, min, sec, 0); intervalFutureFullSecondTimer.start(dt, cxxtools::Seconds(1)); cxxtools::connect(intervalFutureFullSecondTimer.timeoutts, onIntervalFutureFullSecond); // timer, which was started in the past - it just starts ticking immediately cxxtools::Timer intervalPastTimer(&loop); intervalPastTimer.start(cxxtools::DateTime(1990, 1, 1, 8, 0, 0), cxxtools::Seconds(1)); cxxtools::connect(intervalPastTimer.timeoutts, onIntervalPast); cxxtools::connect(intervalPastTimer.timeoutUtc, onIntervalPastUtc); // now we start the event loop to execute the timers // this will loop forever and call the timer callback functions at suitable times log_info("start event loop"); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/rpcechoclient.cpp0000664000175000017500000000715613644433072014453 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg binary(argc, argv, 'b'); cxxtools::Arg json(argc, argv, 'j'); cxxtools::Arg jsonhttp(argc, argv, 'J'); cxxtools::Arg port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); cxxtools::Arg ssl(argc, argv, 's'); // optionally read -t or -T (in ms) cxxtools::Arg timeout(argc, argv, 't'); cxxtools::Arg connectTimeout(argc, argv, 'T'); // define a xmlrpc client cxxtools::xmlrpc::HttpClient xmlrpcClient(ip, port, "/xmlrpc", ssl); // and a binary rpc client cxxtools::bin::RpcClient binaryClient(ip, port, ssl); // and a json rpc client cxxtools::json::RpcClient jsonClient(ip, port, ssl); // and a json rpc http client cxxtools::json::HttpClient jsonHttpClient(ip, port, "/jsonrpc", ssl); cxxtools::RemoteClient& client = binary ? static_cast(binaryClient) : json ? static_cast(jsonClient) : jsonhttp ? static_cast(jsonHttpClient) : static_cast(xmlrpcClient); if (connectTimeout.isSet()) client.connectTimeout(connectTimeout); if (timeout.isSet()) client.timeout(timeout); // define remote procedure with std::string return value and a std::string parameter, // which uses one of the clients cxxtools::RemoteProcedure echo(client, "echo"); for (int a = 1; a < argc; ++a) { std::string v = echo(argv[a]); std::cout << v << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/pool.cpp0000664000175000017500000001103213644433072012566 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include log_define("pooldemo") // define a dummy dbconnection-object class Connection { std::string db; public: Connection() { log_info("create connection"); } explicit Connection(const std::string& db_) : db(db_) { log_info("create connection to \"" << db << '"'); } ~Connection() { log_info("destroy connection"); } void doSomething() { sleep(1); } }; // define a custom connector for passing the connection string class Connector { std::string db; public: explicit Connector(const std::string& db_) : db(db_) { } Connection* operator() () { return new Connection(db); } }; // define a connection-pool-type typedef cxxtools::Pool ConnectionPoolType; // define a thread, which fetches a connection from a pool // and does something class MyThread { cxxtools::AttachedThread thread; ConnectionPoolType& pool; unsigned threadNum; unsigned sec; public: explicit MyThread (ConnectionPoolType& pool_, unsigned threadNum_, unsigned sec_ = 1) : thread( cxxtools::callable(*this, &MyThread::run) ), pool(pool_), threadNum(threadNum_), sec(sec_) { } void create() { thread.start(); } void join() { thread.join(); } void run() { log_info("start thread " << threadNum); sleep(sec); // We fetch a object from the pool, and call a method pool.get() does // not return a connection, but a proxy object, so we have to take // care not to assign the object to a Connection, but use that proxy // directy. // // This would be wrong: // Connection conn = *pool.get(); // convert the proxy-object // conn.doSomething(threadNum); // the connection is back in the pool here :-( // // The reason is, that the proxy object is destroyed too early. // The proxy object puts the connection back to the free-list of the // pool, before we use the connection. // log_info("doSomething in thread " << threadNum); pool.get()->doSomething(); log_info("doSomething ends in thread " << threadNum); log_info("thread ready " << threadNum); } }; int main(int argc, char* argv[]) { try { log_init(); ConnectionPoolType connectionPool(3, Connector("mydb")); MyThread th1(connectionPool, 1, 2); MyThread th2(connectionPool, 2); MyThread th3(connectionPool, 3, 3); MyThread th4(connectionPool, 4, 3); MyThread th5(connectionPool, 5, 4); th1.create(); th2.create(); th3.create(); th4.create(); th5.create(); log_info("threads created"); th1.join(); // Thread 1 is ready and the connection is put back into the pool. // We release all free connections here. At least one connection // from thread 1 is released. log_info("pool drop"); connectionPool.drop(); th2.join(); th4.join(); th3.join(); th5.join(); log_info("threads joined"); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/insrv.cpp0000664000175000017500000001443213644433072012765 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This is a tcp server, which demonstrate non blocking I/O on stdin. * * The class cxxtools::Cin is a cxxtools::IStream, which is a std::istream * with non blocking I/O. * The server accepts connections on a port (default is 1234, can be changed * with the command line optin -p). It reads from stdin and sends everything * to all connected clients. * * To try it out, start the server in one terminal and execute e.g. netcat, * which is often installed, on one or more other terminals using * `nc localhost 1234`. Everything you enter now on the keyboard to `insrv` * is echoed to the nc processes. * */ #include #include #include #include #include #include #include #include log_define("insrv") class Insrv : public cxxtools::Application { cxxtools::Cin in; cxxtools::net::TcpServer srv; typedef std::vector Clients; Clients _clients; void onInput(cxxtools::IStream& s); void onOutput(cxxtools::net::TcpStream& s); void onConnect(cxxtools::net::TcpServer& srv); void onClosed(cxxtools::net::TcpStream& s); public: Insrv(int& argc, char* argv[]); ~Insrv(); }; Insrv::Insrv(int& argc, char* argv[]) : cxxtools::Application(argc, argv) { cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 1234); // Attach our stdin device to the event loop of the application // and inform that we want to read from there. in.setSelector(loop()); in.beginRead(); cxxtools::connect(in.inputReady, *this, &Insrv::onInput); // Initialize our tcp server class. srv.listen(ip, port); srv.setSelector(loop()); cxxtools::connect(srv.connectionPending, *this, &Insrv::onConnect); } Insrv::~Insrv() { for (Clients::iterator it = _clients.begin(); it != _clients.end(); ++it) delete *it; } void Insrv::onInput(cxxtools::IStream& s) { try { // Finalize reading, which was started with beginRead. // This does the actual read and fills the input buffer. s.endRead(); } catch (const std::exception& e) { log_info("read failed with error: " << e.what()); loop().exit(); return; } log_debug("onInput; in_avail=" << s.in_avail()); if (!s.good()) { log_debug("exit loop"); loop().exit(); return; } char buffer[8192]; while (s.in_avail()) { unsigned count = s.readsome(buffer, sizeof(buffer)); // For each client we put the data to the output buffer and initiate writing. for (Clients::iterator it = _clients.begin(); it != _clients.end(); ++it) { log_debug("write " << count << " bytes to client " << static_cast(*it)); (*it)->write(buffer, count); (*it)->beginWrite(); } } log_debug("read"); s.beginRead(); } void Insrv::onOutput(cxxtools::net::TcpStream& s) { try { // This signals that the client is ready to receive data without blocking. // We finish the write operation and if there is more to send, we initiate // the next write operation, so that we are signalled, when the device // is ready to receive more data. log_trace("endWrite " << static_cast(&s)); s.endWrite(); if (s.out_avail() > 0) { log_debug("beginWrite " << static_cast(&s)); s.beginWrite(); } } catch (const std::exception& e) { onClosed(s); } } void Insrv::onClosed(cxxtools::net::TcpStream& s) { log_debug("client disconnected " << static_cast(&s)); for (Clients::iterator it = _clients.begin(); it != _clients.end(); ++it) { if ((*it) == &s) { log_debug("remove client " << static_cast(*it)); delete *it; _clients.erase(it); break; } } } void Insrv::onConnect(cxxtools::net::TcpServer& srv) { // A new client is detected. We create a new client class // and connect the needed signals. // Close is either signaled with a exception when a I/O operation is // finished using `endRead` or `endWrite` or if a close is detected in the // event loop while no I/O operation is pending the signal `closed` is // sent. cxxtools::net::TcpStream* cli = new cxxtools::net::TcpStream(srv); log_debug("new client connected " << static_cast(cli)); _clients.push_back(cli); cli->setSelector(loop()); cxxtools::connect(cli->outputReady, *this, &Insrv::onOutput); cxxtools::connect(cli->closed, *this, &Insrv::onClosed); } int main(int argc, char* argv[]) { try { log_init(); Insrv app(argc, argv); app.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/msgserver.cpp0000664000175000017500000000431213644433072013635 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include "msg.h" int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7010); // Instantiate a listener socket cxxtools::net::TcpServer srv(ip, port); // Instantiate a network iostream and accept a incoming connection. // This will block until a connection arrives. cxxtools::net::TcpStream out(srv); // We write 2 messages using binary serialization to the socket. out << cxxtools::bin::Bin(Msg(42, "Hi")) << cxxtools::bin::Bin(Msg(43, "There")) << std::flush; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/rpcasyncaddclient.cpp0000664000175000017500000001245713644433072015323 00000000000000/* * Copyright (C) 2011,2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This demo program shows how to run multiple remote rpc calls asncronously so that they run in parallel. */ #include #include #include #include #include #include #include #include #include int main(int argc, char* argv[]) { try { // initialize logging - this reads the file log.xml from the current directory log_init(); // read the command line options cxxtools::Arg ip(argc, argv, 'i'); // option -i defines the address where to find the server cxxtools::Arg binary(argc, argv, 'b'); cxxtools::Arg json(argc, argv, 'j'); cxxtools::Arg jsonhttp(argc, argv, 'J'); cxxtools::Arg timeout(argc, argv, 't', cxxtools::RemoteClient::WaitInfinite); cxxtools::Arg port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); // we need a selector, which controls the network activity cxxtools::Selector selector; // Normally we would define just one rpc client for the protocol we use but // here we want to demonstrate, that it is just up to the client, which protocol // is used for the remote call. // One client can run just one request at a time. To run parallel requests // we need 2 clients. So we define 2 clients for each protocol. // define a xlmrpc client cxxtools::xmlrpc::HttpClient xmlrpcClient1(selector, ip, port, "/xmlrpc"); cxxtools::xmlrpc::HttpClient xmlrpcClient2(selector, ip, port, "/xmlrpc"); // and a binary rpc client cxxtools::bin::RpcClient binaryClient1(selector, ip, port); cxxtools::bin::RpcClient binaryClient2(selector, ip, port); // and a tcp json rpc client cxxtools::json::RpcClient jsonClient1(selector, ip, port); cxxtools::json::RpcClient jsonClient2(selector, ip, port); // and a http json rpc client cxxtools::json::HttpClient httpJsonClient1(selector, ip, port, "/jsonrpc"); cxxtools::json::HttpClient httpJsonClient2(selector, ip, port, "/jsonrpc"); // now se select the client depending on the command line flags cxxtools::RemoteClient& client1( binary ? static_cast(binaryClient1) : json ? static_cast(jsonClient1) : jsonhttp ? static_cast(httpJsonClient1) : static_cast(xmlrpcClient1)); cxxtools::RemoteClient& client2( binary ? static_cast(binaryClient2) : json ? static_cast(jsonClient2) : jsonhttp ? static_cast(httpJsonClient2) : static_cast(xmlrpcClient2)); // define remote procedure with dobule return value and two double parameters cxxtools::RemoteProcedure add1(client1, "add"); cxxtools::RemoteProcedure add2(client2, "add"); // initiate the execution of our method add1.begin(5, 6); add2.begin(1, 2); // Calling RemoteProcedure::end will run the underlying event loop until // the remote procedure is finished and return the result. // In case of a error, an exception is thrown. // Note that waiting for the end of one remote procedure will also start // and maybe finish the second remote procedure. double result1 = add1.end(timeout); std::cout << "result1=" << result1 << std::endl; // Here we run the loop again until the second procedure is finished. It // may well be, that the procedure is already finished and we get the // result immediately. double result2 = add2.end(timeout); std::cout << "result2=" << result2 << std::endl; } catch (const std::exception& e) { std::cerr << "error: " << e.what() << std::endl; } } cxxtools-3.0/demo/httprequest.cpp0000664000175000017500000001033013644433072014205 00000000000000/* * Copyright (C) 2003,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include class AsyncRequester : public cxxtools::Connectable { cxxtools::http::Client& _client; char** _argv; unsigned _wait; cxxtools::http::Request _request; cxxtools::EventLoop _loop; cxxtools::Timer _timer; std::size_t onBodyAvailable(cxxtools::http::Client& client); void onReady(cxxtools::http::Client& client); void onTimeout(); public: AsyncRequester(cxxtools::http::Client& client, char** argv, unsigned wait) : _client(client), _argv(argv), _wait(wait) { connect(_client.bodyAvailable, *this, &AsyncRequester::onBodyAvailable); connect(_client.replyFinished, *this, &AsyncRequester::onReady); connect(_timer.timeout, *this, &AsyncRequester::onTimeout); _client.setSelector(_loop); _loop.add(_timer); } void run() { if (*_argv) { _request.url(*_argv++); _client.beginExecute(_request); _loop.run(); } } }; std::size_t AsyncRequester::onBodyAvailable(cxxtools::http::Client& client) { char buffer[8192]; std::streamsize n = client.in().readsome(buffer, sizeof(buffer)); std::cout.write(buffer, n); return n; } void AsyncRequester::onReady(cxxtools::http::Client& client) { if (*_argv) { if (_wait) _timer.start(_wait); else { _request.url(*_argv++); client.beginExecute(_request); } } else { _loop.exit(); } } void AsyncRequester::onTimeout() { _timer.stop(); _request.url(*_argv++); _client.beginExecute(_request); } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg user(argc, argv, 'u'); // passed as "username:password" cxxtools::Arg server(argc, argv, 's'); cxxtools::Arg port(argc, argv, 'p', 80); cxxtools::Arg async(argc, argv, 'a'); cxxtools::Arg wait(argc, argv, 'w'); // wait between requests in seconds cxxtools::http::Client client(server, port); if (user.isSet()) { std::string::size_type p = user.getValue().find(':'); if (p != std::string::npos) { client.auth(user.getValue().substr(0, p), user.getValue().substr(p + 1)); } else { client.auth(user, std::string()); } } if (async) { AsyncRequester ar(client, argv + 1, wait * 1000); ar.run(); } else { for (int a = 1; a < argc; ++a) { if (wait > 0 && a > 1) cxxtools::Thread::sleep(wait * 1000); std::cout << client.get(argv[a]).body(); } } } catch (const std::exception& e) { std::cerr << "ERROR: " << e.what() << std::endl; } } cxxtools-3.0/demo/dlloader.cpp0000664000175000017500000000455713644433072013421 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include typedef double (*function_type)(double); // to run the program you may have to set LTDL_LIBRARY_PATH // to the path of libm.so int main(int argc, char* argv[]) { try { log_init(); if (argc == 1) { std::cout << "load libm.so" << std::endl; cxxtools::dl::Library lib("m"); std::cout << "sym cos" << std::endl; function_type cosine = (function_type)(lib["cos"]); std::cout << "call cos" << std::endl; std::cout << "cos(2.0) = " << cosine(2.0) << std::endl; } else { std::cout << "load " << argv[1] << std::endl; cxxtools::dl::Library lib(argv[1]); for (int a = 2; argv[a]; ++a) { std::cout << "sym " << argv[a] << std::endl; cxxtools::dl::Symbol sym = lib.getSymbol(argv[a]); std::cout << " => " << static_cast(sym) << std::endl; } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/hd.cpp0000664000175000017500000000422313644433072012214 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "cxxtools/hexdump.h" int main(int argc, char* argv[]) { // iterate over arguments for (int a = 1; a < argc; ++a) { // the arguments are file names which are processed std::ifstream in(argv[a]); if (!in) { std::cerr << "failed to open file \"" << argv[a] << '"' << std::endl; continue; } std::cout << "file: " << argv[a] << '\n'; // copy file content as hex dump to std::out // using explicit cxxtools::Hdostream: // cxxtools::Hdostream hd(std::cout); // hd << in.rdbuf() << std::flush; // or using 2 iterators: std::cout << cxxtools::hexDump(std::istreambuf_iterator(in), std::istreambuf_iterator()); } } cxxtools-3.0/demo/async/0000775000175000017500000000000013672344761012320 500000000000000cxxtools-3.0/demo/async/Makefile.in0000664000175000017500000004460713644433103014304 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = server$(EXEEXT) subdir = demo/async ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_server_OBJECTS = server.$(OBJEXT) server_OBJECTS = $(am_server_OBJECTS) server_DEPENDENCIES = $(top_builddir)/src/libcxxtools.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_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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/server.Po am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(server_SOURCES) DIST_SOURCES = $(server_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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ server_SOURCES = \ server.cpp server_LDADD = $(top_builddir)/src/libcxxtools.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu demo/async/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu demo/async/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list server$(EXEEXT): $(server_OBJECTS) $(server_DEPENDENCIES) $(EXTRA_server_DEPENDENCIES) @rm -f server$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(server_OBJECTS) $(server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/server.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/server.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles 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 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/demo/async/Makefile.am0000664000175000017500000000030413644433072014262 00000000000000noinst_PROGRAMS = \ server server_SOURCES = \ server.cpp server_LDADD = $(top_builddir)/src/libcxxtools.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include cxxtools-3.0/demo/async/server.cpp0000664000175000017500000001244513644433072014251 00000000000000#include #include #include #include #include #include #include #include log_define("server") class Responder; //////////////////////////////////////////////////////////////////////// // Define a server class // class Server : public cxxtools::Connectable { cxxtools::net::TcpServer _server; std::vector _responder; void onNewConnection(cxxtools::net::TcpServer&); void onClosed(cxxtools::net::TcpStream&); public: explicit Server(cxxtools::SelectorBase* selector, const std::string& ip, unsigned short port); }; Server::Server(cxxtools::SelectorBase* selector, const std::string& ip, unsigned short port) : _server(ip, port) { _server.setSelector(selector); // When a connection arrives from a client the signal 'connectionPending' is emmitted. // We connect that to our handler. cxxtools::connect(_server.connectionPending, *this, &Server::onNewConnection); } //////////////////////////////////////////////////////////////////////// // The Responder class handles a single client. // class Responder : public cxxtools::net::TcpStream { void onInput(cxxtools::net::TcpStream&); void onOutput(cxxtools::net::TcpStream&); public: explicit Responder(cxxtools::net::TcpServer& server); }; //////////////////////////////////////////////////////////////////////// void Server::onNewConnection(cxxtools::net::TcpServer&) { // When a new connection arrives create a new client responder. log_debug("new connection"); Responder* responder = new Responder(_server); _responder.push_back(responder); // When the client closes the connection the signal 'closed' is emmitted. // Connect that to our handler onClosed. cxxtools::connect(responder->closed, *this, &Server::onClosed); } void Server::onClosed(cxxtools::net::TcpStream& responder) { // When a client is closed we delete the Responder std::vector::iterator it = std::find(_responder.begin(), _responder.end(), &responder); if (it != _responder.end()) // should always be true { log_debug("closed"); _responder.erase(it); delete *it; } else { log_warn("responder not found"); } } //////////////////////////////////////////////////////////////////////// Responder::Responder(cxxtools::net::TcpServer& server) : cxxtools::net::TcpStream(server) { setSelector(server.selector()); // connect the signals 'inputReady' and 'outputReady' to our handlers. cxxtools::connect(inputReady, *this, &Responder::onInput); cxxtools::connect(outputReady, *this, &Responder::onOutput); // Start waiting for input. When data arrives, the signal 'inputReady' is // emmitted. beginRead(); } void Responder::onInput(cxxtools::net::TcpStream&) { log_debug("onInput"); // Data has arrived. End read reads data from the socket and fills our // input buffer. endRead(); if (in_avail() == 0) { // When 'inputReady' is emmitted without data the client has actually // closed the connection. We emmit the signal 'closed'. closed(*this); return; } // echo input back to the client char ch; while (get(ch), *this) { // Put the character to the output buffer put(ch); } // We wrote at least one character to the output buffer. // We signal, that we want to send the data as soon as the socket is // ready to accept outgoing data without blocking. beginWrite(); // We called endRead. Now we want to continue reading and put the device // back into read mode. beginRead(); } void Responder::onOutput(cxxtools::net::TcpStream&) { log_debug("out avail=" << buffer().out_avail()); // The device has signaled, that it is ready to accept data to be sent. // The call to endWrite copies data from our output buffer to the socket. endWrite(); // The socket may have accepted only part of our output buffer so there // may be data left. We tell the device, that we want to transfer more // data when there is space in the output buffer. if (buffer().out_avail()) beginWrite(); } //////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { try { // read options from command line // -l specifies the ip address of the interface to listen on // a empty string tells cxxtools to listen on all interfaces. // -p specifies to port with a default value of 7000. cxxtools::Arg ip(argc, argv, 'l'); cxxtools::Arg port(argc, argv, 'p', 7000); // This initializes logging by reading a file 'log.xml' or // 'log.properties' in the local directory. Optionally a file name or a // object of type cxxtools::LogConfiguration could be passed to // log_init(). log_init(); // We need a event loop, which handles I/O events cxxtools::EventLoop loop; // Our server runs in the loop. Server server(&loop, ip, port); // Run the loop loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/iconv.cpp0000664000175000017500000000542613644433072012745 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include /** * synopsis: * iconv -f UTF8 -t LATIN1 -i file * prints UTF8-file to std::cout as LATIN1 * * iconf -f LATIN1 -t ISO8859-1 'some text' * prints 'some text' in ISO8859-1 to std::cout * (bad example - same as , because * conversion does not change anything, but it is difficult to * show a better one) * * iconv from(argc, argv, 'f', "UTF8"); cxxtools::Arg to(argc, argv, 't', "LATIN1"); cxxtools::Arg infile(argc, argv, 'i'); // inputfile if (infile.isSet()) { // read from file std::ifstream in(infile); cxxtools::iconvstream ic(std::cout, to, from); ic << in.rdbuf(); } if (argc > 1) { // convert arguments to cout cxxtools::IConverter ic(to.getValue(), from.getValue()); for (int a = 1; a < argc; ++a) std::cout << ic.convert(argv[a]); } if (!infile.isSet() && argc <= 1) { // filter cin to cout cxxtools::iconvstream ic(std::cout, to, from); ic << std::cin.rdbuf(); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } cxxtools-3.0/demo/README0000664000175000017500000001261313644433072011777 00000000000000This directory contains some demonstrations for cxxtools. The examples are as minimal as possible to demonstrate simple usage-patterns. arg === Demonstration of template `cxxtools::Arg`. dir === Print contents of a directory. Try `./dir .`. dlloader ======== Load shared library and call a function. Useful to create plugins in your applications. getini ====== Read value from ini-file. Try `./getini test.ini sec1 value` hdstream ======== Just a little hexdumper. To print a hexdump of a file use `./hexdump filename` log === Demonstration of cxxtools-logging-library. It uses a configurationfile log.xml or log.properties to determine the amount of logging. A sample configuration file log.xml can be created with the command `cxxtools-config --logxml cxxtools >log.xml`. md5sum ====== Calculate md5sum of files. Try `./md5sum file1 file2` multifstream ============ Concatenate multipe files to stdout. Try `./multiifstream file1 file2`. netcat/netecho ============== Demonstration of a simple network-server and -client. Netcat listens to a port (default 1234) and prints all input to stdout. Netecho connects to netcat and copies stdin to netcat. To try out enter `./netcat` in one terminal and then `./netcat #include #include #include #include #include const unsigned BUFSIZE = 65536; //////////////////////////////////////////////////////////////////////// // Server // int server(int argc, char* argv[]) { cxxtools::Arg port(argc, argv, 'p', 1234); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg verbose(argc, argv, 'v'); cxxtools::net::TcpServer server(ip.getValue(), port); while (1) { cxxtools::net::TcpSocket worker(server); std::cout << "connection accepted" << std::endl; char buffer[BUFSIZE]; // NOTE: use std::streamsize, not TcpSocket::size_type std::streamsize count = 0; std::streamsize n = 0; while ( (n = worker.read(buffer, BUFSIZE)) > 0) { count += n; if (verbose) std::cout << '.' << std::flush; } if (verbose) std::cout << std::endl << (count / 1024) << " Kbytes received" << std::endl; std::cout << "test ready " << (count / 1024) << " Kbytes received" << std::endl; } return 0; } //////////////////////////////////////////////////////////////////////// // Client // void run_test(cxxtools::net::TcpSocket& conn, unsigned bs, const char* buffer, unsigned secs) { std::cout << "bs " << bs << std::flush; timeval start; gettimeofday(&start, 0); timeval end = start; end.tv_sec += secs; timeval current; // NOTE: use std::streamsize, not TcpSocket::size_type std::streamsize count = 0; while (1) { gettimeofday(¤t, 0); if (current.tv_sec > end.tv_sec || (current.tv_sec == end.tv_sec && current.tv_usec >= end.tv_usec)) break; count += conn.write(buffer, bs); } double dstart = start.tv_sec + start.tv_usec / 1e6; double dend = current.tv_sec + current.tv_usec / 1e6; double dur = dend - dstart; double bps = count / dur; std::cout << " kBps=" << static_cast(bps / 1024) << std::endl; } int client(int argc, char* argv[]) { cxxtools::Arg port(argc, argv, 'p', 1234); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg secs(argc, argv, 't', 1); cxxtools::Arg bufsize(argc, argv, 't', BUFSIZE); cxxtools::Arg B(argc, argv, 'B', 0); cxxtools::net::TcpSocket conn(ip.getValue(), port); std::vector buffer(bufsize); std::generate(&buffer[0], &buffer[bufsize], rand); std::cout << "test" << std::endl; if (B.isSet()) run_test(conn, B, &buffer[0], secs); else { for (unsigned bs=256; bs <= bufsize.getValue(); bs <<= 1) run_test(conn, bs, &buffer[0], secs); } return 0; } //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg isServer(argc, argv, 's'); if (isServer) return server(argc, argv); else return client(argc, argv); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/dir.cpp0000664000175000017500000000533213644433072012401 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include int main(int argc, char* argv[]) { try { cxxtools::Arg longdir(argc, argv, 'l'); cxxtools::Arg showHidden(argc, argv, 'h'); for (int a = 1; a < argc; ++a) { std::cout << "directory content of \"" << argv[a] << "\":\n"; cxxtools::Directory d(argv[a]); for (cxxtools::Directory::const_iterator it = d.begin(!showHidden); it != d.end(); ++it) { if (longdir) { cxxtools::FileInfo fi(it); switch (fi.type()) { case cxxtools::FileInfo::Directory: std::cout << 'D'; break; case cxxtools::FileInfo::File: std::cout << '-'; break; case cxxtools::FileInfo::Chardev: std::cout << 'C'; break; case cxxtools::FileInfo::Blockdev: std::cout << 'B'; break; case cxxtools::FileInfo::Fifo: std::cout << 'F'; break; case cxxtools::FileInfo::Symlink: std::cout << 'S'; break; default: std::cout << '?'; break; } std::cout << '\t' << fi.size() << '\t' << fi.name() << '\n'; } else { std::cout << *it << '\n'; } } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/commandoutput.cpp0000664000175000017500000000362413644433072014524 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include // example for starting a sub process and reading its output through a stream // int main(int argc, char* argv[]) { try { // create a class of type CommandOutput cxxtools::posix::CommandOutput ls("ls"); // add some parameters ls.push_back("-l"); ls.push_back("/bin"); // run the process ls.run(); // read the output of the process (copy it to std::cout here) std::cout << ls.rdbuf(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/mime2json.cpp0000664000175000017500000000464013644433072013527 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This program converts a mime object to json using cxxtools. A file name can be passed as parameter. The file is read and printed in json format to stdout. When no parameter is passed, the program reads the message from stdin. Mails are mime messages, which can be read with this program. */ #include #include #include #include #include #include int main(int argc, char* argv[]) { try { // initialize logging - reads log.xml or log.properties log_init(); // read file to a stringstream std::ostringstream m; if (argc > 1) { std::ifstream in(argv[1]); m << in.rdbuf(); } else { m << std::cin.rdbuf(); } // parse the file cxxtools::MimeEntity mo(m.str()); // print as json using serialization framework std::cout << cxxtools::Json(mo).beautify(true); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/sslshowcert.cpp0000664000175000017500000000374513644433072014211 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include int main(int argc, char* argv[]) { try { log_init(); for (int a = 1; a < argc; ++a) { cxxtools::SslCertificate cert(argv[a]); std::cout << "subject: " << cert.getSubject() << "\n" "serial: " << cert.getSerial() << "\n" "valid: " << cert.getNotBefore().toString() << " - " << cert.getNotAfter().toString() << std::endl; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/future.cpp0000664000175000017500000000670013644433072013135 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include unsigned count = 0; log_define("future") // this simulates a long running task void funct() { log_info("wait"); cxxtools::Thread::sleep(500); log_info("Hello " << ++count); } class AObject { cxxtools::Timespan _waitTime; public: AObject(cxxtools::Seconds waitTime) : _waitTime(waitTime) { } void aMethod(); }; void AObject::aMethod() { log_info("wait " << cxxtools::Seconds(_waitTime) << " in a method"); cxxtools::Thread::sleep(_waitTime); log_info("Hello " << ++count); } // Just a simple task void finish() { log_info("finish task"); } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg threads(argc, argv, 't', 5); cxxtools::Arg tasks(argc, argv, 'n', 17); // We create a thread pool with 5 threads by default cxxtools::ThreadPool p(threads); // Run the above function multiple times log_info("start tasks"); for (unsigned n = 0; n < tasks; ++n) p.schedule(cxxtools::callable(funct)); // Run the a method of a object instance multiple times AObject aObject(cxxtools::Milliseconds(400)); for (unsigned n = 0; n < tasks; ++n) p.schedule(cxxtools::callable(aObject, &AObject::aMethod)); // Run another job log_info("start finish task"); cxxtools::ThreadPool::Future f = p.schedule(cxxtools::callable(finish)); // We wait until the finish task is finished. // This does not mean, that all tasks are finished. // Others will continue to run on other threads. // We can also wait with just `f.wait()` without timeout. log_info("wait for finish task"); bool b; do { b = f.wait(cxxtools::Milliseconds(300)); log_info("future returns " << b); } while (b == false); log_info("finish task finished"); // This stops the threads when all jobs are done. p.stop(); log_info("tasks finished"); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/json.cpp0000664000175000017500000001767013644433072012604 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include struct ProcStat { ProcStat() : user(0), nice(0), system(0), idle(0), iowait(0), irq(0), softirq(0) { } std::string cpu; unsigned user; unsigned nice; unsigned system; unsigned idle; unsigned iowait; unsigned irq; unsigned softirq; }; std::istream& operator>> (std::istream& in, ProcStat& p) { in >> p.cpu >> p.user >> p.nice >> p.system >> p.idle >> p.iowait >> p.irq >> p.softirq; return in; } std::ostream& operator<< (std::ostream& out, ProcStat& p) { out << p.cpu << ' ' << p.user << ' ' << p.nice << ' ' << p.system << ' ' << p.idle << ' ' << p.iowait << ' ' << p.irq << ' ' << p.softirq; return out; } void operator<<= (cxxtools::SerializationInfo& si, const ProcStat& p) { si.addMember("cpu") <<= p.cpu; si.addMember("user") <<= p.user; si.addMember("nice") <<= p.nice; si.addMember("system") <<= p.system; si.addMember("idle") <<= p.idle; si.addMember("iowait") <<= p.iowait; si.addMember("irq") <<= p.irq; si.addMember("softirq") <<= p.softirq; } ProcStat operator- (const ProcStat& p1, const ProcStat& p2) { ProcStat p; p.cpu = p1.cpu; p.user = p1.user - p2.user; p.nice = p1.nice - p2.nice; p.system = p1.system - p2.system; p.idle = p1.idle - p2.idle; p.iowait = p1.iowait - p2.iowait; p.irq = p1.irq - p2.irq; p.softirq = p1.softirq - p2.softirq; return p; } ProcStat currentStat; cxxtools::Mutex statMutex; void statThread() { ProcStat p0; { std::ifstream f("/proc/stat"); f >> p0; } while (true) { cxxtools::Thread::sleep(1000); std::ifstream f("/proc/stat"); ProcStat p1; f >> p1; cxxtools::MutexLock lock(statMutex); currentStat = p1 - p0; p0 = p1; } } class MainResponder : public cxxtools::http::Responder { public: explicit MainResponder(cxxtools::http::Service& service) : cxxtools::http::Responder(service) { } virtual void reply(std::ostream&, cxxtools::http::Request& request, cxxtools::http::Reply& reply); }; void MainResponder::reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) { reply.addHeader("Content-Type", "text/html"); out << "\n" "\n" " \n" " \n" " \n" "\n" " \n" "\n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "
cpu
user
nice
system
idle
iowait
irq
softirq
\n" "\n" " \n" "\n"; } class StatResponder : public cxxtools::http::Responder { public: explicit StatResponder(cxxtools::http::Service& service) : cxxtools::http::Responder(service) { } virtual void reply(std::ostream&, cxxtools::http::Request& request, cxxtools::http::Reply& reply); }; void StatResponder::reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) { cxxtools::MutexLock lock(statMutex); reply.addHeader("Content-Type", "application/json"); out << cxxtools::Json(currentStat); } typedef cxxtools::http::CachedService StatService; typedef cxxtools::http::CachedService MainService; int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg listenIp(argc, argv, 'l'); cxxtools::Arg listenPort(argc, argv, 'p', 8001); cxxtools::EventLoop loop; cxxtools::http::Server server(loop, listenIp, listenPort); MainService mainService; StatService statService; server.addService("/", mainService); server.addService("/stat", statService); std::cout << "http server running on port " << listenPort.getValue() << std::endl; cxxtools::AttachedThread thread(cxxtools::callable(statThread)); thread.start(); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/md5sum.cpp0000664000175000017500000000326513644433072013040 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include int main(int argc, char* argv[]) { cxxtools::Md5stream s; for (int i = 1; i < argc; ++i) { std::ifstream in(argv[i]); if (in) { // copy file to md5stream: s << in.rdbuf(); std::cout << s.getHexDigest() << " " << argv[i] << std::endl; } } } cxxtools-3.0/demo/getini.cpp0000664000175000017500000000642113644433072013102 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include int main(int argc, char* argv[]) { log_init(); try { cxxtools::Arg quiet(argc, argv, 'q'); if (argc <= 1) { std::cerr << "usage: " << argv[0] << " inifile [-q] [section [key [default]]]" << std::endl; return -1; } const char* fname = argv[1]; std::ifstream in(fname); if (!in) throw std::runtime_error(std::string("error reading input file \"") + fname + '"'); cxxtools::IniFile ini(in); if (argc <= 2) { // list sections if (!quiet) std::cout << "sections in " << fname << ": "; ini.getSections(std::ostream_iterator(std::cout, "\t")); /* * other alternatives to get names of sections: std::vector sections; ini.getSections(std::back_inserter(sections)); std::vector ssections; ini.getSections(std::back_inserter(ssections)); ini.getSections(std::ostream_iterator(std::cout, "\t")); */ std::cout << std::endl; return 0; } const char* section = argv[2]; if (argc <= 3) { // list keys if (!quiet) std::cout << "keys in " << fname << " [" << section << "]: "; ini.getKeys(cxxtools::String(section), std::ostream_iterator(std::cout, "\t")); std::cout << std::endl; return 0; } const char* key = argv[3]; const char* defvalue = argv[4] ? argv[4] : ""; if (!quiet) std::cout << "value of " << fname << " [" << section << "]." << key << ": "; std::cout << ini.getValue(cxxtools::String(section), cxxtools::String(key), cxxtools::String(defvalue)) << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/xmlmsgserver.cpp0000664000175000017500000000425713644433072014366 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include "msg.h" int main(int argc, char* argv[]) { try { cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7010); // Instantiate a listener socket cxxtools::net::TcpServer srv(ip, port); // Instantiate a network iostream and accept a incoming connection. // This will block until a connection arrives. cxxtools::net::TcpStream out(srv); // We write 2 messages using xmlary serialization to the socket. out << cxxtools::xml::Xml(Msg(42, "Hi"), "root") << cxxtools::xml::Xml(Msg(43, "There"), "root") << std::flush; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/httpserver.cpp0000664000175000017500000000771113644433072014034 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include log_define("cxxtools.demo.httpserver") // HelloResponder // class HelloResponder : public cxxtools::http::Responder { public: explicit HelloResponder(cxxtools::http::Service& service) : cxxtools::http::Responder(service) { } virtual void reply(std::ostream&, cxxtools::http::Request& request, cxxtools::http::Reply& reply); }; void HelloResponder::reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) { log_debug("send hello"); reply.addHeader("Content-Type", "text/html"); out << "\n" " \n" " Hello World-application\n" " \n" " \n" "

Hello World

\n" " \n" "\n"; } // HelloService // typedef cxxtools::http::CachedService HelloService; // implement authenticator // class MyAuthenticator : public cxxtools::http::Authenticator { public: virtual bool checkAuth(const cxxtools::http::Request&) const; }; bool MyAuthenticator::checkAuth(const cxxtools::http::Request& request) const { cxxtools::http::Request::Auth auth = request.auth(); if (auth.user != "cxxtools" || auth.password != "mypassword") return false; return true; } // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg listenIp(argc, argv, 'l'); cxxtools::Arg listenPort(argc, argv, 'p', 8001); cxxtools::Arg auth(argc, argv, 'a'); cxxtools::EventLoop loop; cxxtools::http::Server server(loop, listenIp, listenPort); cxxtools::Arg minThreads(argc, argv, 't', server.minThreads()); cxxtools::Arg maxThreads(argc, argv, 'T', server.maxThreads()); server.minThreads(minThreads); server.maxThreads(maxThreads); // collect additional ports to listen on while (true) { cxxtools::Arg listenPort(argc, argv, 'p'); if (!listenPort.isSet()) break; server.listen(listenIp, listenPort); } HelloService service; MyAuthenticator authenticator; if (auth) service.addAuthenticator(&authenticator); server.addService(cxxtools::Regex("ll"), service); //server.addService("/hello", service); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/rpcaddclient.cpp0000664000175000017500000000671413644433072014264 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg binary(argc, argv, 'b'); cxxtools::Arg json(argc, argv, 'j'); cxxtools::Arg jsonhttp(argc, argv, 'J'); cxxtools::Arg port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); // Normally we would define just one rpc client for the protocol we use but // here we want to demonstrate, that it is just up to the client, which protocol // is used for the remote call. // define a xlmrpc client cxxtools::xmlrpc::HttpClient xmlrpcClient(ip, port, "/xmlrpc"); // and a binary rpc client cxxtools::bin::RpcClient binaryClient(ip, port); // and a tcp json rpc client cxxtools::json::RpcClient jsonClient(ip, port); // and a http json rpc client cxxtools::json::HttpClient httpJsonClient(ip, port, "/jsonrpc"); // now se welect the client depending on the command line flags cxxtools::RemoteClient& theClient = binary ? static_cast(binaryClient) : json ? static_cast(jsonClient) : jsonhttp ? static_cast(httpJsonClient) : static_cast(xmlrpcClient); // define remote procedure with dobule return value and a double and a std::string parameter: // Note: We send the second parameter as a string since it is converted by the server anyway. cxxtools::RemoteProcedure add(theClient, "add"); double sum = 0; for (int a = 1; a < argc; ++a) sum = add(sum, argv[a]); std::cout << "sum=" << sum << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/log.cpp0000664000175000017500000000475313644433072012412 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include log_define("global") // global definition namespace ns { log_define("namespace") // namespace scope definition void main1() { // this is logged at category "namespace" log_trace("main"); log_fatal("fatal message in namespace ns"); log_error("error message in namespace ns"); log_warn("warn message in namespace ns"); log_info("info message in namespace ns"); log_debug("debug message in namespace ns"); } } class cl { log_define("class.cl") // class-scope definition public: cl() { log_debug("constructor here"); // this is logged at category "class.cl" } ~cl() { log_debug("destructor here"); } }; int main(int argc, char* argv[]) { try { log_init(); // this is logged at category "global" log_fatal("fatal message " << 1); log_error("error message " << 2); log_warn("warn message " << 3); log_info("info message " << 4); log_debug("debug message " << 5); ns::main1(); cl c; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return -1; } } cxxtools-3.0/demo/deserialization.cpp0000664000175000017500000000565313644433072015017 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include class Object { friend void operator>>= (const cxxtools::SerializationInfo& si, Object& object); std::string _stringValue; int _intValue; public: Object() : _intValue(0) { } Object(const std::string& stringValue, int intValue) : _stringValue(stringValue), _intValue(intValue) { } const std::string& stringValue() const { return _stringValue; } int intValue() const { return _intValue; } }; void operator<<= (cxxtools::SerializationInfo& si, const Object& object) { si.setTypeName("Object"); si.addMember("stringValue") <<= object.stringValue(); si.addMember("intValue") <<= object.intValue(); } void operator>>= (const cxxtools::SerializationInfo& si, Object& object) { si.getMember("stringValue") >>= object._stringValue; si.getMember("intValue") >>= object._intValue; } int main(int argc, char* argv[]) { try { cxxtools::Arg xml(argc, argv, 'x'); cxxtools::Arg csv(argc, argv, 'c'); std::vector o; if (xml) std::cin >> cxxtools::xml::Xml(o); else if (csv) std::cin >> cxxtools::Csv(o); else // json std::cin >> cxxtools::Json(o); for (unsigned n = 0; n < o.size(); ++n) { std::cout << "o[" << n << "].stringValue = " << o[n].stringValue() << '\n' << "o[" << n << "].intValue = " << o[n].intValue() << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/multifstream.cpp0000664000175000017500000000327113644433072014337 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include int main(int argc, char* argv[]) { try { cxxtools::multi_ifstream in; std::copy(argv + 1, argv + argc, in.back_inserter()); std::cout << in.rdbuf(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/thread.cpp0000664000175000017500000000751013644433072013072 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include cxxtools::Mutex coutMutex; cxxtools::Mutex conditionMutex; cxxtools::Condition running; #define PRINTLN(expr) \ do { \ cxxtools::MutexLock lock(coutMutex); \ std::cout << time(0) << ' ' << expr << std::endl; \ } while (false) class myDetachedThread : public cxxtools::DetachedThread { ~myDetachedThread(); protected: void run(); }; myDetachedThread::~myDetachedThread() { PRINTLN("myDetachedThread::~myDetachedThread() called"); } void myDetachedThread::run() { PRINTLN("myDetachedThread is starting"); cxxtools::MutexLock lock(conditionMutex); running.broadcast(); lock.unlock(); ::sleep(1); PRINTLN("myDetachedThread waits"); ::sleep(2); PRINTLN("myDetachedThread is ready"); } void someFunction() { PRINTLN("someFunction()"); ::sleep(1); PRINTLN("someFunction() ends"); } class AClass { std::string id; public: AClass(const std::string& id_) : id(id_) { } ~AClass() { PRINTLN("AClass::~AClass of object \"" << id << '"'); } void run() { PRINTLN("aFunction() of object \"" << id << '"'); ::sleep(1); PRINTLN("aFunction() of object \"" << id << "\" ends"); } }; int main() { try { cxxtools::MutexLock lock(conditionMutex); // detached threads are created on the heap. // They are deleted automatically when the thread ends. cxxtools::Thread* d = new myDetachedThread; d->create(); running.wait(lock); PRINTLN("myDetachedThread is running"); // run a function as a attached thread cxxtools::AttachedThread th( cxxtools::callable(someFunction) ); th.start(); // run a method of a object as a thread AClass aInstance("a instance"); AClass aInstance2("a instance 2"); cxxtools::AttachedThread aclassThread( cxxtools::callable(aInstance, &AClass::run) ); cxxtools::AttachedThread aclassThread2( cxxtools::callable(aInstance2, &AClass::run) ); aclassThread.start(); aclassThread2.start(); ::sleep(2); aclassThread.join(); aclassThread2.join(); // The detached thread is killed, if it does not come to an end before main. // The attached thread blocks the main-program, until it is ready. PRINTLN("main stops"); } catch (const std::exception& e) { std::cerr << "ERROR: " << e.what() << std::endl; } std::cout << "main stopped" << std::endl; } cxxtools-3.0/demo/mimemultipart.cpp0000664000175000017500000000630013644433072014510 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This creates a mail message with attachements and multiple message formats. * * A mail message with attachements is composed from a mime multipart message. * The type of it is multipart/related (or multipart/mixed). * * To add alternative formats (typically html and text) add a multipart * container with type mutlipart/alternative and add mime entities with * suitable content types. * * Attachements has a content type and a content disposition header. The * cxxtools mime multipart object makes it easy but offering suitable methods. */ #include #include #include int main(int argc, char* argv[]) { try { // create a multipart/related object (the outer container) cxxtools::MimeMultipart mm(cxxtools::MimeMultipart::typeRelated); // create multipart/alternative object for text and html formats cxxtools::MimeMultipart al(cxxtools::MimeMultipart::typeAlternative); // create message body in text format. cxxtools::MimeEntity& plain = al.addObject() .setContentType("text/plain; charset=UTF-8"); plain << "Hi there"; // create message body in html format. cxxtools::MimeEntity& html = al.addObject() .setContentType("text/html; charset=UTF-8"); html << "

Hi there

"; // add multipart/alternative object to outer container mm.addObject(al); // create file attachement from data mm.attachTextFile("this is the content", "file2.txt"); // read file from input stream std::ifstream in("mimemultipart.cpp"); mm.attachTextFile(in, "mimemultipart.cpp"); // output the outer container std::cout << mm; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/rpcparallelecho.cpp0000664000175000017500000001135313644433072014763 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This program demonstrates a way to issue multiple parallel rpc calls easily without using threads or callbacks. This example uses binary rpc but it is easy to replace the protocol with xmlrpc, json raw or json over http. */ #include #include #include #include #include #include #include #include //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); // Switch -i specifies the ip address of the server; empty means localhost. cxxtools::Arg ip(argc, argv, 'i'); // Switch -p is used to set the port of the server. cxxtools::Arg port(argc, argv, 'p', 7003); // Switch -c sets the number of parallel calls to execute. Default is 1. cxxtools::Arg count(argc, argv, 'c', 1); cxxtools::Arg ssl(argc, argv, 's'); typedef cxxtools::RemoteProcedure Echo; // We define vectors for the clients and remote procedures // One client can run only one request at one time hence we need one client // for each request, we plan to execute in parallel std::vector clients; std::vector echo; // The cxxtools::RemoteProcedure holds a reference to his remote client // and we have to make sure, that exactly that instance of the remote // client is valid while the remote procedure is executed. // To achive that we reserve space for enough elements in the vector so // that the remote clients do not need to be copied on reallocation. clients.reserve(count); // The selector is a abstraction of the poll system call. This manages the // asynchronous event processing. cxxtools::Selector selector; for (unsigned n = 0; n < count; ++n) { // We instantiate a remote client and pass the selector to him clients.push_back(cxxtools::bin::RpcClient(selector, ip, port, ssl)); // ... and a remote procedure object. echo.push_back(Echo(clients.back(), "echo")); } // process the command line arguments for (int a = 1; a < argc; ++a) { // For each remote procedure we call the begin method, which signals the // selector, that we want to run the remote procedure. for (unsigned n = 0; n < count; ++n) echo[n].begin(argv[a]); for (unsigned n = 0; n < count; ++n) { // For each client execute the event loop until the client is finished. // activeProcedure returns a pointer to our Echo object as long as it // is running in the event loop. Note that calling wait on the selector // handles all events for all clients although we wait for one specific // client to finish. while (clients[n].activeProcedure()) selector.wait(); // Since the nth client has finished processing, his corresponding // remote procedure is finished. We fetch the result using the result() // method. Note that the result() method may throw an exception when // the remote function throwed an exception on the server side. std::cout << echo[n].result() << '\n'; } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/mimeextract.cpp0000664000175000017500000000763213644433072014152 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This program extracts all parts of a mime/multipart message and writes them to the current directory. The message is either read from a file or when no file name is given as paramter from stdin. Attachements with file names are written using this file name. Other parts like the message itself are written in files named msgn.txt while n is a number starting from 0. The program searches recursively the whole message since parts of the message may be again mime/multipart messages. */ #include #include #include #include #include class MimeExtractor { unsigned N; public: MimeExtractor() : N(0) { } void extract(const cxxtools::MimeEntity& mo); }; void MimeExtractor::extract(const cxxtools::MimeEntity& mo) { if (mo.isMultipart()) { cxxtools::MimeMultipart mp(mo); for (cxxtools::MimeMultipart::const_iterator it = mp.begin(); it != mp.end(); ++it) { // recursively search for mime objects extract(*it); } } else { std::string filename; // Search for header "Content-Disposition: ... filename=something". // The filename can be enclosed in double quotes. // Not that we get a empty string from getHeader if the header // is not found at all, which is fine here. std::string contentDisposition = mo.getHeader("Content-Disposition"); static const cxxtools::Regex re("filename=\"?([^;\"]+)"); cxxtools::RegexSMatch sm; if (re.match(contentDisposition, sm)) { filename = sm[1]; } else { // When no filename is found, we use the filename msg0.txt, msg1.txt, ... std::ostringstream ss; ss << "msg" << N++ << ".txt"; filename = ss.str(); } std::ofstream of(filename.c_str()); of << mo.getBody(); } } int main(int argc, char* argv[]) { try { // Initialize logging - reads log.xml or log.properties log_init(); // Define std::istream for input data // This reads data either from a file passed as argument or stdin // if no parameter is passed. cxxtools::ArgIn in(argc, argv); // Parse the file from input stream cxxtools::MimeEntity mo(in); // Extract objects from data MimeExtractor mx; mx.extract(mo); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/netmsg.cpp0000664000175000017500000001077213644433072013124 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include void usage(const char* progname) { std::cerr << "usage: " << progname << " [-h host] [-p port] [-e] {message}\n" " " << progname << " -l [-h host] [-p port] [-s size] [-c] [-e] [-n]\n" "options:\n" " -l receiver-mode\n" " -h host hostname (default localhost in sender, any in receiver)\n" " -p port udp-port to use\n" " -s size size of receive-buffer in bytes (default 1024)\n" " -c continuous-mode - don't stop after receiving message\n" " -e echo message back or receive echo-reply\n" " -n don't output newline\n" " -b enable broadcast" << std::endl; } int main(int argc, char* argv[]) { try { cxxtools::Arg help(argc, argv, '?'); if (help) { usage(argv[0]); return 0; } cxxtools::Arg receive(argc, argv, 'l'); cxxtools::Arg port(argc, argv, 'p', 1234); cxxtools::Arg echo(argc, argv, 'e'); cxxtools::Arg nonewline(argc, argv, 'n'); cxxtools::Arg timeout(argc, argv, 't', 0); log_init(); if (receive) { cxxtools::Arg size(argc, argv, 's', 1024); cxxtools::Arg host(argc, argv, 'h'); cxxtools::Arg continuous(argc, argv, 'c'); if (argc > 1) { usage(argv[0]); return -1; } cxxtools::net::UdpReceiver receiver(host, port); if (timeout.isSet()) receiver.setTimeout(timeout); std::vector buffer(size); std::cout << "waiting for messages on port " << port << std::endl; do { cxxtools::net::UdpReceiver::size_type s = receiver.recv(&buffer[0], size); std::string msg(&buffer[0], s); std::cout << msg; if (!nonewline) std::cout << std::endl; else std::cout.flush(); if (echo) receiver.send(msg); } while (continuous); } else { cxxtools::Arg host(argc, argv, 'h'); cxxtools::Arg broadcast(argc, argv, 'b'); if (argc <= 1) { usage(argv[0]); return -1; } cxxtools::net::UdpSender sender(host, port, broadcast); if (timeout.isSet()) sender.setTimeout(timeout); for (int a = 1; a < argc; ++a) { std::string msg = argv[a]; std::cout << "send message \"" << msg << "\" to " << host << ':' << port << std::endl; cxxtools::net::UdpSender::size_type n = sender.send(msg); std::cout << n << " bytes sent " << msg.size() << " bytes queued" << std::endl; if (echo) { std::string reply = sender.recv(msg.size()); std::cout << "reply: " << reply; if (!nonewline) std::cout << std::endl; else std::cout.flush(); } } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/uuencode.cpp0000664000175000017500000000343313644433072013432 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include int main(int argc, char* argv[]) { try { cxxtools::Arg fname(argc, argv, 'f'); cxxtools::Arg mode(argc, argv, 'm', 0644); cxxtools::UuencodeOstream out(std::cout); if (fname) out.begin(fname.getValue(), mode); out << std::cin.rdbuf(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/jsonbeautify.cpp0000664000175000017500000000352213644433072014324 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include int main(int argc, char* argv[]) { try { // SerializationInfo is a generic structure, which can hold json data cxxtools::SerializationInfo si; // We read json from std::cin into our SerializationInfo std::cin >> cxxtools::Json(si); // ... and output it to std::cout with beautification set to true std::cout << cxxtools::Json(si).beautify(true); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/rpcserver.cpp0000664000175000017500000001505313644433072013637 00000000000000/* * Copyright (C) 2009,2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Cxxtools implements a rpc framework, which can run with 4 protocols. Xmlrpc is a simple xml based standard protocol. The spec can be found at http://www.xmlrpc.org/. Json rpc is a json based standard protocol. The sepc can be found at http://json-rpc.org. Json is less verbose than xml and therefore jsonrpc is a little faster than xmlrpc. Json rpc comes in cxxtools in 2 flavours: raw and http. And last but not least cxxtools has a own non standard binary protocol. It is faster than xmlrpc or jsonrpc but works only with cxxtools. This demo program implements a server, which runs all 4 flavours in a single event loop. */ #include #include #include #include #include #include #include #include #include #include //////////////////////////////////////////////////////////////////////// // This defines functions, which we want to be called remotely. // // Parameters and return values of the functions, which can be exported must be // serializable and deserializable with the cxxtools serialization framework. // For all standard types including container classes in the standard library // proper operators are defined in cxxtools. // std::string echo(const std::string& message) { std::cout << message << std::endl; return message; } double add(double a1, double a2) { return a1 + a2; } //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { // initialize logging - this reads the file log.xml from the current directory log_init(); // read the command line options // option -i defines the ip address of the interface, where the // server waits for connections. Default is empty, which tells the server to // listen on all local interfaces cxxtools::Arg ip(argc, argv, 'i'); // option -p specifies the port, where http requests are expected. // This port is valid for xmlrpc and json over http. It defaults to 7002. cxxtools::Arg port(argc, argv, 'p', 7002); // option -b specifies the port, where the binary server waits for // requests. It defaults to port 7003. cxxtools::Arg bport(argc, argv, 'b', 7003); // option -j specifies the port, where the json server wait for // requests. It defaults to port 7004. cxxtools::Arg jport(argc, argv, 'j', 7004); cxxtools::Arg daemonize(argc, argv, 'd'); cxxtools::Arg pidfile(argc, argv, "--pidfile"); cxxtools::Arg sslCert(argc, argv, 'c'); std::cout << "run rpcecho server\n" << "http protocol on port "<< port.getValue() << "\n" << "binary protocol on port " << bport.getValue() << "\n" << "json protocol on port " << jport.getValue() << std::endl; // create an event loop cxxtools::EventLoop loop; // the http server is instantiated with an ip address and a port number // It will be used for xmlrpc and json over http on different urls. cxxtools::http::Server httpServer(loop, ip, port, sslCert); //////////////////////////////////////////////////////////////////////// // Xmlrpc // we create an instance of the service class cxxtools::xmlrpc::Service xmlrpcService; // we register our functions xmlrpcService.registerFunction("echo", echo); xmlrpcService.registerFunction("add", add); // ... and register the service under a url httpServer.addService("/xmlrpc", xmlrpcService); //////////////////////////////////////////////////////////////////////// // Binary rpc // for the binary rpc server we define a binary server cxxtools::bin::RpcServer binServer(loop, ip, bport, sslCert); // and register the functions in the server binServer.registerFunction("echo", echo); binServer.registerFunction("add", add); //////////////////////////////////////////////////////////////////////// // Json rpc // for the json rpc server we define a json server cxxtools::json::RpcServer jsonServer(loop, ip, jport, sslCert); // and register the functions in the server jsonServer.registerFunction("echo", echo); jsonServer.registerFunction("add", add); //////////////////////////////////////////////////////////////////////// // Json rpc over http // for json over http we need a service object cxxtools::json::HttpService jsonhttpService; // we register our functions jsonhttpService.registerFunction("echo", echo); jsonhttpService.registerFunction("add", add); // ... and register the service under a url httpServer.addService("/jsonrpc", jsonhttpService); // go to the background if requested if (daemonize) cxxtools::posix::daemonize(pidfile); //////////////////////////////////////////////////////////////////////// // Run // now start the servers by running the event loop loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/splitter.cpp0000664000175000017500000000445413644433072013475 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include int main(int argc, char* argv[]) { try { cxxtools::Arg inputFieldSeparator(argc, argv, 'f', '\t'); cxxtools::Arg fieldRegex(argc, argv, 'r'); cxxtools::Arg outputFieldSeparator(argc, argv, 'o', '\t'); cxxtools::Regex re; if (fieldRegex.isSet()) re = cxxtools::Regex(fieldRegex); std::string line; while (std::getline(std::cin, line)) { std::vector tokens; if (fieldRegex.isSet()) cxxtools::split(re, line, std::back_inserter(tokens)); else cxxtools::split(inputFieldSeparator.getValue(), line, std::back_inserter(tokens)); std::string l = cxxtools::join(tokens.begin(), tokens.end(), outputFieldSeparator.getValue()); std::cout << l << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/arg-set.cpp0000664000175000017500000000476213644433072013173 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include void print_int(const char* txt, int i) { std::cout << txt << ": " << i << std::endl; } void print_charp(const char* txt, const char* p) { std::cout << txt << ": " << (p ? p : "NULL") << std::endl; } void print_string(const char* txt, const std::string& s) { std::cout << txt << ": " << s << std::endl; } int main(int argc, char* argv[]) { try { cxxtools::Arg int_param(5); // default-value 5 int_param.set(argc, argv, 'i'); int_param.set(argc, argv, "--int"); print_int("option -i|--int", int_param); cxxtools::Arg charp_param("hi"); // default-value charp_param.set(argc, argv, 'p'); charp_param.set(argc, argv, "--charp"); print_charp("option -p|--charp", charp_param); cxxtools::Arg string_param("hi"); // default-value string_param.set(argc, argv, 's'); string_param.set(argc, argv, "--string"); std::cout << "unprocessed arguments:\n"; for (int i = 1; i < argc; ++i) std::cout << '\t' << i << ": " << argv[i] << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } cxxtools-3.0/demo/msg.h0000664000175000017500000000357313644433072012063 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MSG_H #define MSG_H #include struct Msg { int value; std::string str; Msg() { } Msg(int v, const std::string& s) : value(v), str(s) { } }; inline void operator<<= (cxxtools::SerializationInfo& si, const Msg& msg) { si.setTypeName("Msg"); si.addMember("value") <<= msg.value; si.addMember("str") <<= msg.str; } inline void operator>>= (const cxxtools::SerializationInfo& si, Msg& msg) { si.getMember("value") >>= msg.value; si.getMember("str") >>= msg.str; } #endif // MSG_H cxxtools-3.0/demo/signals.cpp0000664000175000017500000000443113644433072013262 00000000000000/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include int function() { std::cout << "function called." << std::endl; return 0; } struct Object : public cxxtools::Connectable { bool method() { std::cout << "Object::method called." << std::endl; return true; } char constMethod() const { std::cout << "Object::constMethod called." << std::endl; return 'r'; } static std::string staticMethod() { std::cout << "Object::staticMethod called." << std::endl; return "test"; } }; int main(int argc, char* argv[]) { try { Object obj; cxxtools::Signal<> signal; signal.connect( cxxtools::slot(function) ); signal.connect( cxxtools::slot(obj, &Object::method) ); signal.connect( cxxtools::slot(obj, &Object::constMethod) ); signal.connect( cxxtools::slot(&Object::staticMethod) ); signal.send(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } cxxtools-3.0/demo/execLs.cpp0000664000175000017500000000342413644433072013046 00000000000000/* * Copyright (C) 2016 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include int main(int argc, char* argv[]) { try { cxxtools::posix::Exec e("ls"); e.push_back("-l"); e.exec(); /* * may be written even shorter: cxxtools::posix::Exec("ls") .push_back("-l") .exec(); */ } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/threadpool.cpp0000664000175000017500000000420613644433072013763 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include cxxtools::Mutex mutex; unsigned count = 0; void funct() { for (unsigned n = 0; n < 10; ++n) { { cxxtools::MutexLock lock(mutex); std::cout << "Hello " << ++count << std::endl; } cxxtools::Thread::sleep(100); } } int main(int argc, char* argv[]) { try { cxxtools::Arg threads(argc, argv, 't', 5); cxxtools::Arg tasks(argc, argv, 'n', 20); cxxtools::Arg docancel(argc, argv, 'c'); cxxtools::ThreadPool p(threads); for (unsigned n = 0; n < tasks; ++n) p.schedule(cxxtools::callable(funct)); if (docancel) p.stop(docancel); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/regex.cpp0000664000175000017500000000372213644433072012736 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include int main(int argc, char* argv[]) { try { static cxxtools::Regex checkIpV4("^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)$"); for (int a = 1; a < argc; ++a) { cxxtools::RegexSMatch m; if (checkIpV4.match(argv[a], m)) { std::cout << argv[a] << " is a ipv4 address with components " << m[1] << " . " << m[2] << " . " << m[3] << " . " << m[4] << std::endl; } else { std::cout << argv[a] << " is not a ipv4 address" << std::endl; } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/saml2.cpp0000664000175000017500000001321313644433072012636 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include int main(int argc, char* argv[]) { #if __cplusplus >= 201103L try { cxxtools::xml::XmlWriter w(std::cout); cxxtools::xml::XmlWriter::Element assertion(w, L"saml:Assertion", { { L"xmlns:saml", L"urn:oasis:names:tc:SAML:2.0:assertion" }, { L"xmlns:xs", L"http://www.w3.org/2001/XMLSchema" }, { L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" }, { L"ID", L"b07b804c-7c29-ea16-7300-4f3d6f7928ac" }, { L"Version", L"2.0" }, { L"IssueInstant", cxxtools::DateTime(2004, 12, 5, 9, 22, 5) } }); { cxxtools::xml::XmlWriter::Element issuer(w, L"saml:Issuer"); issuer.writeContent(L"https://idp.example.org/SAML2"); } { cxxtools::xml::XmlWriter::Element issuer(w, L"ds:Signature", { { L"xmlns:ds", L"http://www.w3.org/2000/09/xmldsig#" } }); issuer.writeContent(L"..."); } { cxxtools::xml::XmlWriter::Element subject(w, L"saml:Subject"); { cxxtools::xml::XmlWriter::Element nameID(w, L"saml:NameID", { { L"Format", L"urn:oasis:names:tc:SAML:2.0:nameid-format:transient" } }); nameID.writeContent(L"3f7b3dcf-1674-4ecd-92c8-1544f346baf8"); } cxxtools::xml::XmlWriter::Element sc(w, L"saml:SubjectConfirmation", { { L"Method", L"urn:oasis:names:tc:SAML:2.0:cm:bearer" } }); cxxtools::xml::XmlWriter::Element cd(w, L"saml:SubjectConfirmationData", { { L"InResponseTo", L"aaf23196-1773-2113-474a-fe114412ab72" }, { L"Recipient", L"https://sp.example.com/SAML2/SSO/POST" }, { L"NotOnOrAfter", cxxtools::DateTime(2004, 12, 5, 9, 27, 5) } }); } { cxxtools::xml::XmlWriter::Element conditions(w, L"saml:Conditions", { { L"NotBefore", cxxtools::DateTime(2004, 12, 5, 9, 17, 5) }, { L"NotOnOrAfter", cxxtools::DateTime(2004, 12, 5, 9, 27, 5) } }); { cxxtools::xml::XmlWriter::Element ar(w, L"saml:AudienceRestriction"); cxxtools::xml::XmlWriter::Element au(w, L"saml:Audience"); au.writeContent(L"https://sp.example.com/SAML2"); } } { cxxtools::xml::XmlWriter::Element as(w, L"saml:AuthnStatement", { { L"AuthnInstant", cxxtools::DateTime(2004, 12, 5, 9, 22, 0) }, { L"SessionIndex", L"b07b804c-7c29-ea16-7300-4f3d6f7928ac" } }); cxxtools::xml::XmlWriter::Element ac(w, L"saml:AuthnContext"); cxxtools::xml::XmlWriter::Element cf(w, L"saml:AuthnContextClassRef"); cf.writeContent(L"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"); } { cxxtools::xml::XmlWriter::Element as(w, L"saml:AttributeStatement"); cxxtools::xml::XmlWriter::Element at(w, L"saml:Attribute", { { L"xmlns:x500", L"urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500" }, { L"x500:Encoding", L"LDAP" }, { L"NameFormat", L"urn:oasis:names:tc:SAML:2.0:attrname-format:uri" }, { L"Name", L"urn:oid:1.3.6.1.4.1.5923.1.1.1.1" }, { L"FriendlyName", L"eduPersonAffiliation" } }); { cxxtools::xml::XmlWriter::Element av(w, L"saml:AttributeValue", { { L"xsi:type", L"xs:string" } }); av.writeContent(L"member"); } { cxxtools::xml::XmlWriter::Element av(w, L"saml:AttributeValue", { { L"xsi:type", L"xs:string" } }); av.writeContent(L"staff"); } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } #else std::cerr << "this demo needs C++11" << std::endl; #endif } cxxtools-3.0/demo/serialization.cpp0000664000175000017500000000564713644433072014511 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include class Object { friend void operator>>= (const cxxtools::SerializationInfo& si, Object& object); std::string _stringValue; int _intValue; public: Object() : _intValue(0) { } Object(const std::string& stringValue, int intValue) : _stringValue(stringValue), _intValue(intValue) { } const std::string& stringValue() const { return _stringValue; } int intValue() const { return _intValue; } }; void operator<<= (cxxtools::SerializationInfo& si, const Object& object) { si.setTypeName("Object"); si.addMember("stringValue") <<= object.stringValue(); si.addMember("intValue") <<= object.intValue(); } void operator>>= (const cxxtools::SerializationInfo& si, Object& object) { si.getMember("stringValue") >>= object._stringValue; si.getMember("intValue") >>= object._intValue; } int main(int argc, char* argv[]) { try { cxxtools::Arg xml(argc, argv, 'x'); cxxtools::Arg csv(argc, argv, 'c'); cxxtools::Arg beautify(argc, argv, 'b'); std::vector objects; objects.push_back(Object("Hello", 42)); objects.push_back(Object("World", -17)); if (xml) std::cout << cxxtools::xml::Xml(objects, "object").beautify(beautify); else if (csv) std::cout << cxxtools::Csv(objects); else // json std::cout << cxxtools::Json(objects).beautify(beautify); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/0000775000175000017500000000000013672344761012004 500000000000000cxxtools-3.0/demo/ssl/Makefile.in0000664000175000017500000006021113644433103013755 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = rpcbserver$(EXEEXT) rpcjserver$(EXEEXT) \ rpcJserver$(EXEEXT) rpcxserver$(EXEEXT) rpcbecho$(EXEEXT) \ rpcjecho$(EXEEXT) rpcJecho$(EXEEXT) rpcxecho$(EXEEXT) subdir = demo/ssl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_rpcJecho_OBJECTS = rpcJecho.$(OBJEXT) rpcJecho_OBJECTS = $(am_rpcJecho_OBJECTS) rpcJecho_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.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_rpcJserver_OBJECTS = rpcJserver.$(OBJEXT) rpcJserver_OBJECTS = $(am_rpcJserver_OBJECTS) rpcJserver_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la am_rpcbecho_OBJECTS = rpcbecho.$(OBJEXT) rpcbecho_OBJECTS = $(am_rpcbecho_OBJECTS) rpcbecho_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la am_rpcbserver_OBJECTS = rpcbserver.$(OBJEXT) rpcbserver_OBJECTS = $(am_rpcbserver_OBJECTS) rpcbserver_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la am_rpcjecho_OBJECTS = rpcjecho.$(OBJEXT) rpcjecho_OBJECTS = $(am_rpcjecho_OBJECTS) rpcjecho_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/json/libcxxtools-json.la am_rpcjserver_OBJECTS = rpcjserver.$(OBJEXT) rpcjserver_OBJECTS = $(am_rpcjserver_OBJECTS) rpcjserver_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/json/libcxxtools-json.la am_rpcxecho_OBJECTS = rpcxecho.$(OBJEXT) rpcxecho_OBJECTS = $(am_rpcxecho_OBJECTS) rpcxecho_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la am_rpcxserver_OBJECTS = rpcxserver.$(OBJEXT) rpcxserver_OBJECTS = $(am_rpcxserver_OBJECTS) rpcxserver_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rpcJecho.Po \ ./$(DEPDIR)/rpcJserver.Po ./$(DEPDIR)/rpcbecho.Po \ ./$(DEPDIR)/rpcbserver.Po ./$(DEPDIR)/rpcjecho.Po \ ./$(DEPDIR)/rpcjserver.Po ./$(DEPDIR)/rpcxecho.Po \ ./$(DEPDIR)/rpcxserver.Po am__mv = mv -f CXXCOMPILE = $(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) $(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 = $(rpcJecho_SOURCES) $(rpcJserver_SOURCES) \ $(rpcbecho_SOURCES) $(rpcbserver_SOURCES) $(rpcjecho_SOURCES) \ $(rpcjserver_SOURCES) $(rpcxecho_SOURCES) \ $(rpcxserver_SOURCES) DIST_SOURCES = $(rpcJecho_SOURCES) $(rpcJserver_SOURCES) \ $(rpcbecho_SOURCES) $(rpcbserver_SOURCES) $(rpcjecho_SOURCES) \ $(rpcjserver_SOURCES) $(rpcxecho_SOURCES) \ $(rpcxserver_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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ rpcbserver_SOURCES = rpcbserver.cpp rpcbserver_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/bin/libcxxtools-bin.la rpcjserver_SOURCES = rpcjserver.cpp rpcjserver_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/json/libcxxtools-json.la rpcJserver_SOURCES = rpcJserver.cpp rpcJserver_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la $(top_builddir)/src/json/libcxxtools-json.la rpcxserver_SOURCES = rpcxserver.cpp rpcxserver_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la rpcbecho_SOURCES = rpcbecho.cpp rpcbecho_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/bin/libcxxtools-bin.la rpcjecho_SOURCES = rpcjecho.cpp rpcjecho_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/json/libcxxtools-json.la rpcJecho_SOURCES = rpcJecho.cpp rpcJecho_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la $(top_builddir)/src/json/libcxxtools-json.la rpcxecho_SOURCES = rpcxecho.cpp rpcxecho_LDADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu demo/ssl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu demo/ssl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list rpcJecho$(EXEEXT): $(rpcJecho_OBJECTS) $(rpcJecho_DEPENDENCIES) $(EXTRA_rpcJecho_DEPENDENCIES) @rm -f rpcJecho$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcJecho_OBJECTS) $(rpcJecho_LDADD) $(LIBS) rpcJserver$(EXEEXT): $(rpcJserver_OBJECTS) $(rpcJserver_DEPENDENCIES) $(EXTRA_rpcJserver_DEPENDENCIES) @rm -f rpcJserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcJserver_OBJECTS) $(rpcJserver_LDADD) $(LIBS) rpcbecho$(EXEEXT): $(rpcbecho_OBJECTS) $(rpcbecho_DEPENDENCIES) $(EXTRA_rpcbecho_DEPENDENCIES) @rm -f rpcbecho$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcbecho_OBJECTS) $(rpcbecho_LDADD) $(LIBS) rpcbserver$(EXEEXT): $(rpcbserver_OBJECTS) $(rpcbserver_DEPENDENCIES) $(EXTRA_rpcbserver_DEPENDENCIES) @rm -f rpcbserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcbserver_OBJECTS) $(rpcbserver_LDADD) $(LIBS) rpcjecho$(EXEEXT): $(rpcjecho_OBJECTS) $(rpcjecho_DEPENDENCIES) $(EXTRA_rpcjecho_DEPENDENCIES) @rm -f rpcjecho$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcjecho_OBJECTS) $(rpcjecho_LDADD) $(LIBS) rpcjserver$(EXEEXT): $(rpcjserver_OBJECTS) $(rpcjserver_DEPENDENCIES) $(EXTRA_rpcjserver_DEPENDENCIES) @rm -f rpcjserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcjserver_OBJECTS) $(rpcjserver_LDADD) $(LIBS) rpcxecho$(EXEEXT): $(rpcxecho_OBJECTS) $(rpcxecho_DEPENDENCIES) $(EXTRA_rpcxecho_DEPENDENCIES) @rm -f rpcxecho$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcxecho_OBJECTS) $(rpcxecho_LDADD) $(LIBS) rpcxserver$(EXEEXT): $(rpcxserver_OBJECTS) $(rpcxserver_DEPENDENCIES) $(EXTRA_rpcxserver_DEPENDENCIES) @rm -f rpcxserver$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rpcxserver_OBJECTS) $(rpcxserver_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcJecho.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcJserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbecho.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcjecho.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcjserver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcxecho.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcxserver.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @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@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/rpcJecho.Po -rm -f ./$(DEPDIR)/rpcJserver.Po -rm -f ./$(DEPDIR)/rpcbecho.Po -rm -f ./$(DEPDIR)/rpcbserver.Po -rm -f ./$(DEPDIR)/rpcjecho.Po -rm -f ./$(DEPDIR)/rpcjserver.Po -rm -f ./$(DEPDIR)/rpcxecho.Po -rm -f ./$(DEPDIR)/rpcxserver.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/rpcJecho.Po -rm -f ./$(DEPDIR)/rpcJserver.Po -rm -f ./$(DEPDIR)/rpcbecho.Po -rm -f ./$(DEPDIR)/rpcbserver.Po -rm -f ./$(DEPDIR)/rpcjecho.Po -rm -f ./$(DEPDIR)/rpcjserver.Po -rm -f ./$(DEPDIR)/rpcxecho.Po -rm -f ./$(DEPDIR)/rpcxserver.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles 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 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/demo/ssl/rpcbserver.cpp0000664000175000017500000000304513644433072014600 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * */ #include #include #include #include #include #include bool doAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" accepted" << std::endl; return true; } bool noAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" not accepted" << std::endl; return false; } std::string echo(const std::string& msg) { return msg; } int add(int a, int b) { return a + b; } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'j', 7003); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C', "ca.crt"); cxxtools::Arg deny(argc, argv, 'd'); cxxtools::Arg nodeny(argc, argv, 'D'); cxxtools::EventLoop loop; cxxtools::bin::RpcServer server(loop, ip, port, cert, 2, ca); server.registerFunction("echo", echo); server.registerFunction("add", add); if (deny) cxxtools::connect(server.acceptSslCertificate(), noAccept); else if (nodeny) cxxtools::connect(server.acceptSslCertificate(), doAccept); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/Makefile.am0000664000175000017500000000253113644433072013752 00000000000000noinst_PROGRAMS = rpcbserver rpcjserver rpcJserver rpcxserver rpcbecho rpcjecho rpcJecho rpcxecho rpcbserver_SOURCES = rpcbserver.cpp rpcbserver_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/bin/libcxxtools-bin.la rpcjserver_SOURCES = rpcjserver.cpp rpcjserver_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/json/libcxxtools-json.la rpcJserver_SOURCES = rpcJserver.cpp rpcJserver_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la $(top_builddir)/src/json/libcxxtools-json.la rpcxserver_SOURCES = rpcxserver.cpp rpcxserver_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la rpcbecho_SOURCES = rpcbecho.cpp rpcbecho_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/bin/libcxxtools-bin.la rpcjecho_SOURCES = rpcjecho.cpp rpcjecho_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/json/libcxxtools-json.la rpcJecho_SOURCES = rpcJecho.cpp rpcJecho_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la $(top_builddir)/src/json/libcxxtools-json.la rpcxecho_SOURCES = rpcxecho.cpp rpcxecho_LDADD=$(top_builddir)/src/libcxxtools.la $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include cxxtools-3.0/demo/ssl/rpcjecho.cpp0000664000175000017500000000161613644433072014222 00000000000000#include #include #include #include #include //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7004); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C'); cxxtools::json::RpcClient client(ip, port, cert); if (ca.isSet()) client.setSslVerify(2, ca); cxxtools::RemoteProcedure echo(client, "echo"); for (int a = 1; a < argc; ++a) { std::string v = echo(argv[a]); std::cout << v << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/rpcJecho.cpp0000664000175000017500000000163413644433072014162 00000000000000#include #include #include #include #include //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7002); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C'); cxxtools::json::HttpClient client(ip, port, "/jsonrpc", cert); if (ca.isSet()) client.setSslVerify(2, ca); cxxtools::RemoteProcedure echo(client, "echo"); for (int a = 1; a < argc; ++a) { std::string v = echo(argv[a]); std::cout << v << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/rpcxserver.cpp0000664000175000017500000000324413644433072014627 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * */ #include #include #include #include #include #include #include bool doAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" accepted" << std::endl; return true; } bool noAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" not accepted" << std::endl; return false; } std::string echo(const std::string& msg) { return msg; } int add(int a, int b) { return a + b; } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'j', 7002); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C', "ca.crt"); cxxtools::Arg deny(argc, argv, 'd'); cxxtools::Arg nodeny(argc, argv, 'D'); cxxtools::EventLoop loop; cxxtools::http::Server server(loop, ip, port, cert, 2, ca); cxxtools::xmlrpc::Service service; service.registerFunction("echo", echo); service.registerFunction("add", add); server.addService("/xmlrpc", service); if (deny) cxxtools::connect(server.acceptSslCertificate(), noAccept); else if (nodeny) cxxtools::connect(server.acceptSslCertificate(), doAccept); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/rpcxecho.cpp0000664000175000017500000000163713644433072014243 00000000000000#include #include #include #include #include //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7002); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C'); cxxtools::xmlrpc::HttpClient client(ip, port, "/xmlrpc", cert); if (ca.isSet()) client.setSslVerify(2, ca); cxxtools::RemoteProcedure echo(client, "echo"); for (int a = 1; a < argc; ++a) { std::string v = echo(argv[a]); std::cout << v << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/rpcbecho.cpp0000664000175000017500000000211713644433072014207 00000000000000#include #include #include #include #include #include bool noAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" not accepted" << std::endl; return false; } //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7003); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C'); cxxtools::bin::RpcClient client(ip, port, cert); if (ca.isSet()) client.setSslVerify(2, ca); cxxtools::RemoteProcedure echo(client, "echo"); for (int a = 1; a < argc; ++a) { std::string v = echo(argv[a]); std::cout << v << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/rpcjserver.cpp0000664000175000017500000000304713644433072014612 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * */ #include #include #include #include #include #include bool doAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" accepted" << std::endl; return true; } bool noAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" not accepted" << std::endl; return false; } std::string echo(const std::string& msg) { return msg; } int add(int a, int b) { return a + b; } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'j', 7004); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C', "ca.crt"); cxxtools::Arg deny(argc, argv, 'd'); cxxtools::Arg nodeny(argc, argv, 'D'); cxxtools::EventLoop loop; cxxtools::json::RpcServer server(loop, ip, port, cert, 2, ca); server.registerFunction("echo", echo); server.registerFunction("add", add); if (deny) cxxtools::connect(server.acceptSslCertificate(), noAccept); else if (nodeny) cxxtools::connect(server.acceptSslCertificate(), doAccept); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/ssl/rpcJserver.cpp0000664000175000017500000000325113644433072014547 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * */ #include #include #include #include #include #include #include bool doAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" accepted" << std::endl; return true; } bool noAccept(const cxxtools::SslCertificate& cert) { std::cout << "cert \"" << cert.getSubject() << "\" not accepted" << std::endl; return false; } std::string echo(const std::string& msg) { return msg; } int add(int a, int b) { return a + b; } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'j', 7002); cxxtools::Arg cert(argc, argv, 'c'); cxxtools::Arg ca(argc, argv, 'C', "ca.crt"); cxxtools::Arg deny(argc, argv, 'd'); cxxtools::Arg nodeny(argc, argv, 'D'); cxxtools::EventLoop loop; cxxtools::http::Server server(loop, ip, port, cert, 2, ca); cxxtools::json::HttpService service; service.registerFunction("echo", echo); service.registerFunction("add", add); server.addService("/jsonrpc", service); if (deny) cxxtools::connect(server.acceptSslCertificate(), noAccept); else if (nodeny) cxxtools::connect(server.acceptSslCertificate(), doAccept); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/demo/xmlmsgclient.cpp0000664000175000017500000000465313644433072014336 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include "msg.h" int main(int argc, char* argv[]) { try { cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 7010); // We instantiate a network iostream and connect to a server cxxtools::net::TcpStream inp(ip, port); cxxtools::xml::XmlDeserializer deserializer; // Xml must be read with a XmlReader to prevent, that data is lost // in the input stream between messages. cxxtools::xml::XmlReader xmlreader(inp); // Read messages until we get a XmlNoDocument exception. Msg msg; while (true) { try { deserializer.parse(xmlreader); } catch (const cxxtools::xml::XmlNoDocument&) { break; } deserializer.deserialize(msg); std::cout << msg.value << '\t' << msg.str << std::endl; deserializer.clear(); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-3.0/README0000664000175000017500000000056413644433072011055 00000000000000Cxxtools ======== cxxtools is my toolbox with reusable c++-components see INSTALL for installation-instructions Installation from GIT ===================== In the GIT-repository there is no configure-script, but configure.ac, which is the source for configure. You need autoconf and automake to create configure. Run `autoreconf -i` to generate a configure script. cxxtools-3.0/configure0000775000175000017500000241261513644433102012104 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for cxxtools 3.0. # # Report bugs to >. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and Tommi Maekitalo $0: about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cxxtools' PACKAGE_TARNAME='cxxtools' PACKAGE_VERSION='3.0' PACKAGE_STRING='cxxtools 3.0' PACKAGE_BUGREPORT='Tommi Maekitalo ' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_unique_file="src/log.cpp" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS MAKE_UNITTEST_FALSE MAKE_UNITTEST_TRUE MAKE_DEMOS_FALSE MAKE_DEMOS_TRUE MAKE_OPENSSL_FALSE MAKE_OPENSSL_TRUE HAVE_REVERSE_ITERATOR_4 HAVE_REVERSE_ITERATOR CXXTOOLS_STD_LOCALE CXXTOOLS_SUSECONDS SHARED_LIB_FLAG CXXTOOLS_LDFLAGS CXXTOOLS_CXXFLAGS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CXX PTHREAD_CC acx_pthread_config MAKE_ICONVSTREAM_FALSE MAKE_ICONVSTREAM_TRUE LTLIBICONV LIBICONV HAVE_UNSIGNED_LONG_LONG HAVE_LONG_LONG HAVE_CXX11 CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX sonumber LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_static enable_shared with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_iconvstream with_ssl enable_demos enable_unittest ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures cxxtools 3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/cxxtools] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of cxxtools 3.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-demos disable building demos --disable-unittest disable building unittest Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-iconvstream=yes|no compile iconv stream (default: no) --with-ssl=yes|no build with SSL support Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to >. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF cxxtools configure 3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to Tommi Maekitalo ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to Tommi Maekitalo ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by cxxtools $as_me 3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='cxxtools' VERSION='3.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=no fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: abi_current=10 abi_revision=0 abi_age=0 sonumber=${abi_current}:${abi_revision}:${abi_age} ac_config_headers="$ac_config_headers src/config.h" ac_config_files="$ac_config_files include/cxxtools/config.h" ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } if ${ax_cv_cxx_compile_cxx11+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; struct Base { virtual void f() {} }; struct Child : public Base { virtual void f() override {} }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; auto l = [](){}; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_cxx_compile_cxx11=yes else ax_cv_cxx_compile_cxx11=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x; do cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; struct Base { virtual void f() {} }; struct Child : public Base { virtual void f() override {} }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; auto l = [](){}; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$ac_save_CXXFLAGS" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi else if test x$ac_success = xno; then HAVE_CXX11=0 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler vendor" >&5 $as_echo_n "checking for C++ compiler vendor... " >&6; } if ${ax_cv_cxx_compiler_vendor+:} false; then : $as_echo_n "(cached) " >&6 else # note: don't check for gcc first since some other compilers define __GNUC__ vendors="intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__TURBOC__ comeau: __COMO__ cray: _CRAYC kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ portland: __PGI unknown: UNKNOWN" for ventest in $vendors; do case $ventest in *:) vendor=$ventest; continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if !($vencpp) thisisanerror; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done ax_cv_cxx_compiler_vendor=`echo $vendor | cut -d: -f1` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compiler_vendor" >&5 $as_echo "$ax_cv_cxx_compiler_vendor" >&6; } if test "$ax_cv_cxx_compiler_vendor" = "ibm"; then : CPPFLAGS="$CPPFLAGS -qrtti -qlanglvl=newexcp -D__NOLOCK_ON_INPUT -D__NOLOCK_ON_OUTPUT" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wno-long-long" >&5 $as_echo_n "checking whether C++ compiler accepts -Wno-long-long... " >&6; } if ${ax_cv_check_cxxflags___Wno_long_long+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Wno-long-long" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___Wno_long_long=yes else ax_cv_check_cxxflags___Wno_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wno_long_long" >&5 $as_echo "$ax_cv_check_cxxflags___Wno_long_long" >&6; } if test x"$ax_cv_check_cxxflags___Wno_long_long" = xyes; then : CPPFLAGS="$CPPFLAGS -Wno-long-long" else : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wall" >&5 $as_echo_n "checking whether C++ compiler accepts -Wall... " >&6; } if ${ax_cv_check_cxxflags___Wall+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___Wall=yes else ax_cv_check_cxxflags___Wall=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wall" >&5 $as_echo "$ax_cv_check_cxxflags___Wall" >&6; } if test x"$ax_cv_check_cxxflags___Wall" = xyes; then : CPPFLAGS="$CPPFLAGS -Wall" else : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -pedantic" >&5 $as_echo_n "checking whether C++ compiler accepts -pedantic... " >&6; } if ${ax_cv_check_cxxflags___pedantic+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -pedantic" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___pedantic=yes else ax_cv_check_cxxflags___pedantic=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___pedantic" >&5 $as_echo "$ax_cv_check_cxxflags___pedantic" >&6; } if test x"$ax_cv_check_cxxflags___pedantic" = xyes; then : CPPFLAGS="$CPPFLAGS -pedantic" else : fi fi for ac_header in sys/filio.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_filio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_FILIO_H 1 _ACEOF fi done for ac_header in csignal do : ac_fn_cxx_check_header_mongrel "$LINENO" "csignal" "ac_cv_header_csignal" "$ac_includes_default" if test "x$ac_cv_header_csignal" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CSIGNAL 1 _ACEOF fi done for ac_header in sys/sendfile.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/sendfile.h" "ac_cv_header_sys_sendfile_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sendfile_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SENDFILE_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lnsl" >&5 $as_echo_n "checking for setsockopt in -lnsl... " >&6; } if ${ac_cv_lib_nsl_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_nsl_setsockopt=yes else ac_cv_lib_nsl_setsockopt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_setsockopt" >&5 $as_echo "$ac_cv_lib_nsl_setsockopt" >&6; } if test "x$ac_cv_lib_nsl_setsockopt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept in -lsocket" >&5 $as_echo_n "checking for accept in -lsocket... " >&6; } if ${ac_cv_lib_socket_accept+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char accept (); int main () { return accept (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_socket_accept=yes else ac_cv_lib_socket_accept=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_accept" >&5 $as_echo "$ac_cv_lib_socket_accept" >&6; } if test "x$ac_cv_lib_socket_accept" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_destroy in -lrt" >&5 $as_echo_n "checking for sem_destroy in -lrt... " >&6; } if ${ac_cv_lib_rt_sem_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_destroy (); int main () { return sem_destroy (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_rt_sem_destroy=yes else ac_cv_lib_rt_sem_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sem_destroy" >&5 $as_echo "$ac_cv_lib_rt_sem_destroy" >&6; } if test "x$ac_cv_lib_rt_sem_destroy" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "dlopen not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl socket resolv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } if ${ac_cv_search_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_clock_gettime+:} false; then : break fi done if ${ac_cv_search_clock_gettime+:} false; then : else ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 $as_echo "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in inet_ntop accept4 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in clock_gettime do : ac_fn_cxx_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CLOCK_GETTIME 1 _ACEOF fi done for ac_func in nanosleep do : ac_fn_cxx_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NANOSLEEP 1 _ACEOF fi done for ac_func in sendfile do : ac_fn_cxx_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile" if test "x$ac_cv_func_sendfile" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SENDFILE 1 _ACEOF fi done for ac_func in ppoll do : ac_fn_cxx_check_func "$LINENO" "ppoll" "ac_cv_func_ppoll" if test "x$ac_cv_func_ppoll" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PPOLL 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } if ${ac_cv_type_unsigned_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_unsigned_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 $as_echo_n "checking for long long int... " >&6; } if ${ac_cv_type_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_long_long_int = yes; then if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX # define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif int main () { long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_type_long_long_int=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 $as_echo "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } if ${ac_cv_type_unsigned_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_unsigned_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi if test "$ac_cv_type_long_long_int" = yes; then : HAVE_LONG_LONG=HAVE_LONG_LONG cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void f(short); void f(int); void f(long); void f(long long); void f() { int64_t v = 1; f(v); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define INT64_IS_BASETYPE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: long long not found" >&5 $as_echo "$as_me: WARNING: long long not found" >&2;}; HAVE_LONG_LONG=NO_LONG_LONG cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void f(short); void f(int); void f(long); void f() { int64_t v = 1; f(v); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define INT64_IS_BASETYPE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi HAVE_LONG_LONG="$HAVE_LONG_LONG" if test "$ac_cv_type_unsigned_long_long_int" = yes; then : HAVE_UNSIGNED_LONG_LONG=HAVE_UNSIGNED_LONG_LONG else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unsigned long long not found ($ac_cv_type_unsigned_long_long_int)" >&5 $as_echo "$as_me: WARNING: unsigned long long not found ($ac_cv_type_unsigned_long_long_int)" >&2;}; HAVE_UNSIGNED_LONG_LONG=NO_UNSIGNED_LONG_LONG fi HAVE_UNSIGNED_LONG_LONG="$HAVE_UNSIGNED_LONG_LONG" # Check whether --with-iconvstream was given. if test "${with_iconvstream+set}" = set; then : withval=$with_iconvstream; with_iconvstream=$withval else with_iconvstream=no fi if test "$with_iconvstream" = yes; then : am_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCICONV" LIBICONV=-liconv { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi if test "$am_cv_func_iconv" != yes; then : as_fn_error $? "iconv not found" "$LINENO" 5 fi fi if test $with_iconvstream = yes; then MAKE_ICONVSTREAM_TRUE= MAKE_ICONVSTREAM_FALSE='#' else MAKE_ICONVSTREAM_TRUE='#' MAKE_ICONVSTREAM_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads -mt --thread-safe pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads -mt pthread -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_acx_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_acx_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 $as_echo "$acx_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r # Extract the first word of "cc_r", so it can be a program name with args. set dummy cc_r; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="cc_r" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}" fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "CC_r", so it can be a program name with args. set dummy CC_r; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CXX="CC_r" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PTHREAD_CXX" && ac_cv_prog_PTHREAD_CXX="${CXX}" fi fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 $as_echo "$PTHREAD_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else PTHREAD_CC="$CC" PTHREAD_CXX="$CXX" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else acx_pthread_ok=no fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$PTHREAD_CC" CXX="$PTHREAD_CXX" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" LIBS="$LIBS $PTHREAD_LIBS" CXXTOOLS_CXXFLAGS='-I${includedir}' CXXTOOLS_LDFLAGS='-L${libdir} -lcxxtools' case "${host_cpu}-${host_os}" in *-aix*) SHARED_LIB_FLAG=-qmkshrobj ;; *) SHARED_LIB_FLAG= ;; esac # # checking existence of suseconds_t, needed by hirestime.h # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suseconds_t..." >&5 $as_echo "$as_me: checking for suseconds_t..." >&6;} ac_fn_cxx_check_type "$LINENO" "suseconds_t" "ac_cv_type_suseconds_t" "#include " if test "x$ac_cv_type_suseconds_t" = xyes; then : CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_T else CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_TIME_T fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void foo() { std::numpunct* np; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_STD_LOCALE=CXXTOOLS_WITH_STD_LOCALE else CXXTOOLS_STD_LOCALE=CXXTOOLS_WITHOUT_STD_LOCALE fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int i = TCP_DEFER_ACCEPT; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_TCP_DEFER_ACCEPT 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int i = IPPROTO_IPV6; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_IPV6 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int i = SO_NOSIGPIPE; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_SO_NOSIGPIPE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int i = MSG_NOSIGNAL; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_MSG_NOSIGNAL 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include std::reverse_iterator r; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : HAVE_REVERSE_ITERATOR=HAVE_REVERSE_ITERATOR else HAVE_REVERSE_ITERATOR=NO_REVERSE_ITERATOR fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include std::reverse_iterator r; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : HAVE_REVERSE_ITERATOR_4=HAVE_REVERSE_ITERATOR_4 else HAVE_REVERSE_ITERATOR_4=NO_REVERSE_ITERATOR_4 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext HAVE_REVERSE_ITERATOR="$HAVE_REVERSE_ITERATOR" HAVE_REVERSE_ITERATOR_4="$HAVE_REVERSE_ITERATOR_4" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void foo() { try {} catch (const abi::__forced_unwind&) {} } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_ABI_FORCED_UNWIND 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # # SSL # # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then : withval=$with_ssl; ssl_option=$withval else ssl_option=yes fi if test $ssl_option = yes; then : ac_fn_cxx_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: building with ssl support" >&5 $as_echo "building with ssl support" >&6; } $as_echo "#define WITH_SSL /**/" >>confdefs.h cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include ASN1_TIME* t; void foo() { ASN1_TIME_diff(0, 0, t, t); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_ASN1_TIME_diff /**/" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else as_fn_error $? "header for openssl not found; install openssl developent package or use --without-ssl" "$LINENO" 5 fi fi if test $ssl_option = yes; then MAKE_OPENSSL_TRUE= MAKE_OPENSSL_FALSE='#' else MAKE_OPENSSL_TRUE='#' MAKE_OPENSSL_FALSE= fi # Check whether --enable-demos was given. if test "${enable_demos+set}" = set; then : enableval=$enable_demos; enable_demos=$enableval else enable_demos=enable_demos fi if test "$enable_demos" = "enable_demos"; then MAKE_DEMOS_TRUE= MAKE_DEMOS_FALSE='#' else MAKE_DEMOS_TRUE='#' MAKE_DEMOS_FALSE= fi # Check whether --enable-unittest was given. if test "${enable_unittest+set}" = set; then : enableval=$enable_unittest; enable_unittest=$enableval else enable_unittest=enable_unittest fi if test "$enable_unittest" = "enable_unittest"; then MAKE_UNITTEST_TRUE= MAKE_UNITTEST_FALSE='#' else MAKE_UNITTEST_TRUE='#' MAKE_UNITTEST_FALSE= fi ac_config_files="$ac_config_files cxxtools-config" ac_config_files="$ac_config_files Makefile src/Makefile src/unit/Makefile src/http/Makefile src/xmlrpc/Makefile src/bin/Makefile src/json/Makefile include/Makefile tools/Makefile demo/Makefile demo/async/Makefile demo/ssl/Makefile test/Makefile" ac_config_files="$ac_config_files pkgconfig/cxxtools-bin.pc pkgconfig/cxxtools-http.pc pkgconfig/cxxtools-json.pc pkgconfig/cxxtools.pc pkgconfig/cxxtools-unit.pc pkgconfig/cxxtools-xmlrpc.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ICONVSTREAM_TRUE}" && test -z "${MAKE_ICONVSTREAM_FALSE}"; then as_fn_error $? "conditional \"MAKE_ICONVSTREAM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_OPENSSL_TRUE}" && test -z "${MAKE_OPENSSL_FALSE}"; then as_fn_error $? "conditional \"MAKE_OPENSSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_DEMOS_TRUE}" && test -z "${MAKE_DEMOS_FALSE}"; then as_fn_error $? "conditional \"MAKE_DEMOS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_UNITTEST_TRUE}" && test -z "${MAKE_UNITTEST_FALSE}"; then as_fn_error $? "conditional \"MAKE_UNITTEST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by cxxtools $as_me 3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to >." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ cxxtools config.status 3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "include/cxxtools/config.h") CONFIG_FILES="$CONFIG_FILES include/cxxtools/config.h" ;; "cxxtools-config") CONFIG_FILES="$CONFIG_FILES cxxtools-config" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/unit/Makefile") CONFIG_FILES="$CONFIG_FILES src/unit/Makefile" ;; "src/http/Makefile") CONFIG_FILES="$CONFIG_FILES src/http/Makefile" ;; "src/xmlrpc/Makefile") CONFIG_FILES="$CONFIG_FILES src/xmlrpc/Makefile" ;; "src/bin/Makefile") CONFIG_FILES="$CONFIG_FILES src/bin/Makefile" ;; "src/json/Makefile") CONFIG_FILES="$CONFIG_FILES src/json/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "demo/Makefile") CONFIG_FILES="$CONFIG_FILES demo/Makefile" ;; "demo/async/Makefile") CONFIG_FILES="$CONFIG_FILES demo/async/Makefile" ;; "demo/ssl/Makefile") CONFIG_FILES="$CONFIG_FILES demo/ssl/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "pkgconfig/cxxtools-bin.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-bin.pc" ;; "pkgconfig/cxxtools-http.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-http.pc" ;; "pkgconfig/cxxtools-json.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-json.pc" ;; "pkgconfig/cxxtools.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools.pc" ;; "pkgconfig/cxxtools-unit.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-unit.pc" ;; "pkgconfig/cxxtools-xmlrpc.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-xmlrpc.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "cxxtools-config":F) chmod +x cxxtools-config ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cxxtools-3.0/config.sub0000755000175000017500000007530413644433103012155 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # This file 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; either version 3 of the License, or # (at your option) any later version. # # 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. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type IFS="-" read -r field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any patern case $field1-$field2 in decstation-3100) basic_machine=mips-dec os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; alliant) basic_machine=fx80-alliant os= ;; altos | altos3068) basic_machine=m68k-altos os= ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; amiga) basic_machine=m68k-unknown os= ;; amigaos | amigados) basic_machine=m68k-unknown os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=sysv4 ;; apollo68) basic_machine=m68k-apollo os=sysv ;; apollo68bsd) basic_machine=m68k-apollo os=bsd ;; aros) basic_machine=i386-pc os=aros ;; aux) basic_machine=m68k-apple os=aux ;; balance) basic_machine=ns32k-sequent os=dynix ;; blackfin) basic_machine=bfin-unknown os=linux ;; cegcc) basic_machine=arm-unknown os=cegcc ;; convex-c1) basic_machine=c1-convex os=bsd ;; convex-c2) basic_machine=c2-convex os=bsd ;; convex-c32) basic_machine=c32-convex os=bsd ;; convex-c34) basic_machine=c34-convex os=bsd ;; convex-c38) basic_machine=c38-convex os=bsd ;; cray) basic_machine=j90-cray os=unicos ;; crds | unos) basic_machine=m68k-crds os= ;; da30) basic_machine=m68k-da30 os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec os= ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; h8300hms) basic_machine=h8300-hitachi os=hms ;; h8300xray) basic_machine=h8300-hitachi os=xray ;; h8500hms) basic_machine=h8500-hitachi os=hms ;; harris) basic_machine=m88k-harris os=sysv3 ;; hp300) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=bsd ;; hp300hpux) basic_machine=m68k-hp os=hpux ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; vsta) basic_machine=i386-pc os=vsta ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-pc os=msys ;; mvs) basic_machine=i370-ibm os=mvs ;; nacl) basic_machine=le32-unknown os=nacl ;; ncr3000) basic_machine=i486-ncr os=sysv4 ;; netbsd386) basic_machine=i386-pc os=netbsd ;; netwinder) basic_machine=armv4l-rebel os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=newsos ;; news1000) basic_machine=m68030-sony os=newsos ;; necv70) basic_machine=v70-nec os=sysv ;; nh3000) basic_machine=m68k-harris os=cxux ;; nh[45]000) basic_machine=m88k-harris os=cxux ;; nindy960) basic_machine=i960-intel os=nindy ;; mon960) basic_machine=i960-intel os=mon960 ;; nonstopux) basic_machine=mips-compaq os=nonstopux ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; pw32) basic_machine=i586-unknown os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=rdos ;; rdos32) basic_machine=i386-pc os=rdos ;; rom68k) basic_machine=m68k-rom68k os=coff ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sequent) basic_machine=i386-sequent os= ;; sps7) basic_machine=m68k-bull os=sysv2 ;; st2000) basic_machine=m68k-tandem os= ;; stratus) basic_machine=i860-stratus os=sysv4 ;; sun2) basic_machine=m68000-sun os= ;; sun2os3) basic_machine=m68000-sun os=sunos3 ;; sun2os4) basic_machine=m68000-sun os=sunos4 ;; sun3) basic_machine=m68k-sun os= ;; sun3os3) basic_machine=m68k-sun os=sunos3 ;; sun3os4) basic_machine=m68k-sun os=sunos4 ;; sun4) basic_machine=sparc-sun os= ;; sun4os3) basic_machine=sparc-sun os=sunos3 ;; sun4os4) basic_machine=sparc-sun os=sunos4 ;; sun4sol2) basic_machine=sparc-sun os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun os= ;; sv1) basic_machine=sv1-cray os=unicos ;; symmetry) basic_machine=i386-sequent os=dynix ;; t3e) basic_machine=alphaev5-cray os=unicos ;; t90) basic_machine=t90-cray os=unicos ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; tpf) basic_machine=s390x-ibm os=tpf ;; udi29k) basic_machine=a29k-amd os=udi ;; ultra3) basic_machine=a29k-nyu os=sym1 ;; v810 | necv810) basic_machine=v810-nec os=none ;; vaxv) basic_machine=vax-dec os=sysv ;; vms) basic_machine=vax-dec os=vms ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi os=${os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray os=${os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony os=newsos ;; next | m*-next) cpu=m68k vendor=next case $os in nextstep* ) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde os=${os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) IFS="-" read -r cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x$os != x ] then case $os in # First match some system type aliases that might get confused # with valid system types. # solaris* is a basic system type, with this one exception. auroraux) os=auroraux ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # sysv* is not here because it comes later, after sysvr4. gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $cpu in x86 | i*86) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; utek*) os=bsd ;; dynix*) os=bsd ;; acis*) os=aos ;; atheos*) os=atheos ;; syllable*) os=syllable ;; 386bsd) os=bsd ;; ctix* | uts*) os=sysv ;; nova*) os=rtmk-nova ;; ns2) os=nextstep2 ;; nsk*) os=nsk ;; # Preserve the version number of sinix5. sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; sinix*) os=sysv4 ;; tpf*) os=tpf ;; triton*) os=sysv3 ;; oss*) os=sysv3 ;; svr4*) os=sysv4 ;; svr3) os=sysv3 ;; sysvr4) os=sysv4 ;; # This must come after sysvr4. sysv*) ;; ose*) os=ose ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $cpu in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; none) ;; *-eabi) ;; *) echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $cpu-$vendor in score-*) os=elf ;; spu-*) os=elf ;; *-acorn) os=riscix1.2 ;; arm*-rebel) os=linux ;; arm*-semi) os=aout ;; c4x-* | tic4x-*) os=coff ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; hexagon-*) os=elf ;; tic54x-*) os=coff ;; tic55x-*) os=coff ;; tic6x-*) os=coff ;; # This must come before the *-dec entry. pdp10-*) os=tops20 ;; pdp11-*) os=none ;; *-dec | vax-*) os=ultrix4.2 ;; m68*-apollo) os=domain ;; i386-sun) os=sunos4.0.2 ;; m68000-sun) os=sunos3 ;; m68*-cisco) os=aout ;; mep-*) os=elf ;; mips*-cisco) os=elf ;; mips*-*) os=elf ;; or32-*) os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 ;; sparc-* | *-sun) os=sunos4.1.1 ;; pru-*) os=elf ;; *-be) os=beos ;; *-ibm) os=aix ;; *-knuth) os=mmixware ;; *-wec) os=proelf ;; *-winbond) os=proelf ;; *-oki) os=proelf ;; *-hp) os=hpux ;; *-hitachi) os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=sysv ;; *-cbm) os=amigaos ;; *-dg) os=dgux ;; *-dolphin) os=sysv3 ;; m68k-ccur) os=rtu ;; m88k-omron*) os=luna ;; *-next) os=nextstep ;; *-sequent) os=ptx ;; *-crds) os=unos ;; *-ns) os=genix ;; i370-*) os=mvs ;; *-gould) os=sysv ;; *-highlevel) os=bsd ;; *-encore) os=bsd ;; *-sgi) os=irix ;; *-siemens) os=sysv4 ;; *-masscomp) os=rtu ;; f30[01]-fujitsu | f700-fujitsu) os=uxpv ;; *-rom68k) os=coff ;; *-*bug) os=coff ;; *-apple) os=macos ;; *-atari*) os=mint ;; *-wrs) os=vxworks ;; *) os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $os in riscix*) vendor=acorn ;; sunos*) vendor=sun ;; cnk*|-aix*) vendor=ibm ;; beos*) vendor=be ;; hpux*) vendor=hp ;; mpeix*) vendor=hp ;; hiux*) vendor=hitachi ;; unos*) vendor=crds ;; dgux*) vendor=dg ;; luna*) vendor=omron ;; genix*) vendor=ns ;; clix*) vendor=intergraph ;; mvs* | opened*) vendor=ibm ;; os400*) vendor=ibm ;; ptx*) vendor=sequent ;; tpf*) vendor=ibm ;; vxsim* | vxworks* | windiss*) vendor=wrs ;; aux*) vendor=apple ;; hms*) vendor=hitachi ;; mpw* | macos*) vendor=apple ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: cxxtools-3.0/aclocal.m40000664000175000017500000012235413644433102012031 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/acx_pthread.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_compiler_vendor.m4]) m4_include([m4/ax_cxx_compile_stdcxx_11.m4]) m4_include([m4/iconv.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) cxxtools-3.0/include/0000775000175000017500000000000013672344760011701 500000000000000cxxtools-3.0/include/Makefile.in0000664000175000017500000007420613644433103013664 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @MAKE_ICONVSTREAM_TRUE@am__append_1 = \ @MAKE_ICONVSTREAM_TRUE@ cxxtools/iconverter.h \ @MAKE_ICONVSTREAM_TRUE@ cxxtools/iconvstream.h \ @MAKE_ICONVSTREAM_TRUE@ cxxtools/iconvwrap.h subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/iconv.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) DIST_COMMON = $(srcdir)/Makefile.am $(am__nobase_include_HEADERS_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/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 = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__nobase_include_HEADERS_DIST = cxxtools/application.h \ cxxtools/arg.h cxxtools/argin.h cxxtools/argout.h \ cxxtools/base64codec.h cxxtools/base64stream.h \ cxxtools/bin/bin.h cxxtools/bin/deserializer.h \ cxxtools/bin/formatter.h cxxtools/bin/serializer.h \ cxxtools/bin/rpcclient.h cxxtools/bin/rpcserver.h \ cxxtools/bin/parser.h cxxtools/byteorder.h cxxtools/cache.h \ cxxtools/callable.h cxxtools/callable.tpp cxxtools/composer.h \ cxxtools/csv.h cxxtools/csvdeserializer.h \ cxxtools/csvformatter.h cxxtools/csvparser.h \ cxxtools/csvserializer.h cxxtools/char.h \ cxxtools/charmapcodec.h cxxtools/cgi.h cxxtools/clock.h \ cxxtools/condition.h cxxtools/connectable.h \ cxxtools/connection.h cxxtools/constmethod.h \ cxxtools/constmethod.tpp cxxtools/conversionerror.h \ cxxtools/convert.h cxxtools/date.h cxxtools/datetime.h \ cxxtools/decomposer.h cxxtools/delegate.h \ cxxtools/delegate.tpp cxxtools/deserializer.h cxxtools/dir.h \ cxxtools/directory.h cxxtools/dlloader.h cxxtools/envsubst.h \ cxxtools/event.h cxxtools/eventloop.h cxxtools/eventsink.h \ cxxtools/eventsource.h cxxtools/facets.h cxxtools/fdstream.h \ cxxtools/formatter.h cxxtools/file.h cxxtools/filedevice.h \ cxxtools/fileinfo.h cxxtools/function.h cxxtools/function.tpp \ cxxtools/hexdump.h cxxtools/hdstream.h cxxtools/hmac.h \ cxxtools/http/client.h cxxtools/http/messageheader.h \ cxxtools/http/reply.h cxxtools/http/replyheader.h \ cxxtools/http/request.h cxxtools/http/requestheader.h \ cxxtools/http/server.h cxxtools/http/service.h \ cxxtools/http/responder.h cxxtools/inideserializer.h \ cxxtools/ini.h cxxtools/inifile.h cxxtools/iniparser.h \ cxxtools/iniserializer.h cxxtools/invokable.h \ cxxtools/invokable.tpp cxxtools/ioerror.h cxxtools/iodevice.h \ cxxtools/iostream.h cxxtools/iso8859_1codec.h \ cxxtools/iso8859_2codec.h cxxtools/iso8859_3codec.h \ cxxtools/iso8859_4codec.h cxxtools/iso8859_5codec.h \ cxxtools/iso8859_6codec.h cxxtools/iso8859_7codec.h \ cxxtools/iso8859_8codec.h cxxtools/iso8859_9codec.h \ cxxtools/iso8859_10codec.h cxxtools/iso8859_11codec.h \ cxxtools/iso8859_13codec.h cxxtools/iso8859_14codec.h \ cxxtools/iso8859_15codec.h cxxtools/iso8859_16codec.h \ cxxtools/join.h cxxtools/json.h cxxtools/json/httpclient.h \ cxxtools/json/httpservice.h cxxtools/json/request.h \ cxxtools/json/responder.h cxxtools/json/rpcclient.h \ cxxtools/json/rpcserver.h cxxtools/jsondeserializer.h \ cxxtools/jsonformatter.h cxxtools/jsonparser.h \ cxxtools/jsonserializer.h cxxtools/library.h \ cxxtools/limitstream.h cxxtools/lrucache.h cxxtools/log.h \ cxxtools/main.h cxxtools/md5.h cxxtools/md5stream.h \ cxxtools/method.h cxxtools/method.tpp cxxtools/mime.h \ cxxtools/multifstream.h cxxtools/mutex.h \ cxxtools/net/addrinfo.h cxxtools/net/net.h \ cxxtools/net/tcpserver.h cxxtools/net/tcpsocket.h \ cxxtools/net/tcpstream.h cxxtools/net/udp.h \ cxxtools/net/udpstream.h cxxtools/net/uri.h \ cxxtools/noncopyable.h cxxtools/pipe.h cxxtools/pool.h \ cxxtools/posix/commandinput.h cxxtools/posix/commandoutput.h \ cxxtools/posix/daemonize.h cxxtools/posix/exec.h \ cxxtools/posix/fork.h cxxtools/posix/pipe.h \ cxxtools/posix/pipestream.h cxxtools/properties.h \ cxxtools/propertiesdeserializer.h \ cxxtools/propertiesserializer.h cxxtools/propertiesfile.h \ cxxtools/propertiesparser.h cxxtools/ptrstreambuf.h \ cxxtools/ptrstream.h cxxtools/query_params.h cxxtools/queue.h \ cxxtools/quotedprintablecodec.h \ cxxtools/quotedprintablestream.h cxxtools/refcounted.h \ cxxtools/regex.h cxxtools/remoteclient.h \ cxxtools/remoteexception.h cxxtools/remoteprocedure.h \ cxxtools/remoteresult.h cxxtools/resetter.h \ cxxtools/scopedincrement.h cxxtools/selector.h \ cxxtools/selectable.h cxxtools/semaphore.h \ cxxtools/serializationerror.h cxxtools/serializationinfo.h \ cxxtools/serviceprocedure.h cxxtools/serviceregistry.h \ cxxtools/settings.h cxxtools/split.h cxxtools/signal.h \ cxxtools/signal.tpp cxxtools/singleton.h cxxtools/slot.h \ cxxtools/slot.tpp cxxtools/smartptr.h cxxtools/sourceinfo.h \ cxxtools/sslcertificate.h cxxtools/stddevice.h \ cxxtools/stdstream.h cxxtools/streambuffer.h \ cxxtools/streamcounter.h cxxtools/string.h cxxtools/string.tpp \ cxxtools/stringstream.h cxxtools/systemerror.h cxxtools/tee.h \ cxxtools/textbuffer.h cxxtools/textcodec.h \ cxxtools/textstream.h cxxtools/thread.h cxxtools/threadpool.h \ cxxtools/time.h cxxtools/timer.h cxxtools/timespan.h \ cxxtools/trim.h cxxtools/typetraits.h cxxtools/tz.h \ cxxtools/utf8.h cxxtools/utf8codec.h cxxtools/uuencode.h \ cxxtools/void.h cxxtools/win1252codec.h \ cxxtools/log/cxxtools.h cxxtools/unit/application.h \ cxxtools/unit/assertion.h cxxtools/unit/jsonreporter.h \ cxxtools/unit/registertest.h cxxtools/unit/reporter.h \ cxxtools/unit/test.h cxxtools/unit/testcase.h \ cxxtools/unit/testcontext.h cxxtools/unit/testfixture.h \ cxxtools/unit/testmain.h cxxtools/unit/testmethod.h \ cxxtools/unit/testprotocol.h cxxtools/unit/testsuite.h \ cxxtools/xml/attribute.h cxxtools/xml/characters.h \ cxxtools/xml/comment.h cxxtools/xml/doctypedeclaration.h \ cxxtools/xml/enddocument.h cxxtools/xml/endelement.h \ cxxtools/xml/entityresolver.h cxxtools/xml/namespace.h \ cxxtools/xml/namespacecontext.h cxxtools/xml/node.h \ cxxtools/xml/processinginstruction.h \ cxxtools/xml/startelement.h cxxtools/xml/xml.h \ cxxtools/xml/xmlerror.h cxxtools/xml/xmlformatter.h \ cxxtools/xml/xmldeserializer.h cxxtools/xml/xmlreader.h \ cxxtools/xml/xmlserializer.h cxxtools/xml/xmlwriter.h \ cxxtools/xmlrpc/client.h cxxtools/xmlrpc/errorcodes.h \ cxxtools/xmlrpc/httpclient.h cxxtools/xmlrpc/formatter.h \ cxxtools/xmlrpc/responder.h cxxtools/xmlrpc/scanner.h \ cxxtools/xmlrpc/service.h cxxtools/iconverter.h \ cxxtools/iconvstream.h cxxtools/iconvwrap.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)" HEADERS = $(nobase_include_HEADERS) $(nobase_nodist_include_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ 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@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ nobase_include_HEADERS = cxxtools/application.h cxxtools/arg.h \ cxxtools/argin.h cxxtools/argout.h cxxtools/base64codec.h \ cxxtools/base64stream.h cxxtools/bin/bin.h \ cxxtools/bin/deserializer.h cxxtools/bin/formatter.h \ cxxtools/bin/serializer.h cxxtools/bin/rpcclient.h \ cxxtools/bin/rpcserver.h cxxtools/bin/parser.h \ cxxtools/byteorder.h cxxtools/cache.h cxxtools/callable.h \ cxxtools/callable.tpp cxxtools/composer.h cxxtools/csv.h \ cxxtools/csvdeserializer.h cxxtools/csvformatter.h \ cxxtools/csvparser.h cxxtools/csvserializer.h cxxtools/char.h \ cxxtools/charmapcodec.h cxxtools/cgi.h cxxtools/clock.h \ cxxtools/condition.h cxxtools/connectable.h \ cxxtools/connection.h cxxtools/constmethod.h \ cxxtools/constmethod.tpp cxxtools/conversionerror.h \ cxxtools/convert.h cxxtools/date.h cxxtools/datetime.h \ cxxtools/decomposer.h cxxtools/delegate.h \ cxxtools/delegate.tpp cxxtools/deserializer.h cxxtools/dir.h \ cxxtools/directory.h cxxtools/dlloader.h cxxtools/envsubst.h \ cxxtools/event.h cxxtools/eventloop.h cxxtools/eventsink.h \ cxxtools/eventsource.h cxxtools/facets.h cxxtools/fdstream.h \ cxxtools/formatter.h cxxtools/file.h cxxtools/filedevice.h \ cxxtools/fileinfo.h cxxtools/function.h cxxtools/function.tpp \ cxxtools/hexdump.h cxxtools/hdstream.h cxxtools/hmac.h \ cxxtools/http/client.h cxxtools/http/messageheader.h \ cxxtools/http/reply.h cxxtools/http/replyheader.h \ cxxtools/http/request.h cxxtools/http/requestheader.h \ cxxtools/http/server.h cxxtools/http/service.h \ cxxtools/http/responder.h cxxtools/inideserializer.h \ cxxtools/ini.h cxxtools/inifile.h cxxtools/iniparser.h \ cxxtools/iniserializer.h cxxtools/invokable.h \ cxxtools/invokable.tpp cxxtools/ioerror.h cxxtools/iodevice.h \ cxxtools/iostream.h cxxtools/iso8859_1codec.h \ cxxtools/iso8859_2codec.h cxxtools/iso8859_3codec.h \ cxxtools/iso8859_4codec.h cxxtools/iso8859_5codec.h \ cxxtools/iso8859_6codec.h cxxtools/iso8859_7codec.h \ cxxtools/iso8859_8codec.h cxxtools/iso8859_9codec.h \ cxxtools/iso8859_10codec.h cxxtools/iso8859_11codec.h \ cxxtools/iso8859_13codec.h cxxtools/iso8859_14codec.h \ cxxtools/iso8859_15codec.h cxxtools/iso8859_16codec.h \ cxxtools/join.h cxxtools/json.h cxxtools/json/httpclient.h \ cxxtools/json/httpservice.h cxxtools/json/request.h \ cxxtools/json/responder.h cxxtools/json/rpcclient.h \ cxxtools/json/rpcserver.h cxxtools/jsondeserializer.h \ cxxtools/jsonformatter.h cxxtools/jsonparser.h \ cxxtools/jsonserializer.h cxxtools/library.h \ cxxtools/limitstream.h cxxtools/lrucache.h cxxtools/log.h \ cxxtools/main.h cxxtools/md5.h cxxtools/md5stream.h \ cxxtools/method.h cxxtools/method.tpp cxxtools/mime.h \ cxxtools/multifstream.h cxxtools/mutex.h \ cxxtools/net/addrinfo.h cxxtools/net/net.h \ cxxtools/net/tcpserver.h cxxtools/net/tcpsocket.h \ cxxtools/net/tcpstream.h cxxtools/net/udp.h \ cxxtools/net/udpstream.h cxxtools/net/uri.h \ cxxtools/noncopyable.h cxxtools/pipe.h cxxtools/pool.h \ cxxtools/posix/commandinput.h cxxtools/posix/commandoutput.h \ cxxtools/posix/daemonize.h cxxtools/posix/exec.h \ cxxtools/posix/fork.h cxxtools/posix/pipe.h \ cxxtools/posix/pipestream.h cxxtools/properties.h \ cxxtools/propertiesdeserializer.h \ cxxtools/propertiesserializer.h cxxtools/propertiesfile.h \ cxxtools/propertiesparser.h cxxtools/ptrstreambuf.h \ cxxtools/ptrstream.h cxxtools/query_params.h cxxtools/queue.h \ cxxtools/quotedprintablecodec.h \ cxxtools/quotedprintablestream.h cxxtools/refcounted.h \ cxxtools/regex.h cxxtools/remoteclient.h \ cxxtools/remoteexception.h cxxtools/remoteprocedure.h \ cxxtools/remoteresult.h cxxtools/resetter.h \ cxxtools/scopedincrement.h cxxtools/selector.h \ cxxtools/selectable.h cxxtools/semaphore.h \ cxxtools/serializationerror.h cxxtools/serializationinfo.h \ cxxtools/serviceprocedure.h cxxtools/serviceregistry.h \ cxxtools/settings.h cxxtools/split.h cxxtools/signal.h \ cxxtools/signal.tpp cxxtools/singleton.h cxxtools/slot.h \ cxxtools/slot.tpp cxxtools/smartptr.h cxxtools/sourceinfo.h \ cxxtools/sslcertificate.h cxxtools/stddevice.h \ cxxtools/stdstream.h cxxtools/streambuffer.h \ cxxtools/streamcounter.h cxxtools/string.h cxxtools/string.tpp \ cxxtools/stringstream.h cxxtools/systemerror.h cxxtools/tee.h \ cxxtools/textbuffer.h cxxtools/textcodec.h \ cxxtools/textstream.h cxxtools/thread.h cxxtools/threadpool.h \ cxxtools/time.h cxxtools/timer.h cxxtools/timespan.h \ cxxtools/trim.h cxxtools/typetraits.h cxxtools/tz.h \ cxxtools/utf8.h cxxtools/utf8codec.h cxxtools/uuencode.h \ cxxtools/void.h cxxtools/win1252codec.h \ cxxtools/log/cxxtools.h cxxtools/unit/application.h \ cxxtools/unit/assertion.h cxxtools/unit/jsonreporter.h \ cxxtools/unit/registertest.h cxxtools/unit/reporter.h \ cxxtools/unit/test.h cxxtools/unit/testcase.h \ cxxtools/unit/testcontext.h cxxtools/unit/testfixture.h \ cxxtools/unit/testmain.h cxxtools/unit/testmethod.h \ cxxtools/unit/testprotocol.h cxxtools/unit/testsuite.h \ cxxtools/xml/attribute.h cxxtools/xml/characters.h \ cxxtools/xml/comment.h cxxtools/xml/doctypedeclaration.h \ cxxtools/xml/enddocument.h cxxtools/xml/endelement.h \ cxxtools/xml/entityresolver.h cxxtools/xml/namespace.h \ cxxtools/xml/namespacecontext.h cxxtools/xml/node.h \ cxxtools/xml/processinginstruction.h \ cxxtools/xml/startelement.h cxxtools/xml/xml.h \ cxxtools/xml/xmlerror.h cxxtools/xml/xmlformatter.h \ cxxtools/xml/xmldeserializer.h cxxtools/xml/xmlreader.h \ cxxtools/xml/xmlserializer.h cxxtools/xml/xmlwriter.h \ cxxtools/xmlrpc/client.h cxxtools/xmlrpc/errorcodes.h \ cxxtools/xmlrpc/httpclient.h cxxtools/xmlrpc/formatter.h \ cxxtools/xmlrpc/responder.h cxxtools/xmlrpc/scanner.h \ cxxtools/xmlrpc/service.h $(am__append_1) nobase_nodist_include_HEADERS = \ cxxtools/config.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-nobase_nodist_includeHEADERS: $(nobase_nodist_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi 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 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_includeHEADERS \ install-nobase_nodist_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_includeHEADERS \ uninstall-nobase_nodist_includeHEADERS .MAKE: install-am install-strip .PHONY: 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-nobase_includeHEADERS \ install-nobase_nodist_includeHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-nobase_includeHEADERS \ uninstall-nobase_nodist_includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cxxtools-3.0/include/Makefile.am0000664000175000017500000001752413644433072013660 00000000000000nobase_include_HEADERS = \ cxxtools/application.h \ cxxtools/arg.h \ cxxtools/argin.h \ cxxtools/argout.h \ cxxtools/base64codec.h \ cxxtools/base64stream.h \ cxxtools/bin/bin.h \ cxxtools/bin/deserializer.h \ cxxtools/bin/formatter.h \ cxxtools/bin/serializer.h \ cxxtools/bin/rpcclient.h \ cxxtools/bin/rpcserver.h \ cxxtools/bin/parser.h \ cxxtools/byteorder.h \ cxxtools/cache.h \ cxxtools/callable.h \ cxxtools/callable.tpp \ cxxtools/composer.h \ cxxtools/csv.h \ cxxtools/csvdeserializer.h \ cxxtools/csvformatter.h \ cxxtools/csvparser.h \ cxxtools/csvserializer.h \ cxxtools/char.h \ cxxtools/charmapcodec.h \ cxxtools/cgi.h \ cxxtools/clock.h \ cxxtools/condition.h \ cxxtools/connectable.h \ cxxtools/connection.h \ cxxtools/constmethod.h \ cxxtools/constmethod.tpp \ cxxtools/conversionerror.h \ cxxtools/convert.h \ cxxtools/date.h\ cxxtools/datetime.h \ cxxtools/decomposer.h \ cxxtools/delegate.h \ cxxtools/delegate.tpp \ cxxtools/deserializer.h \ cxxtools/dir.h \ cxxtools/directory.h \ cxxtools/dlloader.h \ cxxtools/envsubst.h \ cxxtools/event.h \ cxxtools/eventloop.h \ cxxtools/eventsink.h \ cxxtools/eventsource.h \ cxxtools/facets.h \ cxxtools/fdstream.h \ cxxtools/formatter.h \ cxxtools/file.h \ cxxtools/filedevice.h \ cxxtools/fileinfo.h \ cxxtools/function.h \ cxxtools/function.tpp \ cxxtools/hexdump.h \ cxxtools/hdstream.h \ cxxtools/hmac.h \ cxxtools/http/client.h \ cxxtools/http/messageheader.h \ cxxtools/http/reply.h \ cxxtools/http/replyheader.h \ cxxtools/http/request.h \ cxxtools/http/requestheader.h \ cxxtools/http/server.h \ cxxtools/http/service.h \ cxxtools/http/responder.h \ cxxtools/inideserializer.h \ cxxtools/ini.h \ cxxtools/inifile.h \ cxxtools/iniparser.h \ cxxtools/iniserializer.h \ cxxtools/invokable.h \ cxxtools/invokable.tpp \ cxxtools/ioerror.h \ cxxtools/iodevice.h \ cxxtools/iostream.h \ cxxtools/iso8859_1codec.h \ cxxtools/iso8859_2codec.h \ cxxtools/iso8859_3codec.h \ cxxtools/iso8859_4codec.h \ cxxtools/iso8859_5codec.h \ cxxtools/iso8859_6codec.h \ cxxtools/iso8859_7codec.h \ cxxtools/iso8859_8codec.h \ cxxtools/iso8859_9codec.h \ cxxtools/iso8859_10codec.h \ cxxtools/iso8859_11codec.h \ cxxtools/iso8859_13codec.h \ cxxtools/iso8859_14codec.h \ cxxtools/iso8859_15codec.h \ cxxtools/iso8859_16codec.h \ cxxtools/join.h \ cxxtools/json.h \ cxxtools/json/httpclient.h \ cxxtools/json/httpservice.h \ cxxtools/json/request.h \ cxxtools/json/responder.h \ cxxtools/json/rpcclient.h \ cxxtools/json/rpcserver.h \ cxxtools/jsondeserializer.h \ cxxtools/jsonformatter.h \ cxxtools/jsonparser.h \ cxxtools/jsonserializer.h \ cxxtools/library.h \ cxxtools/limitstream.h \ cxxtools/lrucache.h \ cxxtools/log.h \ cxxtools/main.h \ cxxtools/md5.h \ cxxtools/md5stream.h \ cxxtools/method.h \ cxxtools/method.tpp \ cxxtools/mime.h \ cxxtools/multifstream.h \ cxxtools/mutex.h \ cxxtools/net/addrinfo.h \ cxxtools/net/net.h \ cxxtools/net/tcpserver.h \ cxxtools/net/tcpsocket.h \ cxxtools/net/tcpstream.h \ cxxtools/net/udp.h \ cxxtools/net/udpstream.h \ cxxtools/net/uri.h \ cxxtools/noncopyable.h \ cxxtools/pipe.h \ cxxtools/pool.h \ cxxtools/posix/commandinput.h \ cxxtools/posix/commandoutput.h \ cxxtools/posix/daemonize.h\ cxxtools/posix/exec.h \ cxxtools/posix/fork.h \ cxxtools/posix/pipe.h \ cxxtools/posix/pipestream.h \ cxxtools/properties.h \ cxxtools/propertiesdeserializer.h \ cxxtools/propertiesserializer.h \ cxxtools/propertiesfile.h \ cxxtools/propertiesparser.h \ cxxtools/ptrstreambuf.h \ cxxtools/ptrstream.h \ cxxtools/query_params.h \ cxxtools/queue.h \ cxxtools/quotedprintablecodec.h \ cxxtools/quotedprintablestream.h \ cxxtools/refcounted.h \ cxxtools/regex.h \ cxxtools/remoteclient.h \ cxxtools/remoteexception.h \ cxxtools/remoteprocedure.h \ cxxtools/remoteresult.h \ cxxtools/resetter.h \ cxxtools/scopedincrement.h \ cxxtools/selector.h \ cxxtools/selectable.h \ cxxtools/semaphore.h \ cxxtools/serializationerror.h \ cxxtools/serializationinfo.h \ cxxtools/serviceprocedure.h \ cxxtools/serviceregistry.h \ cxxtools/settings.h \ cxxtools/split.h \ cxxtools/signal.h \ cxxtools/signal.tpp \ cxxtools/singleton.h \ cxxtools/slot.h \ cxxtools/slot.tpp \ cxxtools/smartptr.h \ cxxtools/sourceinfo.h \ cxxtools/sslcertificate.h \ cxxtools/stddevice.h \ cxxtools/stdstream.h \ cxxtools/streambuffer.h \ cxxtools/streamcounter.h \ cxxtools/string.h \ cxxtools/string.tpp \ cxxtools/stringstream.h \ cxxtools/systemerror.h \ cxxtools/tee.h \ cxxtools/textbuffer.h \ cxxtools/textcodec.h \ cxxtools/textstream.h \ cxxtools/thread.h \ cxxtools/threadpool.h \ cxxtools/time.h \ cxxtools/timer.h \ cxxtools/timespan.h \ cxxtools/trim.h \ cxxtools/typetraits.h \ cxxtools/tz.h \ cxxtools/utf8.h \ cxxtools/utf8codec.h \ cxxtools/uuencode.h \ cxxtools/void.h \ cxxtools/win1252codec.h \ cxxtools/log/cxxtools.h \ cxxtools/unit/application.h \ cxxtools/unit/assertion.h \ cxxtools/unit/jsonreporter.h \ cxxtools/unit/registertest.h \ cxxtools/unit/reporter.h \ cxxtools/unit/test.h \ cxxtools/unit/testcase.h \ cxxtools/unit/testcontext.h \ cxxtools/unit/testfixture.h \ cxxtools/unit/testmain.h \ cxxtools/unit/testmethod.h \ cxxtools/unit/testprotocol.h \ cxxtools/unit/testsuite.h \ cxxtools/xml/attribute.h \ cxxtools/xml/characters.h \ cxxtools/xml/comment.h \ cxxtools/xml/doctypedeclaration.h \ cxxtools/xml/enddocument.h \ cxxtools/xml/endelement.h \ cxxtools/xml/entityresolver.h \ cxxtools/xml/namespace.h \ cxxtools/xml/namespacecontext.h \ cxxtools/xml/node.h \ cxxtools/xml/processinginstruction.h \ cxxtools/xml/startelement.h \ cxxtools/xml/xml.h \ cxxtools/xml/xmlerror.h \ cxxtools/xml/xmlformatter.h \ cxxtools/xml/xmldeserializer.h \ cxxtools/xml/xmlreader.h \ cxxtools/xml/xmlserializer.h \ cxxtools/xml/xmlwriter.h \ cxxtools/xmlrpc/client.h \ cxxtools/xmlrpc/errorcodes.h \ cxxtools/xmlrpc/httpclient.h \ cxxtools/xmlrpc/formatter.h \ cxxtools/xmlrpc/responder.h \ cxxtools/xmlrpc/scanner.h \ cxxtools/xmlrpc/service.h nobase_nodist_include_HEADERS = \ cxxtools/config.h if MAKE_ICONVSTREAM nobase_include_HEADERS += \ cxxtools/iconverter.h \ cxxtools/iconvstream.h \ cxxtools/iconvwrap.h endif cxxtools-3.0/include/cxxtools/0000775000175000017500000000000013672344760013564 500000000000000cxxtools-3.0/include/cxxtools/iostream.h0000664000175000017500000002244713644433072015503 00000000000000/* * Copyright (C) 2005-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_System_IOStream_h #define cxxtools_System_IOStream_h #include #include #include namespace cxxtools { //! @brief An istream with peeking capability. template class BasicIStream : public std::basic_istream { public: explicit BasicIStream(BasicStreamBuffer* buffer = 0) : std::basic_istream( buffer ), _buffer(buffer) { } ~BasicIStream() { } //! @brief Access to the underlying buffer. BasicStreamBuffer* attachedBuffer() { return _buffer; } BasicStreamBuffer* attachBuffer(BasicStreamBuffer* buffer) { BasicStreamBuffer* tmp = _buffer; _buffer = buffer; this->rdbuf(buffer); return tmp; } //! @brief Peeks bytes in the stream buffer. /** The number of bytes that can be peeked depends on the current stream buffer get area and maybe less than requested, similar to istream::readsome(). */ std::streamsize peeksome(CharT* buffer, std::streamsize n) { if(this->rdbuf() == _buffer) return _buffer->speekn(buffer, n); if(n > 0) { buffer[0] = this->peek(); return 1; } return 0; } private: BasicStreamBuffer* _buffer; }; //! @brief An ostream with peeking capability. template class BasicOStream : public std::basic_ostream { public: explicit BasicOStream(BasicStreamBuffer* buffer = 0) : std::basic_ostream( buffer ), _buffer(buffer) { } ~BasicOStream() {} //! @brief Access to the underlying buffer. BasicStreamBuffer* attachedBuffer() { return _buffer; } BasicStreamBuffer* attachBuffer(BasicStreamBuffer* buffer) { BasicStreamBuffer* tmp = _buffer; _buffer = buffer; this->rdbuf(buffer); return tmp; } std::streamsize writesome(CharT* buffer, std::streamsize n) { std::basic_streambuf* current = std::basic_ios::rdbuf(); if(current != _buffer) return 0; std::streamsize avail = _buffer->out_avail(); if(avail == 0) { return 0; } n = std::min(avail, n); return _buffer->sputn(buffer, n); } private: BasicStreamBuffer* _buffer; }; //! @brief An iostream with peeking capability. template class BasicIOStream : public std::basic_iostream { public: explicit BasicIOStream(BasicStreamBuffer* buffer = 0) : std::basic_iostream( buffer ), _buffer(buffer) { } ~BasicIOStream() { } //! @brief Access to the underlying buffer. BasicStreamBuffer* attachedBuffer() { return _buffer; } BasicStreamBuffer* attachBuffer(BasicStreamBuffer* buffer) { BasicStreamBuffer* tmp = _buffer; _buffer = buffer; this->rdbuf(buffer); return tmp; } //! @brief Peeks bytes in the stream buffer. /** The number of bytes that can be peeked depends on the current stream buffer get area and maybe less than requested, similar to istream::readsome(). */ std::streamsize peeksome(CharT* buffer, std::streamsize n) { if(this->rdbuf() == _buffer) return _buffer->speekn(buffer, n); if(n > 0) { buffer[0] = this->peek(); return 1; } return 0; } std::streamsize writesome(CharT* buffer, std::streamsize n) { std::basic_streambuf* current = std::basic_ios::rdbuf(); if(current != _buffer) return 0; std::streamsize avail = _buffer->out_avail(); if(avail == 0) { return 0; } n = std::min(avail, n); return _buffer->sputn(buffer, n); } private: BasicStreamBuffer* _buffer; }; class IStream : public BasicIStream, public Connectable { public: explicit IStream(size_t bufferSize = 8192); ~IStream(); explicit IStream(IODevice& device, size_t bufferSize = 8192); // needed to avoid confusion. // clear is defined in Connectable also void clear() { BasicIStream::clear(); } StreamBuffer& buffer() { return _buffer; } std::streamsize in_avail() { return buffer().in_avail(); } IODevice* attachDevice(IODevice& device); IODevice* attachedDevice() { return _buffer.device(); } void setSelector(SelectorBase* parent) { attachedDevice()->setSelector(parent); } void setSelector(SelectorBase& parent) { attachedDevice()->setSelector(parent); } void beginRead() { buffer().beginRead(); } void endRead(); Signal inputReady; private: void onInput(StreamBuffer&); void onOutput(StreamBuffer&); StreamBuffer _buffer; }; class OStream : public BasicOStream, public Connectable { public: explicit OStream(size_t bufferSize = 8192, bool extend = false); explicit OStream(IODevice& device, size_t bufferSize = 8192, bool extend = false); ~OStream(); // needed to avoid confusion. // clear is defined in Connectable also void clear() { BasicOStream::clear(); } StreamBuffer& buffer() { return _buffer; } std::streamsize out_avail() { return buffer().out_avail(); } IODevice* attachDevice(IODevice& device); IODevice* attachedDevice() { return _buffer.device(); } void setSelector(SelectorBase* parent) { attachedDevice()->setSelector(parent); } void setSelector(SelectorBase& parent) { attachedDevice()->setSelector(parent); } void beginWrite() { buffer().beginWrite(); } void endWrite() { buffer().endWrite(); } Signal outputReady; private: void onOutput(StreamBuffer&); StreamBuffer _buffer; }; class IOStream : public BasicIOStream, public Connectable { public: explicit IOStream(size_t bufferSize = 8192, bool extend = false); explicit IOStream(IODevice& device, size_t bufferSize = 8192, bool extend = false); ~IOStream(); // needed to avoid confusion. // clear is defined in Connectable also void clear() { BasicIOStream::clear(); } StreamBuffer& buffer() { return _buffer; } std::streamsize in_avail() { return buffer().in_avail(); } std::streamsize out_avail() { return buffer().out_avail(); } IODevice* attachDevice(IODevice& device); IODevice* attachedDevice() { return _buffer.device(); } void setSelector(SelectorBase* parent) { attachedDevice()->setSelector(parent); } void setSelector(SelectorBase& parent) { attachedDevice()->setSelector(parent); } void beginRead() { buffer().beginRead(); } void endRead(); void beginWrite() { buffer().beginWrite(); } void endWrite() { buffer().endWrite(); } Signal inputReady; Signal outputReady; private: void onInput(StreamBuffer&); void onOutput(StreamBuffer&); StreamBuffer _buffer; }; } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/eventsink.h0000664000175000017500000000621413644433072015660 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_EVENTSINK_H #define CXXTOOLS_EVENTSINK_H #include #include #include namespace cxxtools { class EventSource; class EventSink { #if __cplusplus >= 201103L EventSink(const EventSink&) = delete; EventSink& operator=(const EventSink&) = delete; #else EventSink(const EventSink&) { } EventSink& operator=(const EventSink&) { return *this; } #endif friend class EventSource; public: EventSink(); virtual ~EventSink(); /// Puts a event in the queue but does not wake the loop. void queueEvent(const Event& event); /// Puts a event in the queue and wakes the loop so that the event is processed. void commitEvent(const Event& event); /// Puts a priority event in the queue but does not wake the loop. /// Priority events are processed before any non priority event. void queuePriorityEvent(const Event& event); /// Puts a priority event in the queue and wakes the loop so that the event is processed. /// Priority events are processed before any non priority event. void commitPriorityEvent(const Event& event); protected: virtual void onQueueEvent(const Event& event, bool priority) = 0; virtual void onCommitEvent(const Event& event, bool priority) = 0; private: void onConnect(EventSource& source); void onDisconnect(EventSource& source); void onUnsubscribe(EventSource& source); private: mutable RecursiveMutex _mutex; std::list _sources; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/invokable.h0000664000175000017500000000301413644433072015617 00000000000000/* * Copyright (C) 2005-2007 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Invokable_h #define cxxtools_Invokable_h #include namespace cxxtools { #include } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/csvdeserializer.h0000664000175000017500000000532413644433072017051 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVDESERIALIZER_H #define CXXTOOLS_CSVDESERIALIZER_H #include #include #include #include #include namespace cxxtools { class CsvDeserializer : public Deserializer { public: CsvDeserializer() { } Char delimiter() const { return _parser.delimiter(); } void delimiter(Char ch) { _parser.delimiter(ch); } bool readTitle() const { return _parser.readTitle(); } void readTitle(bool sw) { _parser.readTitle(sw); } static const Char autoDelimiter; void begin(); void advance(Char ch) { _parser.advance(ch); } void finish() { _parser.finish(); } void read(std::istream& in, TextCodec* codec = new Utf8Codec()); void read(std::basic_istream& in); template static void toObject(std::istream& in, T& type) { CsvDeserializer d; d.read(in); d.deserialize(type); } private: void doDeserialize(std::basic_istream& in); CsvParser _parser; }; } #endif // CXXTOOLS_CSVDESERIALIZER_H cxxtools-3.0/include/cxxtools/argout.h0000664000175000017500000000650513644433072015156 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STDOUT_H #define CXXTOOLS_STDOUT_H #include #include #include namespace cxxtools { /** * Helper class for redirecting output to stdout or file using command line switch. * * Using this class it is easy to provide a command line switch to the user * to redirect output to a file. * * Examples: * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgOut out(argc, argv, 'o'); * out << "this is printed to std::cout or to a file when a file name with the -o option is passed" << std::endl; * } * \endcode * * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgOut out(argc, argv); * out << "this is printed to std::cout or to a file when a file name is passed as a parameter" << std::endl; * } * \endcode * */ class ArgOut : public std::ostream { std::ofstream _ofile; void doInit(const Arg& arg) { std::streambuf* buf; if (arg.isSet()) { _ofile.open(arg); buf = _ofile.rdbuf(); } else buf = std::cout.rdbuf(); init(buf); } public: ArgOut(int& argc, char* argv[], char option) { Arg ofile(argc, argv, option); doInit(ofile); } ArgOut(int& argc, char* argv[], const char* option) { Arg ofile(argc, argv, option); doInit(ofile); } ArgOut(int& argc, char* argv[]) { Arg ofile(argc, argv); doInit(ofile); } bool redirected() const { return rdbuf() != std::cout.rdbuf(); } }; } #endif // CXXTOOLS_STDOUT_H cxxtools-3.0/include/cxxtools/invokable.tpp0000664000175000017500000001130013644433072016170 00000000000000// BEGIN_Invokable 10 /** Invokable is a type which can be "called" via the invoke() member. It serves as a base type for other types in the Pt signals/slots framework. */ template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const = 0; }; // END_Invokable 10 // BEGIN_Invokable 9 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const = 0; }; // END_Invokable 9 // BEGIN_Invokable 8 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const = 0; }; // END_Invokable 8 // BEGIN_Invokable 7 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const = 0; }; // END_Invokable 7 // BEGIN_Invokable 6 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const = 0; }; // END_Invokable 6 // BEGIN_Invokable 5 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const = 0; }; // END_Invokable 5 // BEGIN_Invokable 4 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4) const = 0; }; // END_Invokable 4 // BEGIN_Invokable 3 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3) const = 0; }; // END_Invokable 3 // BEGIN_Invokable 2 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2) const = 0; }; // END_Invokable 2 // BEGIN_Invokable 1 // specialization template class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1) const = 0; }; // END_Invokable 1 // BEGIN_Invokable 0 // specialization template <> class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke() const = 0; }; // END_Invokable 0 cxxtools-3.0/include/cxxtools/join.h0000664000175000017500000000553313644433072014614 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JOIN_H #define CXXTOOLS_JOIN_H #include #include namespace cxxtools { /** @brief Joins a list of tokens into a output stream using a delimiter. A list of tokens read from a range is printed to a out stream. The tokens are separated by a token. Example (prints "4, 17, 12"): \code std::vector v; v.push_back(4); v.push_back(17); v.push_back(12); join(v.begin(), v.end(), ", ", std::cout); \endcode */ template void join(inputIterator b, inputIterator e, const separatorType& sep, std::basic_ostream& out) { bool first = true; for (inputIterator it = b; it != e; ++it) { if (first) first = false; else out << sep; out << *it; } } /** @brief Joins a list of tokens into a std::string using a delimiter. This function is just like the other join function, but returns the result as a std::string. Example (prints "4, 17, 12"): \code std::vector v; v.push_back(4); v.push_back(17); v.push_back(12); std::cout << join(v.begin(), v.end(), ", "); \endcode */ template std::string join(inputIterator b, inputIterator e, const separatorType& sep) { std::ostringstream ret; join(b, e, sep, ret); return ret.str(); } } #endif cxxtools-3.0/include/cxxtools/connectable.h0000664000175000017500000001063113644433072016125 00000000000000/* * Copyright (C) 2004-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Connectable_h #define cxxtools_Connectable_h #include #include #include namespace cxxtools { /** @brief %Connection management for signal and slot objects @ingroup sigslot This class implements connection management for signal and slot objects. It makes sure that all connections where this object is involved are closed on destruction. Deriving classes can overload Connectable::opened and Connectable::closed to tune connection managenment. */ class Connectable { public: /** @brief Default constructor. Creates an empty %Connectable. */ Connectable() { } /** @brief Closes all connections. When a %Connectable object is destroyed, it closes all its connections automatically. */ virtual ~Connectable(); /** @brief Registers a Connection with the %Connectable. This function is called when a new Connection involving this object is opened. The default implementation adds the connection to a list, so the destructor can close it. @param c Connection being opened @return True if the Connection was accepted */ virtual void onConnectionOpen(const Connection& c); /** @brief Unregisters a Connection from the %Connectable. This function is called when a new Connection involving this object is closed. The default implementation removes the connection from its list of connections. @param c Connection being opened */ virtual void onConnectionClose(const Connection& c); //! @internal @brief For unit tests only. size_t connectionCount() const { return _connections.size(); } protected: /** @brief Copy constructor @sa Connectable::operator=() */ Connectable(const Connectable& /*c*/) { } /** @brief Assignment operator Connectables can be copy constructed if the derived class provides a public copy constructor. Copying a %Connectable will not change its connections. */ Connectable& operator=(const Connectable& /*rhs*/) { return *this; } /** @brief Returns a list of all current connections */ const std::list& connections() const { return _connections; } /** @brief Returns a list of all current connections */ std::list& connections() { return _connections; } protected: /** @brief A list of all current connections */ mutable std::list _connections; //! @internal void clear(); }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/byteorder.h0000664000175000017500000001043213644433072015646 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BYTEORDER_H #define CXXTOOLS_BYTEORDER_H #include #include #if __BYTE_ORDER == __LITTLE_ENDIAN #define CXXTOOLS_LITTLE_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN #define CXXTOOLS_BIG_ENDIAN #endif namespace cxxtools { /// helper class to change the byte order template class Reverser; /// @cond internal template class Reverser { public: T operator() (T value) { return value >> 8 & 0xff | value << 8 & 0xff00; } }; template class Reverser { public: T operator() (T value) { return value >> 24 & 0xff | value >> 8 & 0xff00 | value << 8 & 0xff0000 | value << 24 & 0xff000000; } }; template class Reverser { public: T operator() (T value) { return value >> 56 & 0xffll | value >> 40 & 0xff00ll | value >> 24 & 0xff0000ll | value >> 8 & 0xff000000ll | value << 8 & 0xff00000000ll | value << 24 & 0xff0000000000ll | value << 40 & 0xff000000000000ll | value << 56 & 0xff00000000000000ll; } }; /// @endcond internal /// Returns the value in reversed byte order. template T reverse(T value) { return Reverser() (value); } /// Returns true, if machine is big-endian (high byte first). /// e.g. PowerPC inline bool isBigEndian() { const int i = 1; return *reinterpret_cast(&i) == 0; } /// Returns true, if machine is little-endian (low byte first). /// e.g. x86 inline bool isLittleEndian() { const int i = 1; return *reinterpret_cast(&i) == 1; } /// Converts a native value in little endian. template T hostToLe(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return reverse(value); #elif defined(CXXTOOLS_LITTLE_ENDIAN) return value; #else return isBigEndian() ? reverse(value) : value; #endif } /// Converts a little endian value to native. template T leToHost(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return reverse(value); #elif defined(CXXTOOLS_LITTLE_ENDIAN) return value; #else return isBigEndian() ? reverse(value) : value; #endif } /// Converts a native value in big endian. template T hostToBe(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return value; #elif defined(CXXTOOLS_LITTLE_ENDIAN) return reverse(value); #else return isBigEndian() ? value : reverse(value); #endif } /// Converts a big endian value to native. template T beToHost(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return value; #elif defined(CXXTOOLS_LITTLE_ENDIAN) return reverse(value); #else return isBigEndian() ? value : reverse(value); #endif } } #endif // CXXTOOLS_BYTEORDER_H cxxtools-3.0/include/cxxtools/iso8859_7codec.h0000664000175000017500000000412213644433072016222 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_7CODEC_H #define CXXTOOLS_ISO8859_7CODEC_H #include namespace cxxtools { class Iso8859_7Codec : public CharMapCodec { public: explicit Iso8859_7Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/signal.tpp0000664000175000017500000020426713644433072015513 00000000000000// BEGIN_Signal 10 /** Multicast Signal A Signal can be connected to multiple targets. The return value of the target(s) is/are ignored. */ template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { this->send(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } }; // END_Signal 10 // BEGIN_SignalSlot 10 /** SignalSlot is a "slot wrapper" for Signal objects. That is, it effectively converts a Signal object into a Slot object, so that it can be used as the target of another Signal. This allows chaining of Signals. */ template class SignalSlot : public BasicSlot { public: /** Wraps signal. */ SignalSlot(Signal& signal) : _method( signal, &Signal::send ) {} /** Creates a clone of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new SignalSlot(*this); } /** Returns a pointer to this object's internal Callable object. */ virtual const void* callable() const { return &_method; } /** ??? */ virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } /** ??? */ virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } /** returns true if this object and rhs are equivalent. */ virtual bool equals(const Slot& rhs) const { const SignalSlot* ss = dynamic_cast(&rhs); return ss ? (_method == ss->_method) : false; } private: mutable ConstMethod,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10 > _method; }; /** Creates a SignalSlot object from an equivalent Signal. */ template SignalSlot slot( Signal & signal ) { return SignalSlot( signal ); } /** Connects the given signal and slot objects and returns that Connection object (which can normally be ignored). */ template Connection connect(Signal& signal, const BasicSlot& slot) { return signal.connect( slot ); } //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, const BasicSlot& slot) { return signal.disconnect( slot ); } template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 10 // BEGIN_Signal 9 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7,a8,a9); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { this->send(a1,a2,a3,a4,a5,a6,a7,a8,a9); } }; // END_Signal 9 // BEGIN_SignalSlot 9 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 9 // BEGIN_Signal 8 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7,a8); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { this->send(a1,a2,a3,a4,a5,a6,a7,a8); } }; // END_Signal 8 // BEGIN_SignalSlot 8 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 8 // BEGIN_Signal 7 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { this->send(a1,a2,a3,a4,a5,a6,a7); } }; // END_Signal 7 // BEGIN_SignalSlot 7 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, ClassT & object, R(BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 7 // BEGIN_Signal 6 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { this->send(a1,a2,a3,a4,a5,a6); } }; // END_Signal 6 // BEGIN_SignalSlot 6 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4,A5,A6)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 6 // BEGIN_Signal 5 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { this->send(a1,a2,a3,a4,a5); } }; // END_Signal 5 // BEGIN_SignalSlot 5 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4,A5)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4,A5)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 5 // BEGIN_Signal 4 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { this->send(a1,a2,a3,a4); } }; // END_Signal 4 // BEGIN_SignalSlot 4 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3,A4)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3,A4)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 4 // BEGIN_Signal 3 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2,a3); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3) const { this->send(a1,a2,a3); } }; // END_Signal 3 // BEGIN_SignalSlot 3 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2,A3)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2,A3)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 3 // BEGIN_Signal 2 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1,a2); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2) const { this->send(a1,a2); } }; // END_Signal 2 // BEGIN_SignalSlot 2 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1,A2)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1,A2)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 2 // BEGIN_Signal 1 // specialization template class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(a1); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1) const { this->send(a1); } }; // END_Signal 1 // BEGIN_SignalSlot 1 //! Connects a Signal to a function. template Connection connect(Signal& signal, R(*func)(A1)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } */ template void disconnect(Signal& signal, R(*func)(A1)) { signal.disconnect( slot(func) ); } template void disconnect(Signal& signal, BaseT & object, R(ClassT::*memFunc)(A1)) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal& signal, BaseT& object, R(ClassT::*memFunc)(A1) const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal& sender, Signal& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template Connection connect(Signal& sender, Signal& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 1 // BEGIN_Signal 0 // specialization template <> class Signal : public SignalBase { public: typedef Invokable InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template void disconnect(const BasicSlot& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send() const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list::const_iterator it = Connectable::connections().begin(); std::list::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast( it->slot().callable() ); invokable->invoke(); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()() const { this->send(); } }; // END_Signal 0 // BEGIN_SignalSlot 0 //! Connects a Signal to a function. template Connection connect(Signal<>& signal, R(*func)()) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template Connection connect(Signal<>& signal, BaseT& object, R(ClassT::*memFunc)()) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template Connection connect(Signal<>& signal, BaseT& object, R(ClassT::*memFunc)() const) { return connect( signal, slot(object, memFunc) ); } template void disconnect(Signal<>& signal, R(*func)()) { signal.disconnect( slot(func) ); } template void disconnect(Signal<>& signal, BaseT & object, R(ClassT::*memFunc)()) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect(Signal<>& signal, BaseT& object, R(ClassT::*memFunc)() const) { signal.disconnect( slot( object, memFunc ) ); } template void disconnect( Signal<>& sender, Signal<>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ inline Connection connect(Signal<>& sender, Signal<>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 0 cxxtools-3.0/include/cxxtools/serializationinfo.h0000664000175000017500000010541513666667450017423 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SerializationInfo_h #define cxxtools_SerializationInfo_h #include #include #include #include #include #include #include #include #include #if __cplusplus >= 201103L #include #include #include #include #include #include #endif namespace cxxtools { /** @brief Represents arbitrary types during serialization. A SerializationInfo represent arbitrary types during serialization. It is a flexible structure, which can hold all informations to reconstruct a object. The types of informations are: - a category (Void, Value, Object or Array) - a scalar value - a name of the type - a ordered list of SerializationInfo objects Those informations are filled when objects are serialized using a serialization operator and a serializer can use those to create a serialized representation of a object. A deserializer is used to convert a serialized representation into a SerializationInfo and a deserialization operator is used to convert the SerializationInfo back to the desired object. To serialize and deserialize a object, those operators are needed. For all standard types there are predefined operators. For user types like own classes a operator can easily be written. The signature is always the same. Serialization operator is defined as: void operator <<= (cxxtools::SerializationInfo& si, const YourType& object); It must collect all informations from `YourType` and put them to the cxxtools::SerializationInfo. The deserialization operator is defined as: void operator >>= (const cxxtools::SerializationInfo& si, YourType& object); It must fetch the informations from SerializationInfo and fill the passed object to reconstruct it. With those 2 operators a serializer is able to to convert the object to some format and the deserializers to convert it back to the object. Since for standard container types operators are defined using templates, The operators above are also able to serializer and deserialize e.g. a `std::vector`. The scalar value may have several types. When accessing the value it is typically converted implicitly when possible. So when e.g. the SerializationInfo is set to a numeric value and a string value is read, you get a string representation of the numeric value. */ class SerializationInfo { typedef std::deque Nodes; friend void operator <<=(SerializationInfo& si, const SerializationInfo& ssi); public: enum Category { Void = 0, Value = 1, Object = 2, Array = 6 }; /// iterator over subnodes. typedef Nodes::iterator Iterator; /// const iterator over subnodes. typedef Nodes::const_iterator ConstIterator; /// iterator over subnodes, std style name. typedef Nodes::iterator iterator; /// const iterator over subnodes, std style name. typedef Nodes::const_iterator const_iterator; #ifdef HAVE_LONG_LONG typedef long long int_type; #else typedef long int_type; #endif #ifdef HAVE_UNSIGNED_LONG_LONG typedef unsigned long long unsigned_type; #else typedef unsigned long unsigned_type; #endif public: SerializationInfo(); SerializationInfo(const SerializationInfo& si); ~SerializationInfo(); SerializationInfo& operator =(const SerializationInfo& si); #if __cplusplus >= 201103L SerializationInfo(SerializationInfo&& si) noexcept; SerializationInfo& operator=(SerializationInfo&& si); #endif Category category() const { return _category; } void setCategory(Category cat) { _category = cat; } const std::string& typeName() const { return _type; } void setTypeName(const std::string& type) { _type = type; if (_category == Void) _category = Object; } const std::string& name() const { return _name; } void setName(const std::string& name) { _name = name; } /** @brief Serialization of flat data-types */ void setValue(const String& value) { _setString(value); } void setValue(const std::string& value) { _setString8(value); } void setValue(const char* value) { _setString8(value); } void setValue(Char value) { _setString(String(1, value)); } void setValue(wchar_t value) { _setString(String(1, value)); } void setValue(bool value) { _setBool(value) ; } void setValue(char value) { _setChar(value) ; } void setValue(unsigned char value) { _setUInt(value) ; } void setValue(short value) { _setInt(value) ; } void setValue(unsigned short value) { _setUInt(value) ; } void setValue(int value) { _setInt(value) ; } void setValue(unsigned int value) { _setUInt(value) ; } void setValue(long value) { _setInt(value) ; } void setValue(unsigned long value) { _setUInt(value) ; } #ifdef HAVE_LONG_LONG void setValue(long long value) { _setInt(value) ; } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void setValue(unsigned long long value) { _setUInt(value) ; } #endif void setValue(float value) { _setFloat(value); } void setValue(double value) { _setDouble(value); } void setValue(long double value) { _setLongDouble(value); } void setNull(); /** @brief Deserialization of flat data-types */ void getValue(String& value) const; void getValue(std::string& value) const; void getValue(Char& value) const { value = _getWChar(); } void getValue(wchar_t& value) const { value = _getWChar(); } void getValue(bool& value) const { value = _getBool(); } void getValue(char& value) const { value = _getChar(); } void getValue(signed char& value) const { value = static_cast(_getInt("signed char", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned char& value) const { value = static_cast(_getUInt("unsigned char", std::numeric_limits::max())); } void getValue(short& value) const { value = static_cast(_getInt("short", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned short& value) const { value = static_cast(_getUInt("unsigned short", std::numeric_limits::max())); } void getValue(int& value) const { value = static_cast(_getInt("int", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned int& value) const { value = static_cast(_getUInt("unsigned int", std::numeric_limits::max())); } void getValue(long& value) const { value = static_cast(_getInt("long", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned long& value) const { value = static_cast(_getUInt("unsigned long", std::numeric_limits::max())); } #ifdef HAVE_LONG_LONG void getValue(long long& value) const { value = static_cast(_getInt("long long", std::numeric_limits::min(), std::numeric_limits::max())); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void getValue(unsigned long long& value) const { value = static_cast(_getUInt("unsigned long long", std::numeric_limits::max())); } #endif void getValue(float& value) const { value = _getFloat(); } void getValue(double& value) const { value = _getDouble(); } void getValue(long double& value) const { value = _getLongDouble(); } /** @brief Serialization of flat member data-types */ template SerializationInfo& addValue(const std::string& name, const T& value) { SerializationInfo& info = this->addMember(name); info.setValue(value); return info; } /** @brief Serialization of member data */ SerializationInfo& addMember(const std::string& name = std::string()); /** @brief Returns a member; adds when not yet found */ SerializationInfo& getAddMember(const std::string& name) { SerializationInfo* si = findMember(name); if (si == 0) return addMember(name); return *si; } /** @brief Deserialization of member data @throws SerializationError when member is not found. */ const SerializationInfo& getMember(const std::string& name) const; SerializationInfo& getMember(const std::string& name); /** @brief Deserialization of member data @throws std::range_error when index is too large */ const SerializationInfo& getMember(unsigned idx) const; SerializationInfo& getMember(unsigned idx); /** @brief Deserialization of member data. @return true if member is found, false otherwise. The passed value is not modified when the member was not found. */ template bool getMember(const std::string& name, T& value) const { const SerializationInfo* si = findMember(name); if (si == 0) return false; *si >>= value; return true; } /** @brief Find member data by name This method returns the data for an object with the name \a name. or null if it is not present. */ const SerializationInfo* findMember(const std::string& name) const; /** @brief Find member data by name This method returns the data for an object with the name \a name. or null if it is not present. */ SerializationInfo* findMember(const std::string& name); size_t memberCount() const { return nodes().size(); } Iterator begin() { return nodes().begin(); } Iterator end() { return nodes().end(); } ConstIterator begin() const { return nodes().begin(); } ConstIterator end() const { return nodes().end(); } void clear(); void swap(SerializationInfo& si); bool isNull() const { return _t == t_none && (_category == Void || _category == Value); } bool isString() const { return _t == t_string; } bool isString8() const { return _t == t_string8; } bool isChar() const { return _t == t_char; } bool isBool() const { return _t == t_bool; } bool isInt() const { return _t == t_int; } bool isUInt() const { return _t == t_uint; } bool isFloat() const { return _t == t_float; } bool isDouble() const { return _t == t_double; } bool isLongDouble() const { return _t == t_ldouble; } void dump(std::ostream& out, const std::string& prefix = std::string()) const; private: Category _category; std::string _name; std::string _type; void _releaseValue(); void _setString(const String& value); void _setString8(const std::string& value); void _setString8(const char* value); void _setChar(char value); void _setBool(bool value); void _setInt(int_type value); void _setUInt(unsigned_type value); void _setFloat(float value); void _setDouble(double value); void _setLongDouble(long double value); bool _getBool() const; wchar_t _getWChar() const; char _getChar() const; int_type _getInt(const char* type, int_type min, int_type max) const; unsigned_type _getUInt(const char* type, unsigned_type max) const; float _getFloat() const; double _getDouble() const; long double _getLongDouble() const; Nodes& nodes(); const Nodes& nodes() const; // assignment without name void assignData(const SerializationInfo& si); union U { char _s[sizeof(String) >= sizeof(std::string) ? sizeof(String) : sizeof(std::string)]; char _c; bool _b; int_type _i; unsigned_type _u; float _f; double _d; long double _ld; } _u; String* _StringPtr() { return reinterpret_cast(&_u); } String& _String() { return *_StringPtr(); } const String* _StringPtr() const { return reinterpret_cast(&_u); } const String& _String() const { return *_StringPtr(); } std::string* _String8Ptr() { return reinterpret_cast(&_u); } std::string& _String8() { return *_String8Ptr(); } const std::string* _String8Ptr() const { return reinterpret_cast(&_u); } const std::string& _String8() const { return *_String8Ptr(); } enum T { t_none, t_string, t_string8, t_char, t_bool, t_int, t_uint, t_float, t_double, t_ldouble } _t; Nodes* _nodes; // objects/arrays }; inline SerializationInfo::SerializationInfo() : _category(Void), _t(t_none), _nodes(0) { } inline void operator >>=(const SerializationInfo& si, SerializationInfo& ssi) { ssi = si; } void operator <<=(SerializationInfo& si, const SerializationInfo& ssi); inline void operator >>=(const SerializationInfo& si, bool& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, bool n) { si.setValue(n); si.setTypeName("bool"); } inline void operator >>=(const SerializationInfo& si, signed char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, signed char n) { si.setValue(n); si.setTypeName("char"); } inline void operator >>=(const SerializationInfo& si, unsigned char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned char n) { si.setValue(n); si.setTypeName("char"); } inline void operator >>=(const SerializationInfo& si, char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, char n) { si.setValue(n); si.setTypeName("char"); } inline void operator >>=(const SerializationInfo& si, short& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, short n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, unsigned short& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned short n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, int& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, int n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, unsigned int& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned int n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, long n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, unsigned long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned long n) { si.setValue(n); si.setTypeName("int"); } #ifdef HAVE_LONG_LONG inline void operator >>=(const SerializationInfo& si, long long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, long long n) { si.setValue(n); si.setTypeName("int"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG inline void operator >>=(const SerializationInfo& si, unsigned long long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned long long n) { si.setValue(n); si.setTypeName("int"); } #endif inline void operator >>=(const SerializationInfo& si, float& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, float n) { si.setValue(n); si.setTypeName("float"); } inline void operator >>=(const SerializationInfo& si, double& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, double n) { si.setValue(n); si.setTypeName("double"); } inline void operator >>=(const SerializationInfo& si, long double& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, long double n) { si.setValue(n); si.setTypeName("double"); } inline void operator >>=(const SerializationInfo& si, std::string& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, const std::string& n) { si.setValue(n); si.setTypeName("string"); } inline void operator <<=(SerializationInfo& si, const char* n) { si.setValue(n); si.setTypeName("string"); } inline void operator >>=(const SerializationInfo& si, String& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, const String& n) { si.setValue(n); si.setTypeName("string"); } inline void operator >>=(const SerializationInfo& si, Char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, const Char& n) { si.setValue(n); si.setTypeName("char"); } template inline void operator >>=(const SerializationInfo& si, std::vector& vec) { vec.clear(); vec.reserve(si.memberCount()); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { vec.resize( vec.size() + 1 ); *it >>= vec.back(); } } template inline void operator <<=(SerializationInfo& si, const std::vector& vec) { typename std::vector::const_iterator it; for(it = vec.begin(); it != vec.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("array"); si.setCategory(SerializationInfo::Array); } inline void operator>>=(const SerializationInfo& si, std::vector::reference bit) { bool v; si >>= v; bit = v; } inline void operator<<=(SerializationInfo& si, std::vector::reference bit) { si <<= static_cast(bit); } template inline void operator >>=(const SerializationInfo& si, std::list& list) { list.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { list.resize( list.size() + 1 ); *it >>= list.back(); } } template inline void operator <<=(SerializationInfo& si, const std::list& list) { typename std::list::const_iterator it; for(it = list.begin(); it != list.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("list"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::deque& deque) { deque.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { deque.resize( deque.size() + 1 ); *it >>= deque.back(); } } template inline void operator <<=(SerializationInfo& si, const std::deque& deque) { typename std::deque::const_iterator it; for(it = deque.begin(); it != deque.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("deque"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::set& set) { set.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { T t; *it >>= t; set.insert(t); } } template inline void operator <<=(SerializationInfo& si, const std::set& set) { typename std::set::const_iterator it; for(it = set.begin(); it != set.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("set"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::multiset& multiset) { multiset.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { T t; *it >>= t; multiset.insert(t); } } template inline void operator <<=(SerializationInfo& si, const std::multiset& multiset) { typename std::multiset::const_iterator it; for(it = multiset.begin(); it != multiset.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("multiset"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::pair& p) { si.getMember("first") >>= p.first; si.getMember("second") >>= p.second; } template inline void operator <<=(SerializationInfo& si, const std::pair& p) { si.setTypeName("pair"); si.addMember("first") <<= p.first; si.addMember("second") <<= p.second; } template inline void operator >>=(const SerializationInfo& si, std::map& map) { map.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { typename std::pair v; *it >>= v; typename std::map::value_type vv(v.first, v.second); map.insert(vv); } } template inline void operator <<=(SerializationInfo& si, const std::map& map) { typename std::map::const_iterator it; for(it = map.begin(); it != map.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("map"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::multimap& multimap) { multimap.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { typename std::pair v; *it >>= v; typename std::multimap::value_type vv(v.first, v.second); multimap.insert(vv); } } template inline void operator <<=(SerializationInfo& si, const std::multimap& multimap) { typename std::multimap::const_iterator it; for(it = multimap.begin(); it != multimap.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("multimap"); si.setCategory(SerializationInfo::Array); } template void operator >>=(const SerializationInfo& si, T (&v)[N]) { for (size_t n = 0; n < N; ++n) si.getMember(n) >>= v[n]; } template void operator <<=(SerializationInfo& si, const T (&v)[N]) { for (size_t n = 0; n < N; ++n) si.addMember() <<= v[n]; si.setTypeName("array"); si.setCategory(SerializationInfo::Array); } #if __cplusplus >= 201103L template inline void operator >>=(const SerializationInfo& si, std::forward_list& list) { list.clear(); for (size_t n = si.memberCount(); n > 0; --n) { list.push_front(T()); si.getMember(n-1) >>= list.front(); } } template inline void operator <<=(SerializationInfo& si, const std::forward_list& list) { typename std::forward_list::const_iterator it; for(it = list.begin(); it != list.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("list"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::unordered_set& unordered_set) { unordered_set.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { T t; *it >>= t; unordered_set.insert(t); } } template inline void operator <<=(SerializationInfo& si, const std::unordered_set& unordered_set) { typename std::unordered_set::const_iterator it; for(it = unordered_set.begin(); it != unordered_set.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("set"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::unordered_multiset& unordered_multiset) { unordered_multiset.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { T t; *it >>= t; unordered_multiset.insert(t); } } template inline void operator <<=(SerializationInfo& si, const std::unordered_multiset& unordered_multiset) { typename std::unordered_multiset::const_iterator it; for(it = unordered_multiset.begin(); it != unordered_multiset.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("set"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::unordered_map& unordered_map) { unordered_map.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { typename std::pair v; *it >>= v; typename std::unordered_map::value_type vv(v.first, v.second); unordered_map.insert(vv); } } template inline void operator <<=(SerializationInfo& si, const std::unordered_map& unordered_map) { typename std::unordered_map::const_iterator it; for(it = unordered_map.begin(); it != unordered_map.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("map"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::unordered_multimap& unordered_multimap) { unordered_multimap.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { typename std::pair v; *it >>= v; typename std::unordered_multimap::value_type vv(v.first, v.second); unordered_multimap.insert(vv); } } template inline void operator <<=(SerializationInfo& si, const std::unordered_multimap& unordered_multimap) { typename std::unordered_multimap::const_iterator it; for(it = unordered_multimap.begin(); it != unordered_multimap.end(); ++it) { SerializationInfo& newSi = si.addMember(); newSi <<= *it; } si.setTypeName("map"); si.setCategory(SerializationInfo::Array); } namespace helper { template struct TupleSerializer { void serialize(SerializationInfo& si, const std::tuple& tuple) const { TupleSerializer{}.serialize(si, tuple); si.addMember() <<= std::get(tuple); } void deserialize(const SerializationInfo& si, std::tuple& tuple) const { TupleSerializer{}.deserialize(si, tuple); si.getMember(index) >>= std::get(tuple); } }; template struct TupleSerializer<0, Types ...> { void serialize(SerializationInfo& si, const std::tuple& tuple) const { si.addMember() <<= std::get<0>(tuple); } void deserialize(const SerializationInfo& si, std::tuple& tuple) const { si.getMember(0) >>= std::get<0>(tuple); } }; } template void operator >>=(const SerializationInfo& si, std::tuple& tuple) { const auto size = std::tuple_size>::value; helper::TupleSerializer{}.deserialize(si, tuple); } template void operator <<=(SerializationInfo& si, const std::tuple& tuple) { const auto size = std::tuple_size>::value; helper::TupleSerializer{}.serialize(si, tuple); si.setTypeName("tuple"); si.setCategory(SerializationInfo::Array); } template void operator >>=(const SerializationInfo& si, std::array& array) { for (size_t n = 0; n < N; ++n) si.getMember(n) >>= array[n]; } template void operator <<=(SerializationInfo& si, const std::array& array) { for (size_t n = 0; n < N; ++n) si.addMember() <<= array[n]; si.setTypeName("array"); si.setCategory(SerializationInfo::Array); } /// @internal template class EnumClassSerializer { const ENUM& _value; public: explicit EnumClassSerializer(const ENUM& e) : _value(e) { } const ENUM& value() const { return _value; } }; /// @internal template void operator <<=(SerializationInfo& si, EnumClassSerializer e) { si <<= static_cast::type>(e.value()); } /// @internal template class EnumClassDeserializer { ENUM& _value; public: explicit EnumClassDeserializer(ENUM& e) : _value(e) { } ENUM& value() const { return _value; } }; /// @internal template void operator <<=(SerializationInfo& si, EnumClassDeserializer e) { si <<= static_cast::type>(e.value()); } /// @internal template void operator >>=(const SerializationInfo& si, EnumClassDeserializer e) { si >>= reinterpret_cast::type&>(e.value()); } /** Helper for serializing strongly typed enums. To serialize a enum this function returns a helper class, which can serialize the underlying type using the serialization operator. @code enum class Foo : char { FOO, BAR, BAZ }; Foo foo(Foo::FOO); cxxtools::SerializationInfo si; si <<= cxxtools::EnumClass(foo); @endcode */ template EnumClassSerializer EnumClass(const ENUM& e) { return EnumClassSerializer(e); } /** Helper for deserializing strongly typed enums. To deserialize a enum this function returns a helper class, which can serialize and deserialize the underlying type using the proper operators. @code enum class Foo : char { FOO, BAR, BAZ }; Foo foo(Foo::FOO); cxxtools::SerializationInfo si; si >>= cxxtools::EnumClass(foo); @endcode */ template EnumClassDeserializer EnumClass(ENUM& e) { return EnumClassDeserializer(e); } #endif // __cplusplus >= 201103L inline std::ostream& operator<< (std::ostream& out, const SerializationInfo& si) { si.dump(out); return out; } /** Converts one object to another using serialization operators. If a object is serializable (i.e. it has a operator<<=(SerializationInfo&, T)), and another is deserializable (i.e. it has a operator>>=(const SerializationInfo&, ...)) this function can be used to convert one to the other. @code std::set foo = getSetFromSomewhere(); std::vector bar = cxxtools::serialization_cast >(foo); // or with C++11: auto bar = cxxtools::serialization_cast >(foo); @endcode */ template R serialization_cast(const T& t) { SerializationInfo si; si <<= t; R r; si >>= r; return r; } } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/config.h.in0000664000175000017500000000073013644433072015521 00000000000000/** defines, whether c++ locales are supported */ #define @CXXTOOLS_STD_LOCALE@ /** defines, whether type long long exists */ #define @HAVE_LONG_LONG@ /** defines, whether type unsigned long long exists */ #define @HAVE_UNSIGNED_LONG_LONG@ /* defined if std::reverse_iterator is defined */ #define @HAVE_REVERSE_ITERATOR@ /* defined if std::reverse_iterator is defined */ #define @HAVE_REVERSE_ITERATOR_4@ cxxtools-3.0/include/cxxtools/callable.tpp0000664000175000017500000003010413644433072015760 00000000000000// BEGIN_Callable 10 /** Callable represents a "callable" type, which is fundamentally similar to an Invokable but is semantically richer. */ template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 10 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } }; // END_Callable 10 // BEGIN_Callable 9 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 9 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9); } }; // END_Callable 9 // BEGIN_Callable 8 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 8 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7,a8); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { this->operator()(a1,a2,a3,a4,a5,a6,a7,a8); } }; // END_Callable 8 // BEGIN_Callable 7 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 7 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { this->operator()(a1,a2,a3,a4,a5,a6,a7); } }; // END_Callable 7 // BEGIN_Callable 6 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 6 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return this->operator()(a1,a2,a3,a4,a5,a6); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { this->operator()(a1,a2,a3,a4,a5,a6); } }; // END_Callable 6 // BEGIN_Callable 5 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 5 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return this->operator()(a1,a2,a3,a4,a5); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { this->operator()(a1,a2,a3,a4,a5); } }; // END_Callable 5 // BEGIN_Callable 4 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 4 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4) const { return this->operator()(a1,a2,a3,a4); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4) const { this->operator()(a1,a2,a3,a4); } }; // END_Callable 4 // BEGIN_Callable 3 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 3 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3) const { return this->operator()(a1,a2,a3); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3) const { this->operator()(a1,a2,a3); } }; // END_Callable 3 // BEGIN_Callable 2 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 2 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2) const { return this->operator()(a1,a2); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2) const { this->operator()(a1,a2); } }; // END_Callable 2 // BEGIN_Callable 1 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 1 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1) const { return this->operator()(a1); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1) const { this->operator()(a1); } }; // END_Callable 1 // BEGIN_Callable 0 // specialization template class Callable : public Invokable<> { public: typedef R ReturnT; enum { NumArgs = 0 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()() const = 0; /** Same as calling this->operator()(...). */ ReturnT call() const { return this->operator()(); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke() const { this->operator()(); } }; // END_Callable 0 cxxtools-3.0/include/cxxtools/mutex.h0000664000175000017500000002761113644433072015020 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Mutex_h #define cxxtools_Mutex_h #include #include namespace cxxtools { /** @brief Mutual exclusion device. A Mutex is a mutual exclusion device. It is used to synchronize the access to data which is accessed by more than one thread or process at the same time. Mutexes are not recursive, that is the same thread can not lock a mutex multiple times without deadlocking. */ class Mutex { Mutex(const Mutex&) = delete; Mutex& operator=(const Mutex&) = delete; class MutexImpl* _impl; public: //! @brief Default constructor. Mutex(); /** @brief Destructor. The destructor destroys the mutex. The mutex must be in unlocked state when the destructor is called. */ ~Mutex(); /** @brief Lock the mutex. If the mutex is currently locked by another thread, the calling thread suspends until no other thread holds a lock on it. If the mutex is already locked by the calling thread a deadlock occurs. */ void lock(); bool tryLock(); //! @brief Unlocks the mutex. void unlock(); /** @brief Unlocks the mutex. This method does not throw an exception if unlocking the mutex fails but simply returns false. */ bool unlockNoThrow(); //! @internal @brief Access to platform specific implementation MutexImpl& impl() { return *_impl; } }; /** @brief MutexLock class for Mutex. The MutexLock class adds functionality for scoped locking. In the constructor of a MutexLock, the mutex is locked and in the destructor it is unlocked. This way if for example an exception occures in the protected section the Mutex will be unlocked during stack unwinding when the MutexLock is destructed. @code // example how to make a member function thread-safe #include class MyClass { public: void function() { MutexLock lock(_mtx); // // protected operations // // dtor of MutexLock unlocks _mtx } private: cxxtools::System::Mutex _mtx; }; @endcode */ class MutexLock { #if __cplusplus >= 201103L MutexLock(const MutexLock&) = delete; MutexLock& operator=(const MutexLock&) = delete; #else MutexLock(const MutexLock&); MutexLock& operator=(const MutexLock&); #endif public: /** @brief Construct to guard a %Mutex Constructs a MutexLock object and locks the enclosing mutex if \a doLock is true. If \a isLocked is true, the %MutexLock will only unlock the given mutex in the destructor, but not lock it in the constructor. */ explicit MutexLock(Mutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _isLocked(isLocked) { if (doLock) this->lock(); } //! @brief Unlocks the mutex unless %unlock() was called ~MutexLock() { if (_isLocked) _mutex.unlockNoThrow(); } void lock() { if (!_isLocked) { _mutex.lock(); _isLocked = true; } } bool tryLock() { if (_isLocked) return true; if (_mutex.tryLock()) { _isLocked = true; return true; } return false; } //! @brief Unlock so that the destructor does not unlock void unlock() { if (_isLocked) { _mutex.unlock(); _isLocked = false; } } //! @brief Returns the guarded the mutex object Mutex& mutex() { return _mutex; } //! @brief Returns the guarded the mutex object const Mutex& mutex() const { return _mutex; } private: Mutex& _mutex; bool _isLocked; }; /** @brief Recursive mutual exclusion device */ class RecursiveMutex { #if __cplusplus >= 201103L RecursiveMutex(const RecursiveMutex&) = delete; RecursiveMutex& operator=(const RecursiveMutex&) = delete; #else RecursiveMutex(const RecursiveMutex&) { } RecursiveMutex& operator=(const RecursiveMutex&) { return *this; } #endif private: class MutexImpl* _impl; public: RecursiveMutex(); ~RecursiveMutex(); void lock(); bool tryLock(); /** @brief Unlocks the mutex. If the mutex was locked more than one time by the same thread unlock decrements the lock-count. The mutex is actually unlocked when the lock-count is zero. **/ void unlock(); bool unlockNoThrow(); }; /** @brief Lock class for recursive mutexes. */ class RecursiveLock { #if __cplusplus >= 201103L RecursiveLock(const RecursiveLock&) = delete; RecursiveLock& operator=(const RecursiveLock&) = delete; #else RecursiveLock(const RecursiveLock&); RecursiveLock& operator=(const RecursiveLock&); #endif public: /** @brief Construct to guard a %RecursiveMutex Constructs a %RecursiveLock object and locks the enclosing recursive mutex if \a doLock is true. If \a isLocked is true, the %RecursiveLock will only unlock the given mutex in the destructor, but not lock it in the constructor. */ explicit RecursiveLock(RecursiveMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _isLocked(isLocked) { if (doLock) this->lock(); } //! @brief Unlocks the mutex unless %unlock() was called ~RecursiveLock() { if (_isLocked) _mutex.unlockNoThrow(); } void lock() { if (!_isLocked) { _mutex.lock(); _isLocked = true; } } //! @brief Unlock so that the destructor does not unlock void unlock() { if (_isLocked) { _mutex.unlock(); _isLocked = false; } } //! @brief Returns the guarded the mutex object RecursiveMutex& mutex() { return _mutex; } //! @brief Returns the guarded the mutex object const RecursiveMutex& mutex() const { return _mutex; } private: RecursiveMutex& _mutex; bool _isLocked; }; /** @brief Synchronisation device similar to a POSIX rwlock A %ReadWriteMutex allows multiple concurrent readers or one exclusive writer to access a resource. */ class ReadWriteMutex { #if __cplusplus >= 201103L ReadWriteMutex(const ReadWriteMutex&) = delete; ReadWriteMutex& operator=(const ReadWriteMutex&) = delete; #else ReadWriteMutex(const ReadWriteMutex&) { } ReadWriteMutex& operator=(const ReadWriteMutex&) { return *this; } #endif public: //! @brief Creates the Reader/Writer lock. ReadWriteMutex(); //! @brief Destroys the Reader/Writer lock. ~ReadWriteMutex(); void readLock(); /** @brief Acquires a read lock. If another thread currently holds a write lock, this method waits until the write lock is released. */ bool tryReadLock(); /** @brief Acquires a write lock. If one or more other threads currently hold locks, this method waits until all locks are released. The results are undefined if the same thread already holds a read or write lock. */ void writeLock(); /** @brief Tries to acquire a write lock. Immediately returns true if successful, or false if one or more other threads currently hold locks. The result is undefined if the same thread already holds a read or write lock. */ bool tryWriteLock(); //! @brief Releases the read or write lock. void unlock(); bool unlockNoThrow(); private: //! @internal class ReadWriteMutexImpl* _impl; }; class ReadLock { #if __cplusplus >= 201103L ReadLock(const ReadLock&) = delete; ReadLock& operator=(const ReadLock&) = delete; #else ReadLock(const ReadLock&); ReadLock& operator=(const ReadLock&); #endif public: explicit ReadLock(ReadWriteMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _locked(isLocked) { if (doLock) this->lock(); } ~ReadLock() { if (_locked) _mutex.unlockNoThrow(); } void lock() { if ( !_locked ) { _mutex.readLock(); _locked = true; } } void unlock() { if ( _locked) { _mutex.unlock(); _locked = false; } } ReadWriteMutex& mutex() { return _mutex; } private: ReadWriteMutex& _mutex; bool _locked; }; class WriteLock { #if __cplusplus >= 201103L WriteLock(const WriteLock&) = delete; WriteLock& operator=(const WriteLock&) = delete; #else WriteLock(const WriteLock&); WriteLock& operator=(const WriteLock&) { return *this; } #endif public: explicit WriteLock(ReadWriteMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _locked(isLocked) { if (doLock) this->lock(); } ~WriteLock() { if (_locked) _mutex.unlockNoThrow(); } void lock() { if ( ! _locked ) { _mutex.writeLock(); _locked = true; } } void unlock() { if ( _locked) { _mutex.unlock(); _locked = false; } } ReadWriteMutex& mutex() { return _mutex; } private: ReadWriteMutex& _mutex; bool _locked; }; } #endif cxxtools-3.0/include/cxxtools/streamcounter.h0000664000175000017500000000523013644433072016542 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STREAMCOUNTER_H #define CXXTOOLS_STREAMCOUNTER_H #include namespace cxxtools { template class BasicStreamcounterBuf : public std::basic_streambuf { typedef Traits traits_type; typedef typename Traits::int_type int_type; unsigned count; public: BasicStreamcounterBuf() : count(0) { } unsigned getCount() const { return count; } void resetCount(unsigned count_) { count = count_; } private: int_type overflow(int_type ch) { ++count; return 0; } int_type underflow() { return traits_type::eof(); } int sync() { return 0; } }; template class BasicStreamcounter : public std::basic_ostream { BasicStreamcounterBuf streambuf; public: BasicStreamcounter() : std::basic_ostream(0) { std::basic_ostream::init(&streambuf); } unsigned getCount() const { return streambuf.getCount(); } void resetCount(unsigned count = 0) { streambuf.resetCount(count); } }; typedef BasicStreamcounter > Streamcounter; } #endif // CXXTOOLS_STREAMCOUNTER_H cxxtools-3.0/include/cxxtools/log/0000775000175000017500000000000013672344760014345 500000000000000cxxtools-3.0/include/cxxtools/log/cxxtools.h0000664000175000017500000003317013644433072016317 00000000000000/* * Copyright (C) 2003, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LOG_CXXTOOLS_H #define CXXTOOLS_LOG_CXXTOOLS_H #include #include #define _cxxtools_log_enabled(impl, level) \ (getLogger ## impl() != 0 && getLogger ## impl()->isEnabled(::cxxtools::Logger::level)) #define _cxxtools_log(impl, level, displaylevel, expr) \ do { \ ::cxxtools::Logger* _cxxtools_logger = getLogger ## impl(); \ if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::level)) \ { \ ::cxxtools::LogMessage _cxxtools_logMessage(_cxxtools_logger, displaylevel); \ _cxxtools_logMessage.out() << expr; \ _cxxtools_logMessage.finish(); \ } \ } while (false) #define _cxxtools_log_if(impl, level, displaylevel, cond, expr) \ do { \ ::cxxtools::Logger* _cxxtools_logger = getLogger ## impl(); \ if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::level) && (cond)) \ { \ ::cxxtools::LogMessage _cxxtools_logMessage(_cxxtools_logger, displaylevel); \ _cxxtools_logMessage.out() << expr; \ _cxxtools_logMessage.finish(); \ } \ } while (false) #define log_fatal_enabled() _cxxtools_log_enabled(_default, LOG_FATAL) #define log_error_enabled() _cxxtools_log_enabled(_default, LOG_ERROR) #define log_warn_enabled() _cxxtools_log_enabled(_default, LOG_WARN) #define log_info_enabled() _cxxtools_log_enabled(_default, LOG_INFO) #define log_debug_enabled() _cxxtools_log_enabled(_default, LOG_DEBUG) #define log_fine_enabled() _cxxtools_log_enabled(_default, LOG_FINE) #define log_finer_enabled() _cxxtools_log_enabled(_default, LOG_FINER) #define log_finest_enabled() _cxxtools_log_enabled(_default, LOG_FINEST) #define log_trace_enabled() _cxxtools_log_enabled(_default, LOG_TRACE) #define log_fatal_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_FATAL) #define log_error_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_ERROR) #define log_warn_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_WARN) #define log_info_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_INFO) #define log_debug_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_DEBUG) #define log_fine_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_FINE) #define log_finer_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_FINER) #define log_finest_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_FINEST) #define log_trace_to_enabled(impl) _cxxtools_log_enabled(impl, LOG_TRACE) #define log_fatal(expr) _cxxtools_log(_default, LOG_FATAL, "FATAL", expr) #define log_error(expr) _cxxtools_log(_default, LOG_ERROR, "ERROR", expr) #define log_warn(expr) _cxxtools_log(_default, LOG_WARN, "WARN", expr) #define log_info(expr) _cxxtools_log(_default, LOG_INFO, "INFO", expr) #define log_debug(expr) _cxxtools_log(_default, LOG_DEBUG, "DEBUG", expr) #define log_fine(expr) _cxxtools_log(_default, LOG_FINE, "FINE", expr) #define log_finer(expr) _cxxtools_log(_default, LOG_FINER, "FINER", expr) #define log_finest(expr) _cxxtools_log(_default, LOG_FINEST, "FINEST", expr) #define log_fatal_to(impl, expr) _cxxtools_log(impl, LOG_FATAL, "FATAL", expr) #define log_error_to(impl, expr) _cxxtools_log(impl, LOG_ERROR, "ERROR", expr) #define log_warn_to(impl, expr) _cxxtools_log(impl, LOG_WARN, "WARN", expr) #define log_info_to(impl, expr) _cxxtools_log(impl, LOG_INFO, "INFO", expr) #define log_debug_to(impl, expr) _cxxtools_log(impl, LOG_DEBUG, "DEBUG", expr) #define log_fine_to(impl, expr) _cxxtools_log(impl, LOG_FINE, "FINE", expr) #define log_finer_to(impl, expr) _cxxtools_log(impl, LOG_FINER, "FINER", expr) #define log_finest_to(impl, expr) _cxxtools_log(impl, LOG_FINEST, "FINEST", expr) #define log_fatal_if(cond, expr) _cxxtools_log_if(_default, LOG_FATAL, "FATAL", cond, expr) #define log_error_if(cond, expr) _cxxtools_log_if(_default, LOG_ERROR, "ERROR", cond, expr) #define log_warn_if(cond, expr) _cxxtools_log_if(_default, LOG_WARN, "WARN", cond, expr) #define log_info_if(cond, expr) _cxxtools_log_if(_default, LOG_INFO, "INFO", cond, expr) #define log_debug_if(cond, expr) _cxxtools_log_if(_default, LOG_DEBUG, "DEBUG", cond, expr) #define log_fine_if(cond, expr) _cxxtools_log_if(_default, LOG_FINE, "FINE", cond, expr) #define log_finer_if(cond, expr) _cxxtools_log_if(_default, LOG_FINER, "FINER", cond, expr) #define log_finest_if(cond, expr) _cxxtools_log_if(_default, LOG_FINEST, "FINEST", cond, expr) #define log_fatal_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_FATAL, "FATAL", cond, expr) #define log_error_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_ERROR, "ERROR", cond, expr) #define log_warn_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_WARN, "WARN", cond, expr) #define log_info_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_INFO, "INFO", cond, expr) #define log_debug_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_DEBUG, "DEBUG", cond, expr) #define log_fine_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_FINE, "FINE", cond, expr) #define log_finer_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_FINER, "FINER", cond, expr) #define log_finest_to_if(impl, cond, expr) _cxxtools_log_if(impl, LOG_FINEST, "FINEST", cond, expr) #define log_trace_to(impl, expr) \ ::cxxtools::LogTracer _cxxtools_tracer; \ do { \ ::cxxtools::Logger* _cxxtools_logger = getLogger ## impl(); \ if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_TRACE)) \ { \ _cxxtools_tracer.setLogger(_cxxtools_logger); \ _cxxtools_tracer.out() << expr; \ _cxxtools_tracer.enter(); \ } \ } while (false) #define log_trace(expr) log_trace_to(_default, expr) #define log_define_instance(instance, category) \ static ::cxxtools::Logger* getLogger ## instance() \ { \ static cxxtools::Logger* logger = 0; \ if (!::cxxtools::LogManager::isEnabled()) \ return 0; \ if (logger == 0) \ logger = ::cxxtools::LogManager::getInstance().getLogger(category); \ return logger; \ } #define log_define(category) log_define_instance(_default, category) #define log_init_cxxtools ::cxxtools::LogManager::logInit #define log_init log_init_cxxtools namespace cxxtools { class SerializationInfo; ////////////////////////////////////////////////////////////////////// // class Logger { Logger(const Logger&); Logger& operator=(const Logger&); public: enum log_flag_type { LOG_FATAL = 0x01, LOG_ERROR = 0x02, LOG_WARN = 0x04, LOG_INFO = 0x08, LOG_DEBUG = 0x10, LOG_FINE = 0x10, LOG_FINER = 0x20, LOG_FINEST = 0x40, LOG_TRACE = 0x80 }; enum log_level_type { LOG_LEVEL_FATAL = (LOG_FATAL << 1) - 1, LOG_LEVEL_ERROR = (LOG_ERROR << 1) - 1, LOG_LEVEL_WARN = (LOG_WARN << 1) - 1, LOG_LEVEL_INFO = (LOG_INFO << 1) - 1, LOG_LEVEL_DEBUG = (LOG_DEBUG << 1) - 1, LOG_LEVEL_FINE = (LOG_FINE << 1) - 1, LOG_LEVEL_FINER = (LOG_FINER << 1) - 1, LOG_LEVEL_FINEST = (LOG_FINEST << 1) - 1, LOG_LEVEL_TRACE = LOG_LEVEL_DEBUG | LOG_TRACE }; private: std::string category; int flags; public: /// Initalizes a new logger. Logger(const std::string& c, int f) : category(c), flags(f) { } const std::string& getCategory() const { return category; } bool isEnabled(log_flag_type l) const { return (flags & l) != 0; } log_level_type getLogLevel() const { return static_cast(flags); } int getLogFlags() const { return flags; } void setLogFlags(int f) { flags = f; } }; ////////////////////////////////////////////////////////////////////// // class LogConfiguration { public: class Impl; private: friend class Impl; Impl* _impl; public: /** Converts a complex log level string to log_level_type. Throws exception when level string could not be interpreted accepted log levels: * everything below level: FATAL ERROR WARN INFO DEBUG FINE FINER FINEST TRACE * everything below level with trace enabled: TFATAL ... TFINE * specific log levels: TRACE|ERROR|WARN * just one log level: |WARN */ static int strToLogFlags(const std::string& level); typedef Logger::log_level_type log_level_type; LogConfiguration(); LogConfiguration(const LogConfiguration&); LogConfiguration& operator=(const LogConfiguration&); ~LogConfiguration(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } int rootFlags() const; int logFlags(const std::string& category) const; // setter void setRootFlags(int flags); void setRootLevel(log_level_type level) { setRootFlags(static_cast(level)); } /// Sets root level using string notation. /// See method strToLogFlags for syntax of string. void setRootLevel(const std::string& level) { setRootFlags(strToLogFlags(level)); } void setLogFlags(const std::string& category, int flags); void setLogLevel(const std::string& category, log_level_type level) { setLogFlags(category, static_cast(level)); }; /// Sets specific level using string notation. /// See method strToLogFlags for syntax of string. /// Empty level removes the specific setting for the category. void setLogLevel(const std::string& category, const std::string& level); void setFile(const std::string& fname); void setFile(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex); void setLoghost(const std::string& host, unsigned short port, bool broadcast = false); void setStdout(); void setStderr(); }; void operator>>= (const SerializationInfo& si, LogConfiguration& logConfiguration); void operator<<= (SerializationInfo& si, const LogConfiguration& logConfiguration); ////////////////////////////////////////////////////////////////////// // class LogManager { public: class Impl; friend class Impl; Impl* _impl; LogManager(); static bool _enabled; LogManager(const LogManager&); LogManager& operator=(const LogManager&); public: ~LogManager(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } static LogManager& getInstance(); static void logInit(); static void logInit(const std::string& fname); static void logInit(const SerializationInfo& si); static void logInit(const LogConfiguration& config); void configure(const LogConfiguration& config); LogConfiguration getLogConfiguration() const; Logger* getLogger(const std::string& category); static bool isEnabled() { return _enabled; } static void disable() { _enabled = false; } int rootFlags() const; int logFlags(const std::string& category) const; }; ////////////////////////////////////////////////////////////////////// // class LogMessage { public: class Impl; private: Impl* _impl; LogMessage(const LogMessage&); LogMessage& operator=(const LogMessage&); public: LogMessage(Logger* logger, const char* level); LogMessage(Logger* logger, Logger::log_level_type level); ~LogMessage(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } std::ostream& out(); std::string str() const; void finish(); }; ////////////////////////////////////////////////////////////////////// // class LogTracer { public: class Impl; private: Impl* _impl; LogTracer(const LogTracer&); LogTracer& operator=(const LogTracer&); public: LogTracer(); ~LogTracer(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } void setLogger(Logger* l); std::ostream& out(); void enter(); void exit(); }; } #endif // LOG_CXXTOOLS_H cxxtools-3.0/include/cxxtools/function.tpp0000664000175000017500000005664013644433072016063 00000000000000// BEGIN_Function 10 /** The Function class wraps free functions in the form of a Callable, for use with the signals/slots framework. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** FunctionSlot wraps Function objects so that they can act as Slots. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class FunctionSlot : public BasicSlot { public: FunctionSlot(const Function& func) : _func( func ) {} /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_func; } /** Creates a copy of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new FunctionSlot(*this); } virtual void onConnect(const Connection& /*c*/) { } virtual void onDisconnect(const Connection& /*c*/) { } virtual bool equals(const Slot& slot) const { const FunctionSlot* fs = dynamic_cast(&slot); return fs ? (_func == fs->_func) : false; } private: Function _func; }; // FunctionSlot /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) ) { return FunctionSlot( callable(func) ); } // END_Function 10 // BEGIN_Function 9 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) ) { return FunctionSlot( callable(func) ); } // END_Function 9 // BEGIN_Function 8 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7,A8); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7,a8); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) ) { return FunctionSlot( callable(func) ); } // END_Function 8 // BEGIN_Function 7 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) ) { return FunctionSlot( callable(func) ); } // END_Function 7 // BEGIN_Function 6 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) ) { return FunctionSlot( callable(func) ); } // END_Function 6 // BEGIN_Function 5 template < typename R,class A1, class A2, class A3, class A4, class A5> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return (*_funcPtr)(a1,a2,a3,a4,a5); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) ) { return FunctionSlot( callable(func) ); } // END_Function 5 // BEGIN_Function 4 template < typename R,class A1, class A2, class A3, class A4> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return (*_funcPtr)(a1,a2,a3,a4); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4) ) { return FunctionSlot( callable(func) ); } // END_Function 4 // BEGIN_Function 3 template < typename R,class A1, class A2, class A3> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3) const { return (*_funcPtr)(a1,a2,a3); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3) ) { return FunctionSlot( callable(func) ); } // END_Function 3 // BEGIN_Function 2 template < typename R,class A1, class A2> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2) const { return (*_funcPtr)(a1,a2); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2) ) { return FunctionSlot( callable(func) ); } // END_Function 2 // BEGIN_Function 1 template < typename R,class A1> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1) const { return (*_funcPtr)(a1); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1) ) { return FunctionSlot( callable(func) ); } // END_Function 1 // BEGIN_Function 0 template < typename R> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()() const { return (*_funcPtr)(); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)()) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)() ) { return FunctionSlot( callable(func) ); } // END_Function 0 cxxtools-3.0/include/cxxtools/iconvwrap.h0000664000175000017500000000527513644433072015670 00000000000000/* * Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ICONVWRAP_H #define CXXTOOLS_ICONVWRAP_H #include namespace cxxtools { /** Wraps iconv. */ class iconvwrap { public: /** Create iconvwrap object. */ iconvwrap(); /** Create iconvwrap object and initializes it. * * @param tocode destination encoding name * @param fromcode source encoding name */ iconvwrap(const char *tocode, const char *fromcode); /** Close iconvwrap object, release resouces. * * @return true on succes, otherwise return false and set errno. */ bool close(); /** Recode input string into output buffer. * * @param inbuf * @param inbytesleft * @param outbuf * @param outbytesleft * @return true if all succesfully converted, on error returns false * and se errno */ bool convert(char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); /** Return true if IConv is open, false otherwise. */ bool is_open(); /** (Re)initializes iconvwrap object. * * @param tocode target encoding name * @param fromcode source encoding name * @return true on succes, on error return false and set errno */ bool open(const char *tocode, const char *fromcode); /** Destroy iconvwrap object. */ ~iconvwrap(); protected: iconv_t cd; }; } #endif cxxtools-3.0/include/cxxtools/csvserializer.h0000664000175000017500000000623613644433072016543 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVSERIALIZER_H #define CXXTOOLS_CSVSERIALIZER_H #include #include namespace cxxtools { class CsvSerializer { CsvSerializer(const CsvSerializer&); CsvSerializer& operator= (const CsvSerializer&); public: explicit CsvSerializer(std::ostream& os, TextCodec* codec = new Utf8Codec()) : _formatter(new CsvFormatter(os, codec)) { } explicit CsvSerializer(TextOStream& os) : _formatter(new CsvFormatter(os)) { } ~CsvSerializer() { delete _formatter; } void selectColumn(const std::string& title) { _formatter->selectColumn(title); } void selectColumn(const std::string& memberName, const std::string& title) { _formatter->selectColumn(memberName, title); } void delimiter(String delimiter) { _formatter->delimiter(delimiter); } void delimiter(Char delimiter) { _formatter->delimiter(String(1, delimiter)); } void quote(Char quote) { _formatter->quote(quote); } void lineEnding(const String& le) { _formatter->lineEnding(le); } template void serialize(const T& type) { Decomposer decomposer; decomposer.begin(type); decomposer.format(*_formatter); _formatter->finish(); } private: CsvFormatter* _formatter; }; } #endif // CXXTOOLS_CSVSERIALIZER_H cxxtools-3.0/include/cxxtools/ptrstream.h0000664000175000017500000000442213644433072015672 00000000000000/* * Copyright (C) 2018 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PTRSTREAM_H #define CXXTOOLS_PTRSTREAM_H #include #include namespace cxxtools { /** The class implements a iostream interface to a char buffer. * * The user is responsible to provide a buffer, which can be read and written to. * The buffer must be valid as long as the class reads from or writes to it. */ template class BasicPtrStream : public std::basic_iostream { BasicPtrStreamBuf _streambuf; public: BasicPtrStream(CharT* begin, CharT* end) : _streambuf(begin, end) { std::basic_iostream::init(&_streambuf); } BasicPtrStream(CharT* begin, size_t size) : _streambuf(begin, size) { std::basic_iostream::init(&_streambuf); } CharT* begin() const { return _streambuf.begin(); } CharT* end() const { return _streambuf.end(); } }; typedef BasicPtrStream PtrStream; } #endif cxxtools-3.0/include/cxxtools/propertiesfile.h0000664000175000017500000000714513644433072016712 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIESFILE_H #define CXXTOOLS_PROPERTIESFILE_H #include #include #include #include namespace cxxtools { class PropertiesFile { typedef std::map ValuesType; ValuesType values; public: explicit PropertiesFile(const std::string& filename); explicit PropertiesFile(std::istream& in); void setValue(const String& key, const String& value) { values[key] = value; } void removeValue(const String& key) { values.erase(key); } bool hasValue(const String& key) const { return values.find(key) != values.end(); } String getValue(const String& key, const String& def = String()) const { ValuesType::const_iterator it = values.find(key); return it == values.end() ? def : it->second; } template void getKeys(OutputIterator oi) const { for (ValuesType::const_iterator it = values.begin(); it != values.end(); ++it) { *oi = it->first; ++oi; } } template void getKeys(const String& praefix, OutputIterator oi) const { for (ValuesType::const_iterator it = values.begin(); it != values.end(); ++it) { String key = it->first; if (key.size() > praefix.size() && key.at(praefix.size()) == L'.' && key.compare(0, praefix.size(), praefix) == 0 && key.find(L'.', praefix.size() + 2) == String::npos) { *oi = key.substr(praefix.size() + 1); ++oi; } } } template void getKeysLong(const String& praefix, OutputIterator oi) const { for (ValuesType::const_iterator it = values.begin(); it != values.end(); ++it) { String key = it->first; if (key.size() > praefix.size() && key.at(praefix.size()) == '.' && key.compare(0, praefix.size(), praefix) == 0 && key.find('.', praefix.size() + 2) == String::npos) { *oi = key; ++oi; } } } }; } #endif // CXXTOOLS_PROPERTIESFILE_H cxxtools-3.0/include/cxxtools/argin.h0000664000175000017500000000773313644433072014761 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STDIN_H #define CXXTOOLS_STDIN_H #include #include #include #include namespace cxxtools { /** * Helper class for redirecting input to stdin or file using command line switch. * * Using this class it is easy to provide a command line switch to the user * to read input from a file or stdin. * * Examples: * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgIn in(argc, argv, 'i'); * double d; * while (in >> d) * { * std::cout << d*2 << std::endl; * } * } * \endcode * * This program reads data from stdin or a file, when provided using the * -i option and doubles the value * * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgIn in(argc, argv); * double d; * while (in >> d) * { * std::cout << d*2 << std::endl; * } * } * \endcode * * This program reads data from stdin or a file, when provided as a * parameter and doubles the value. This is similar to the <> operator * in perl. * */ class ArgIn : public std::istream { std::ifstream _ifile; void doInit(const Arg& ifile) { std::streambuf* buf; if (ifile.isSet()) { _ifile.open(ifile); buf = _ifile.rdbuf(); } else buf = std::cin.rdbuf(); init(buf); } public: /// Constructor processes short options like: -i something. ArgIn(int& argc, char* argv[], char option) : std::istream(0) { Arg ifile(argc, argv, option); doInit(ifile); } /// Constructor processes long options like: --input something". ArgIn(int& argc, char* argv[], const char* option) : std::istream(0) { Arg ifile(argc, argv, option); doInit(ifile); } /// Constructor processes normal parameters. ArgIn(int& argc, char* argv[]) : std::istream(0) { Arg ifile(argc, argv); doInit(ifile); } /// returns true, if the input is read from a file. bool redirected() const { return rdbuf() != std::cin.rdbuf(); } }; } #endif // CXXTOOLS_STDIN_H cxxtools-3.0/include/cxxtools/serializationerror.h0000664000175000017500000000565313644433072017607 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SerializationError_h #define cxxtools_SerializationError_h #include #include namespace cxxtools { class SerializationInfo; /** @brief Error during serialization of a type This Exception indicates a error during serialization caused by missing or invalid object attributes. */ class SerializationError : public std::runtime_error { public: /** @brief Construct with a message */ explicit SerializationError(const std::string& msg); /** @brief throws Serialization error * This saves some bytes in library size when using this function instead of throwing directly. */ static void doThrow(const std::string& msg); }; class SerializationMemberNotFound : public SerializationError { std::string _member; public: explicit SerializationMemberNotFound(const std::string& member); SerializationMemberNotFound(const SerializationInfo& si, const std::string& member); SerializationMemberNotFound(const SerializationInfo& si, unsigned idx); ~SerializationMemberNotFound() throw() { } const std::string& member() const { return _member; } }; class SerializationConversionError : public SerializationError { public: explicit SerializationConversionError(const std::string& msg) : SerializationError(msg) { } static void doThrow(const SerializationInfo& si, const std::string& typefrom, const std::string& typeto, const std::string& value = std::string()); }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/resetter.h0000664000175000017500000000420413644433072015504 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_RESETTER_H #define CXXTOOLS_RESETTER_H namespace cxxtools { /** * Template class which resets a value to its original or specified state on destruction. * * An instance should be put on the stack. * The value is reset in the destructor so that it is guaranteed to be * executed even on exception. * * \code * int p = 42; * { * Resetter resetter(p); * p = 43; * } * // the value of p is 42 here. * \endcode */ template class Resetter { T& _t; T _sav; public: explicit Resetter(T& t) : _t(t), _sav(t) { } Resetter(T& t, T value) : _t(t), _sav(value) { } ~Resetter() { _t = _sav; } }; } #endif cxxtools-3.0/include/cxxtools/regex.h0000664000175000017500000001217313644433072014765 00000000000000/* * Copyright (C) 2005-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REGEX_H #define CXXTOOLS_REGEX_H #include #include #include #include namespace cxxtools { class RegexSMatch; template class RegexDestroyPolicy; template <> class RegexDestroyPolicy { protected: void destroy(regex_t* expr) { ::regfree(expr); delete expr; } }; /// regex(3)-wrapper. class Regex { SmartPtr expr; void checkerr(int ret) const; public: /// create a uninitialized regex object. Regex() { } /// create a regex object with a const char*. explicit Regex(const char* ex, int cflags = REG_EXTENDED) : expr(0) { if (ex && ex[0]) { expr = new regex_t(); checkerr(::regcomp(expr.getPointer(), ex, cflags)); } } /// create a regex object with std::string. explicit Regex(const std::string& ex, int cflags = REG_EXTENDED) : expr(0) { if (!ex.empty()) { expr = new regex_t(); checkerr(::regcomp(expr.getPointer(), ex.c_str(), cflags)); } } /// Returns true if str starting from p matches the regular expression. The matches are decribed in the smatch object. bool matchp(const std::string& str_, std::string::size_type p, RegexSMatch& smatch, int eflags = 0) const; /// Returns true if str starting from p matches the regular expression. bool matchp(const std::string& str_, std::string::size_type p, int eflags = 0) const; /// Returns true if str matches the regular expression. The matches are decribed in the smatch object. bool match(const std::string& str_, RegexSMatch& smatch, int eflags = 0) const { return matchp(str_, 0, smatch, eflags); } /// Returns true if str matches the regular expression. bool match(const std::string& str_, int eflags = 0) const { return matchp(str_, 0, eflags); } /// Replaces occurence of the regular expression in str with expr. The expr is expanded using RegexSMatch::format. /// If the 3rd parameter is true, all occurences are replaced. std::string subst(const std::string& str, const std::string& expr, bool all = true); /// Destroys the regular expression. This is normally done by the destructor. void free() { expr = 0; } /// Returns true, if the object does not have a valid regular expression. bool empty() const { return expr.getPointer() == 0; } }; /// collects matches in a regex class RegexSMatch { friend class Regex; std::string str; regmatch_t matchbuf[10]; public: RegexSMatch() { matchbuf[0].rm_so = 0; } /// returns the number of expressions, which were found unsigned size() const; /// returns the start position of the n-th expression regoff_t offsetBegin(unsigned n) const { return matchbuf[n].rm_so; } /// returns the end position of the n-th expression regoff_t offsetEnd(unsigned n) const { return matchbuf[n].rm_eo; } /// returns the size of the n-th expression regoff_t size(unsigned n) const { return matchbuf[n].rm_eo - matchbuf[n].rm_so; } /// returns true if the n-th element is set. bool has(unsigned n) const { return matchbuf[n].rm_so >= 0; } /// returns the n-th element. No range checking is done. std::string get(unsigned n) const; /// replace each occurence of "$n" with the n-th element (n: 0..9). std::string format(const std::string& s) const; /// returns the n-th element. No range check is done. std::string operator[] (unsigned n) const { return get(n); } }; } #endif // CXXTOOLS_REGEX_H cxxtools-3.0/include/cxxtools/iodevice.h0000664000175000017500000002435513644433072015447 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 PTV AG * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_IODevice_h #define CXXTOOLS_IODevice_h #include #include #include #include #include namespace cxxtools { enum IOS_OpenMode { IOS_Sync = 0, IOS_Async = 1L << 0, IOS_Read = 1L << 1, IOS_Write = 1L << 2, IOS_AtEnd = 1L << 3, IOS_Append = 1L << 4, IOS_Trunc = 1L << 5, IOS_OpenModeEnd = 1L << 16 }; inline IOS_OpenMode operator&(IOS_OpenMode a, IOS_OpenMode b) { return IOS_OpenMode(static_cast(a) & static_cast(b)); } inline IOS_OpenMode operator|(IOS_OpenMode a, IOS_OpenMode b) { return IOS_OpenMode(static_cast(a) | static_cast(b)); } inline IOS_OpenMode operator^(IOS_OpenMode a, IOS_OpenMode b) { return IOS_OpenMode(static_cast(a) ^ static_cast(b)); } inline IOS_OpenMode& operator|=(IOS_OpenMode& a, IOS_OpenMode b) { return a = a | b; } inline IOS_OpenMode& operator&=(IOS_OpenMode& a, IOS_OpenMode b) { return a = a & b; } inline IOS_OpenMode& operator^=(IOS_OpenMode& a, IOS_OpenMode b) { return a = a ^ b; } inline IOS_OpenMode operator~(IOS_OpenMode a) { return IOS_OpenMode(~static_cast(a)); } class IODeviceImpl; /** @brief Endpoint for I/O operations This class serves as the base class for all kinds of I/O devices. The interface supports synchronous and asynchronous I/O operations, peeking and seeking. I/O buffers and I/O streams within the cxxtools framework use IODevices as endpoints and therefore fully feaured standard C++ compliant IOStreams can be constructed at runtime. Examples of %IODevices are the SerialDevice, the endpoints of a Pipe or the FileDevice. A Selector can be used to wait on activity on an %IODevice, which will send the %Signal inputReady or outputReady of the %IODevice that is ready to perform I/O. */ class IODevice : public Selectable { public: typedef std::char_traits::pos_type pos_type; typedef std::char_traits::off_type off_type; typedef std::ios_base::seekdir SeekDir; typedef IOS_OpenMode OpenMode; static const OpenMode Sync = IOS_Sync; static const OpenMode Async = IOS_Async; static const OpenMode Read = IOS_Read; static const OpenMode Write = IOS_Write; static const OpenMode AtEnd = IOS_AtEnd; static const OpenMode Append = IOS_Append; static const OpenMode Trunc = IOS_Trunc; public: //! @brief Destructor virtual ~IODevice() { } void beginRead(char* buffer, size_t n); size_t endRead(); //! @brief Read data from I/O device /*! Reads up to n bytes and stores them in buffer. Returns the number of bytes read, which may be less than requested and even 0 if the device operates in asynchronous (non-blocking) mode. In case of EOF the IODevice is set to eof. \param buffer buffer where to place the data to be read. \param n number of bytes to read \return number of bytes read, which may be less than requested. \throw IOError */ size_t read(char* buffer, size_t n); size_t beginWrite(const char* buffer, size_t n); size_t endWrite(); //! @brief Write data to I/O device /** Writes n bytes from buffer to this I/O device. Returns the number of bytes written, which may be less than requested and even 0 if the device operates in asynchronous (non-blocking) mode. In case of EOF the IODevice is set to eof. \param buffer buffer containing the data to be written. \param n number of bytes that should be written. \return number of bytes written, which may be less than requested. \throw IOError */ size_t write(const char* buffer, size_t n); /** @brief Cancels asynchronous reading and writing */ void cancel(); //! @brief Returns true if device is seekable /** Tests if the device is seekable. \return true if the device is seekable, false otherwise. */ bool seekable() const; //! @brief Move the next read position to the given offset /** Tries to move the current read position to the given offset. SeekMode determines the relative starting point of offset. \param offset the offset the pointer should be moved by. \param mode determines the relative starting offset. \return the new abosulte read positing. \throw IOError */ pos_type seek(off_type offset, std::ios::seekdir sd); //! @brief Read data from I/O device without consuming them /** Tries to extract up to n bytes from this object without consuming them. The bytes are stored in buffer, and the number of bytes peeked is returned. \param buffer buffer where to place the data to be read. \param n number of bytes to peek \return number of bytes peek. \throw IOError */ size_t peek(char* buffer, size_t n); //! @brief Synchronize device /** Commits written data to physical device. \throw IOError */ void sync(); //! @brief Returns the current I/O position /** The current I/O position is returned or an IOError is thrown if the device is not seekable. Seekability can be tested with BasicIODevice::seekable(). \throw IOError */ pos_type position(); //! @brief Returns if the device has reached EOF /*! Test if the I/O device has reached eof. \return true if the I/O device has reached eof, false otherwise. */ bool eof() const; /** @brief Returns true if the device operates in asynchronous mode */ bool async() const; //! @brief Sets the timeout for blocking reads and writes. void setTimeout(Milliseconds timeout); /** @brief Notifies about available data This signal is send when the IODevice is monitored in a Selector or EventLoop and data becomes available. */ Signal inputReady; /** @brief Notifies when data can be written This signal is send when the IODevice is monitored in a Selector or EventLoop and the device is ready to write data. */ Signal outputReady; virtual IODeviceImpl& ioimpl() = 0; bool reading() const { return _rbuf != 0; } bool writing() const { return _wbuf != 0; } char* rbuf() const { return _rbuf; } size_t rbuflen() const { return _rbuflen; } size_t ravail() const { return _ravail; } const char* wbuf() const { return _wbuf; } size_t wbuflen() const { return _wbuflen; } size_t wavail() const { return _wavail; } protected: //! @brief Default Constructor IODevice(); virtual size_t onBeginRead(char* buffer, size_t n, bool& eof); virtual size_t onEndRead(bool& eof); //! @brief Read bytes from device virtual size_t onRead(char* buffer, size_t count, bool& eof); virtual size_t onBeginWrite(const char* buffer, size_t n); virtual size_t onEndWrite(); //! @brief Write bytes to device virtual size_t onWrite(const char* buffer, size_t count); virtual void onClose(); virtual void onCancel(); //! @brief Read data from I/O device without consuming them virtual size_t onPeek(char*, size_t) { return 0; } //! @brief Returns true if device is seekable virtual bool onSeekable() const { return false; } virtual void onAttach(SelectorBase&); virtual void onDetach(SelectorBase&); //! @brief Move the next read position to the given offset virtual pos_type onSeek(off_type, std::ios::seekdir) { throw IOError("Could not seek on device."); } //! @brief Synchronize device virtual void onSync(); //! @brief Returns the size of the device virtual size_t onSize() const { return 0; } //! @brief Sets or unsets the device to eof void setEof(bool eof); //! @brief Sets or unsets the device to async void setAsync(bool async); private: bool _eof; bool _async; protected: char* _rbuf; size_t _rbuflen; size_t _ravail; const char* _wbuf; size_t _wbuflen; size_t _wavail; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/lrucache.h0000664000175000017500000001366613644433072015451 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LRUCACHE_H #define CXXTOOLS_LRUCACHE_H #include #include namespace cxxtools { /** Implements a lru cache */ template class LruCache { struct Data { unsigned serial; Value value; Data() { } Data(unsigned serial_, const Value& value_) : serial(serial_), value(value_) { } }; typedef std::map DataType; DataType data; typename DataType::size_type maxElements; unsigned serial; unsigned hits; unsigned misses; unsigned _nextSerial() { if (serial == std::numeric_limits::max()) { for (typename DataType::iterator it = data.begin(); it != data.end(); ++it) it->second.serial = 0; serial = 1; } return serial++; } typename DataType::iterator _getOldest() { typename DataType::iterator foundElement = data.begin(); typename DataType::iterator it = data.begin(); for (++it; it != data.end(); ++it) if (it->second.serial < foundElement->second.serial) foundElement = it; return foundElement; } public: typedef typename DataType::size_type size_type; typedef Value value_type; explicit LruCache(size_type maxElements_) : maxElements(maxElements_), serial(0), hits(0), misses(0) { } /// returns the number of elements currently in the cache size_type size() const { return data.size(); } /// returns the maximum number of elements in the cache size_type getMaxElements() const { return maxElements; } void setMaxElements(size_type maxElements_) { maxElements = maxElements_; while (data.size() > maxElements) data.erase(_getOldest()); } /// removes a element from the cache and returns true, if found bool erase(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) return false; data.erase(it); return true; } /// clears the cache. void clear(bool stats = false) { data.clear(); if (stats) hits = misses = 0; } /// puts a new element in the cache. If the element is already found in /// the cache, it is considered a cache hit and pushed to the top of the /// list. Value& put(const Key& key, const Value& value) { typename DataType::iterator it = data.find(key); if (it == data.end()) { if (data.size() >= maxElements) data.erase(_getOldest()); it = data.insert(data.begin(), typename DataType::value_type(key, Data(_nextSerial(), value))); } else { // element found it->second.serial = _nextSerial(); } return it->second.value; } Value* getptr(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) { ++misses; return 0; } it->second.serial = _nextSerial(); ++hits; return &it->second.value; } /// returns a pair of values - a flag, if the value was found and the /// value if found or the passed default otherwise. If the value is /// found it is a cache hit and pushed to the top of the list. std::pair getx(const Key& key, Value def = Value()) { Value* v = getptr(key); return v ? std::pair(true, *v) : std::pair(false, def); } /// returns the value to a key or the passed default value if not found. /// If the value is found it is a cahce hit and pushed to the top of the /// list. Value get(const Key& key, Value def = Value()) { return getx(key, def).second; } /// returns the number of hits. unsigned getHits() const { return hits; } /// returns the number of misses. unsigned getMisses() const { return misses; } /// returns the cache hit ratio between 0 and 1. double hitRatio() const { return hits+misses > 0 ? static_cast(hits)/static_cast(hits+misses) : 0; } /// returns the ratio, between held elements and maximum elements. double fillfactor() const { return static_cast(data.size()) / static_cast(maxElements); } }; } #endif // CXXTOOLS_LRUCACHE_H cxxtools-3.0/include/cxxtools/remoteexception.h0000664000175000017500000000436113644433072017065 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTEEXCEPTION_H #define CXXTOOLS_REMOTEEXCEPTION_H #include #include namespace cxxtools { class RemoteException : public std::exception { public: RemoteException() : _rc(0) { } explicit RemoteException(const std::string& text, int rc = 0) : _text(text), _rc(rc) { } ~RemoteException() throw () { } const char* what() const throw () { return _text.c_str(); } const std::string& text() const { return _text; } int rc() const { return _rc; } void text(const std::string& t) { _text = t; } void rc(int v) { _rc = v; } void clear() { _rc = 0; _text.clear(); } protected: std::string _text; int _rc; }; } #endif // CXXTOOLS_REMOTEEXCEPTION_H cxxtools-3.0/include/cxxtools/mime.h0000664000175000017500000002511413644433072014601 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MIME_H #define CXXTOOLS_MIME_H #include #include #include #include namespace cxxtools { class MimeEntity; class MimeMultipart; class SerializationInfo; /** The class implements a base class for mime entities, with headers as specified in rfc2045. */ class MimeHeader { friend std::ostream& operator<< (std::ostream& out, const MimeHeader& mimeHeader); friend void operator<<= (SerializationInfo& si, const MimeHeader& mh); friend void operator>>= (const SerializationInfo& si, MimeHeader& mh); typedef std::vector > HeadersType; HeadersType headers; public: /// returns the header value or a default value std::string getHeader(const std::string& key, const std::string& def = std::string()) const; /// Set a header line to the mime entity. void setHeader(const std::string& key, const std::string& value, bool replace = true); /// Adds a header line to the mime entity. void addHeader(const std::string& key, const std::string& value) { headers.push_back(HeadersType::value_type(key, value)); } /// Removes the header void unsetHeader(const std::string& key); /// Returns true, if the content type is multipart/* bool isMultipart() const; }; /** A MimeEntity is a message with headers and a body. The headers contain typically a content type, which specifies, how the body is to be interpreted. */ class MimeEntity : public MimeHeader { friend std::ostream& operator<< (std::ostream& out, const MimeEntity& mimeEntity); friend void operator<<= (SerializationInfo& si, const MimeEntity& mo); friend void operator>>= (const SerializationInfo& si, MimeEntity& mo); friend MimeEntity& operator<< (MimeEntity& me, const std::string& str); friend MimeEntity& operator<< (MimeEntity& me, const char* str); public: enum ContentTransferEncoding { none, quotedPrintable, base64 }; private: std::string body; public: /// Creates an mime entity without headers and an empty body. MimeEntity() { } /// Creates an mime entity from a string. /// The string must be a mime message. On errors an exception is thrown. explicit MimeEntity(const std::string& data); /// Reads an mime entity from a input stream. explicit MimeEntity(std::istream& in); /// Returns the body of the message. const std::string& getBody() const { return body; } /// Returns the body of the message. std::string& getBody() { return body; } /// Sets the body of the message. MimeEntity& setBody(const std::string& b) { body = b; return *this; } MimeEntity& readBody(std::istream& in); MimeEntity& setContentTransferEncoding(ContentTransferEncoding cte); ContentTransferEncoding getContentTransferEncoding() const; MimeEntity& setContentType(const std::string& ct) { setHeader("Content-Type", ct); return *this; } std::string getContentType() const { return getHeader("Content-Type"); } MimeEntity& setHeader(const std::string& key, const std::string& value, bool replace = true) { MimeHeader::setHeader(key, value, replace); return *this; } }; /// operator to add a std::string to a mime entity body. inline MimeEntity& operator<< (MimeEntity& me, const std::string& str) { me.body.append(str); return me; } /// operator to add a const char* to a mime entity body. inline MimeEntity& operator<< (MimeEntity& me, const char* str) { me.body.append(str); return me; } /** A MimeMultipart is a mime entity with multiple embedded entities. */ class MimeMultipart : public MimeHeader { friend std::ostream& operator<< (std::ostream& out, const MimeMultipart& mime); friend void operator<<= (SerializationInfo& si, const MimeMultipart& mm); friend void operator>>= (const SerializationInfo& si, MimeMultipart& mm); friend void operator>>= (const SerializationInfo& si, MimeEntity& mo); public: typedef MimeEntity::ContentTransferEncoding ContentTransferEncoding; enum Type { typeMixed, typeAlternative, typeDigest, typeParallel, typeRelated }; private: typedef std::vector PartsType; PartsType parts; std::string type; // mixed or alternative void partsFromBody(const std::string& body, std::string::size_type pos = 0); static std::string stringParts(const std::vector& parts, std::vector& sparts); public: typedef PartsType::const_iterator const_iterator; typedef PartsType::iterator iterator; typedef PartsType::size_type size_type; /// Parses a multipart entity. explicit MimeMultipart(const std::string& data); /// Make a MimeMultipart entity from a MimeEntity. /// If the content type is not multipart/something, a exception is thrown. MimeMultipart(const MimeEntity& mimeEntity); /// Creates a empty MimeMultipart object explicit MimeMultipart(Type type_ = typeMixed) { setType(type_); } /// Returns the number of entities in this object. size_type size() const { return parts.size(); } /// Returns the nth entity. MimeEntity& operator[] (size_type n) { return parts[n]; } /// Returns the nth entity. const MimeEntity& operator[] (size_type n) const { return parts[n]; } /// Returns a iterator to the first entity. iterator begin() { return parts.begin(); } /// Returns a iterator after the last entity. iterator end() { return parts.end(); } /// Returns a iterator to the first entity. const_iterator begin() const { return parts.begin(); } /// Returns a iterator after the last entity. const_iterator end() const { return parts.end(); } void setType(Type type_); void setType(const std::string& type_) { type = type_; } /// Adds a empty mime entity and returns a reference to it. MimeEntity& addObject() { parts.resize(parts.size() + 1); return parts.back(); } /// Adds a entity to the mime entity. MimeEntity& addObject(const MimeEntity& mimeEntity) { parts.push_back(mimeEntity); return parts.back(); } /// Adds a entity to the mime entity. The data is passed as a std::string. MimeEntity& addObject(const std::string& data, const std::string& contentType = "text/plain; charset=UTF-8", ContentTransferEncoding contentTransferEncoding = MimeEntity::quotedPrintable); /// Adds a entity to the mime entity. The data is read from a input stream. MimeEntity& addObject(std::istream& in, const std::string& contentType = "text/plain; charset=UTF-8", ContentTransferEncoding contentTransferEncoding = MimeEntity::quotedPrintable); MimeEntity& addObject(const MimeMultipart& mimeMultipart); /// Adds a text file. The data is passed as a std::string. MimeEntity& attachTextFile(const std::string& data, const std::string& filename, const std::string& contentType = "text/plain; charset=UTF-8") { MimeEntity& mimeEntity = addObject(data, contentType, MimeEntity::quotedPrintable); mimeEntity.addHeader("Content-Disposition", "attachment; filename=" + filename); return mimeEntity; } /// Adds a text file. The data is read from a istream MimeEntity& attachTextFile(std::istream& in, const std::string& filename, const std::string& contentType = "text/plain; charset=UTF-8") { MimeEntity& mimeEntity = addObject(in, contentType, MimeEntity::quotedPrintable); mimeEntity.addHeader("Content-Disposition", "attachment; filename=" + filename); return mimeEntity; } /// Adds a binary file. The data is passed as a std::string. MimeEntity& attachBinaryFile(const std::string& data, const std::string& filename, const std::string& contentType = "application/x-binary") { MimeEntity& mimeEntity = addObject(data, contentType, MimeEntity::base64); mimeEntity.addHeader("Content-Disposition", "attachment; filename=" + filename); return mimeEntity; } /// Adds a binary file. The data is read from a istream MimeEntity& attachBinaryFile(std::istream& in, const std::string& filename, const std::string& contentType = "application/x-binary") { MimeEntity& mimeEntity = addObject(in, contentType, MimeEntity::base64); mimeEntity.addHeader("Content-Disposition", "attachment; filename=" + filename); return mimeEntity; } }; std::ostream& operator<< (std::ostream& out, const MimeHeader& mimeHeader); std::ostream& operator<< (std::ostream& out, const MimeEntity& mimeEntity); std::ostream& operator<< (std::ostream& out, const MimeMultipart& mime); } #endif cxxtools-3.0/include/cxxtools/multifstream.h0000664000175000017500000000656313644433072016375 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MULTIFSTREAM_H #define CXXTOOLS_MULTIFSTREAM_H #include #include #include #include namespace cxxtools { /** Read multiple files as one stream. Multiple files are */ class multifstreambuf : public std::streambuf { glob_t mglob; unsigned current; std::filebuf file; char ch; typedef std::queue > patterns_type; patterns_type patterns; public: multifstreambuf(); explicit multifstreambuf(const char* pattern, int flags = 0); ~multifstreambuf(); bool open_next(); int_type overflow(int_type c); int_type underflow(); int sync(); const char* current_filename() const { return mglob.gl_pathv[current]; } void add_pattern(const std::string& pattern, int flags = 0) { patterns.push(patterns_type::value_type(pattern, flags)); } }; class multi_ifstream : public std::istream { multifstreambuf buffer; public: multi_ifstream() : std::istream(0) { init(&buffer); } multi_ifstream(const char* pattern, int flags = 0) : std::istream(0), buffer(pattern, flags) { init(&buffer); } const char* current_filename() const { return buffer.current_filename(); } void add_pattern(const std::string& pattern, int flags = 0) { buffer.add_pattern(pattern, flags); } /// stl-compatible inserter class pattern_inserter : public std::iterator { multi_ifstream& m; public: pattern_inserter(multi_ifstream& m_) : m(m_) { } pattern_inserter& operator= (const std::string& p) { m.add_pattern(p); return *this; } pattern_inserter& operator* () { return *this; } pattern_inserter& operator++ () { return *this; } pattern_inserter& operator++ (int) { return *this; } }; pattern_inserter back_inserter() { return pattern_inserter(*this); } }; } #endif // CXXTOOLS_MULTIFSTREAM_H cxxtools-3.0/include/cxxtools/slot.h0000664000175000017500000000354013644433072014632 00000000000000/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Slot_h #define cxxtools_Slot_h #include namespace cxxtools { class Connection; class Slot { public: virtual ~Slot() {} virtual Slot* clone() const = 0; virtual const void* callable() const = 0; virtual void onConnect(const Connection& c) = 0; virtual void onDisconnect(const Connection& c) = 0; virtual bool equals(const Slot& slot) const = 0; }; #include } #endif cxxtools-3.0/include/cxxtools/thread.h0000664000175000017500000002607713644433072015132 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * Copyright (C) 2006-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_THREAD_H #define CXXTOOLS_THREAD_H #include #include #include #include namespace cxxtools { /** @brief Platform independent threads This is a thread base class, which is flexible, but hard to use. Try to use either an AttachedThread or a DetachedThread instead !!! A Thread represents a separate thread of control within the program. It shares data with all the other threads within the process but executes independently in the way that a separate program does on a multitasking operating system. Each thread gets its own stack, which size is determinated by the operating system. The execution of a thread starts either by calling the start() which calls the thread entry object passed to the constructor. Threads can either be joined, so you can wait for them, or be detached, so they run indepentently. A thread can be forced to terminate by calling terminate(), however, doing so is dangerous and discouraged. Thread also provides a platform independent sleep function. A thread can give up CPU time either by calling Thread::yield() or sleep() to stop for a specified periode of time. */ class Thread { #if __cplusplus >= 201103L Thread(const Thread&) = delete; Thread& operator=(const Thread&) = delete; #else Thread(const Thread&) { } Thread& operator=(const Thread&) { return *this; } #endif public: //! @brief Status of a thread enum State { Ready = 0, //!< Thread was not started yet Running = 1, //!< Thread was started Finished = 2 //!< Thread has Finished }; protected: /** @brief Default Constructor Constructs a thread object without a thread entry. Use the init() method to set a callable. The thread will terminate immediately, if no thread entry is set. */ Thread(); /** @brief Constructs a thread with a thread entry Constructs a thread object to execute the %Callable \a cb. The Thread is not started on construction, but when start() is called. */ explicit Thread(const Callable& cb); /** @brief Initialize with a thread entry The callable \a cb will be used as the thread entry. If another thread entry was set previously it will be replaced. */ void init(const Callable& cb); public: /** @brief Destructor The thread must either be joined or detached before the destructor is called. */ virtual ~Thread(); //! @brief Returns the current state of the thread. State state() const { return _state; } /** @brief Starts the thread This starts the execution of the thread by calling the thread entry. Throws a SystemError on failure. */ void start(); void create() { this->start(); } /** @brief Exits athread. This function is meant to be called from within a thread to leave the thread at once. Implicitly called when the thread entry is left. Throws a SystemError on failure. */ static void exit(); /** @brief Yield CPU time This function is meant to be called from within a thread to give up the CPU to other threads. Throws a SystemError on failure. */ static void yield(); /** @brief Sleep for some time The calling thread sleeps for a specified timespan. Since the Milliseconds class has conversion from double to Milliseconds it is possible to pass just a number. Another possibility is to pass another Timespan object. The cxxtools::Seconds is also derived from Timespan an hence perfectly ok. Example: @code cxxtools::Thread::sleep(500); // waits 500 milliseconds cxxtools::Thread::sleep(cxxtools::Seconds(0.5)); // waits 500 milliseconds @endcode */ static void sleep(const Milliseconds& ts); protected: //! @brief Detaches the thread void detach(); //! @brief Joins the thread void join(); //! @brief Joins the thread bool joinNoThrow(); //! @brief Terminates the thread void terminate(); private: //! @internal Thread::State _state; //! @internal class ThreadImpl* _impl; }; /** @brief Platform independent joinable thread %AttachedThreads are threads, which are managed by the creator, and are normally created on the stack. The creator must wait, until the thread terminates either explicitly by calling join() or implicitly by the destructor. The life-time of the callable object must exceed the life-time of the thread. Mind the order of destruction if the %AttachedThread is a member variable of a class. Example: \code struct Operation { void run() { // implement, whatever needs to be done in parallel } }; int main() { Operation op; cxxtools::Thread thread( cxxtools::callable(op, &Operation::run) ); thread.start(); // the thread runs and we can do something else in parallel doMoreWork(); // the thread's destructor waits for the thread to join // the op object outlives the thread object return 0; } \endcode */ class AttachedThread : public Thread { public: /** @brief Constructs a thread with a thread entry Constructs a thread object to execute the %Callable \a cb. The Thread is not started on construction, but when start() is called. */ explicit AttachedThread(const Callable& cb) : Thread(cb) {} //! @brief Joins the thread, if not already joined. ~AttachedThread() { Thread::joinNoThrow(); } /** @brief Wait explicitly for the thread to terminate. Join() is called automatically in the destructor if not already called. Throws SystemError on failure */ void join() { Thread::join(); } /** @brief Terminates the thread. Forces the thread to terminate is dangerous and discouraged. */ void terminate() { Thread::terminate(); } }; /** @brief Platform independent detached thread A detached thread runs just for its own. The user does not need (actually can not even) wait for the thread to stop. The object is normally created on the heap. Example: \code class MyThread : public cxxtools::DetachedThread { protected: void run(); }; void MyThread::run() { // implement, whatever needs to be done in parallel } void someFunc() { MyThread *thread = new MyThread(); thread->start(); // here the thread runs and the program can do something // else in parallel. It continues to run even after this // function returns. The object is automatically destroyed, // when the thread has finished. } \endcode */ class DetachedThread : public Thread { typedef void (*FuncPtrT)(); public: explicit DetachedThread(FuncPtrT fp) : Thread( callable(fp) ) { Thread::detach(); } protected: /** @brief Constructs a detached thread Constructs a thread object to execute the virtual method run() when start() is called. %DetachedThreads are always destructed by the virtual method destroy(). If objects of this class are created by new, destroy() must be overloaded ti call delete. */ DetachedThread() : Thread() { Thread::init( callable(*this, &DetachedThread::exec) ); Thread::detach(); } /** @brief Destroys a detached thread This method is called after the thread has finished. The default implementation uses delete to destruct this object. */ virtual void destroy() { delete this; } /** @brief Thread entry method This method is executed in a separate thread once start() is called. Override this method to implement a thread. */ virtual void run() {} private: //! @internal void exec() { this->run(); this->destroy(); } }; } // !namespace cxxtools #endif // namespace cxxtools cxxtools-3.0/include/cxxtools/remoteprocedure.h0000664000175000017500000007023113644433072017056 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTEPROCEDURE_H #define CXXTOOLS_REMOTEPROCEDURE_H #include #include #include #include #include #include #include namespace cxxtools { class IRemoteProcedure { public: IRemoteProcedure(RemoteClient& client, const String& name) : _client(&client) , _name(name) { } virtual ~IRemoteProcedure() { cancel(); } RemoteClient& client() { return *_client; } void client(RemoteClient& client) { _client = &client; } const String& name() const { return _name; } virtual void setFault(int rc, const std::string& msg) = 0; virtual bool failed() const = 0; void cancel() { if (_client && _client->activeProcedure() == this) _client->cancel(); } virtual void onFinished() = 0; private: RemoteClient* _client; String _name; }; /** Base class for Remote procedure class. * */ template class RemoteProcedureBase : public IRemoteProcedure { public: RemoteProcedureBase(RemoteClient& client, const String& name) : IRemoteProcedure(client, name), _result(client) { } void setFault(int rc, const std::string& msg) { _result.setFault(rc, msg); } /// access result value. const R& value() const { return _result.value(); } /** Finalize call and return result. * Exceptions are thrown when the call resulted in a exception. * The method should be called just once since the exception state * is partly reset. */ #if __cplusplus >= 201103L R&& result() #else R& result() #endif { return _result.get(); } virtual bool failed() const { return _result.failed(); } Signal< RemoteResult & > finished; #if __cplusplus >= 201103L R&& end(Milliseconds msecs = RemoteClient::WaitInfinite) #else R& end(Milliseconds msecs = RemoteClient::WaitInfinite) #endif { _result.client().wait(msecs); return _result.get(); } protected: void onFinished() { finished.send(_result); } RemoteResult _result; Composer _r; }; //! @endcond internal /// Template for calling a remote procedure. // generated with `remoteprocedure.pl -n 10` //! @cond internal template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); _a10.begin(a10); this->_r.begin(this->_result.value()); IDecomposer* argv[10] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9, &_a10 }; this->client().beginCall(this->_r, *this, argv, 10); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); _a10.begin(a10); this->_r.begin(this->_result.value()); IDecomposer* argv[10] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9, &_a10 }; this->client().call(this->_r, *this, argv, 10); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) #endif { return this->call(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; Decomposer _a5; Decomposer _a6; Decomposer _a7; Decomposer _a8; Decomposer _a9; Decomposer _a10; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); this->_r.begin(this->_result.value()); IDecomposer* argv[9] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9 }; this->client().beginCall(this->_r, *this, argv, 9); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); this->_r.begin(this->_result.value()); IDecomposer* argv[9] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9 }; this->client().call(this->_r, *this, argv, 9); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) #endif { return this->call(a1, a2, a3, a4, a5, a6, a7, a8, a9); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; Decomposer _a5; Decomposer _a6; Decomposer _a7; Decomposer _a8; Decomposer _a9; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); this->_r.begin(this->_result.value()); IDecomposer* argv[8] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8 }; this->client().beginCall(this->_r, *this, argv, 8); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); this->_r.begin(this->_result.value()); IDecomposer* argv[8] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8 }; this->client().call(this->_r, *this, argv, 8); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) #endif { return this->call(a1, a2, a3, a4, a5, a6, a7, a8); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; Decomposer _a5; Decomposer _a6; Decomposer _a7; Decomposer _a8; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); this->_r.begin(this->_result.value()); IDecomposer* argv[7] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7 }; this->client().beginCall(this->_r, *this, argv, 7); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); this->_r.begin(this->_result.value()); IDecomposer* argv[7] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7 }; this->client().call(this->_r, *this, argv, 7); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) #endif { return this->call(a1, a2, a3, a4, a5, a6, a7); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; Decomposer _a5; Decomposer _a6; Decomposer _a7; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); this->_r.begin(this->_result.value()); IDecomposer* argv[6] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6 }; this->client().beginCall(this->_r, *this, argv, 6); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); this->_r.begin(this->_result.value()); IDecomposer* argv[6] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6 }; this->client().call(this->_r, *this, argv, 6); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) #endif { return this->call(a1, a2, a3, a4, a5, a6); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; Decomposer _a5; Decomposer _a6; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); this->_r.begin(this->_result.value()); IDecomposer* argv[5] = { &_a1, &_a2, &_a3, &_a4, &_a5 }; this->client().beginCall(this->_r, *this, argv, 5); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); this->_r.begin(this->_result.value()); IDecomposer* argv[5] = { &_a1, &_a2, &_a3, &_a4, &_a5 }; this->client().call(this->_r, *this, argv, 5); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) #endif { return this->call(a1, a2, a3, a4, a5); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; Decomposer _a5; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); this->_r.begin(this->_result.value()); IDecomposer* argv[4] = { &_a1, &_a2, &_a3, &_a4 }; this->client().beginCall(this->_r, *this, argv, 4); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4) #else R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); this->_r.begin(this->_result.value()); IDecomposer* argv[4] = { &_a1, &_a2, &_a3, &_a4 }; this->client().call(this->_r, *this, argv, 4); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4) #else R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4) #endif { return this->call(a1, a2, a3, a4); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; Decomposer _a4; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); this->_r.begin(this->_result.value()); IDecomposer* argv[3] = { &_a1, &_a2, &_a3 }; this->client().beginCall(this->_r, *this, argv, 3); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2, const A3& a3) #else R& call(const A1& a1, const A2& a2, const A3& a3) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); this->_r.begin(this->_result.value()); IDecomposer* argv[3] = { &_a1, &_a2, &_a3 }; this->client().call(this->_r, *this, argv, 3); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2, const A3& a3) #else R& operator()(const A1& a1, const A2& a2, const A3& a3) #endif { return this->call(a1, a2, a3); } private: Decomposer _a1; Decomposer _a2; Decomposer _a3; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1, const A2& a2) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); this->_r.begin(this->_result.value()); IDecomposer* argv[2] = { &_a1, &_a2 }; this->client().beginCall(this->_r, *this, argv, 2); } #if __cplusplus >= 201103L R&& call(const A1& a1, const A2& a2) #else R& call(const A1& a1, const A2& a2) #endif { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); this->_r.begin(this->_result.value()); IDecomposer* argv[2] = { &_a1, &_a2 }; this->client().call(this->_r, *this, argv, 2); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1, const A2& a2) #else R& operator()(const A1& a1, const A2& a2) #endif { return this->call(a1, a2); } private: Decomposer _a1; Decomposer _a2; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin(const A1& a1) { this->_result.clearFault(); _a1.begin(a1); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { &_a1 }; this->client().beginCall(this->_r, *this, argv, 1); } #if __cplusplus >= 201103L R&& call(const A1& a1) #else R& call(const A1& a1) #endif { this->_result.clearFault(); _a1.begin(a1); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { &_a1 }; this->client().call(this->_r, *this, argv, 1); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()(const A1& a1) #else R& operator()(const A1& a1) #endif { return this->call(a1); } private: Decomposer _a1; }; template class RemoteProcedure : public RemoteProcedureBase { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase(client, String(name)) { } void begin() { this->_result.clearFault(); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { 0 }; this->client().beginCall(this->_r, *this, argv, 0); } #if __cplusplus >= 201103L R&& call() #else R& call() #endif { this->_result.clearFault(); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { 0 }; this->client().call(this->_r, *this, argv, 0); return this->_result.get(); } #if __cplusplus >= 201103L R&& operator()() #else R& operator()() #endif { return this->call(); } }; //! @endcond internal // end generated with `remoteprocedure.pl -n 10` } #endif cxxtools-3.0/include/cxxtools/dlloader.h0000664000175000017500000000312213644433072015433 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DLLOADER_H #define CXXTOOLS_DLLOADER_H #include namespace cxxtools { /// @deprecated namespace dl { using cxxtools::Library; using cxxtools::Symbol; } } #endif // CXXTOOLS_DLLOADER_H cxxtools-3.0/include/cxxtools/iniparser.h0000664000175000017500000000650013644433072015644 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_INIPARSER_H #define CXXTOOLS_INIPARSER_H #include #include #include namespace cxxtools { /** * Parser for files in ini-format */ class IniParser { public: class Event { protected: virtual ~Event() { } public: // events return true, if parsing should be stopped virtual bool onSection(const String& section); virtual bool onKey(const String& key); virtual bool onValue(const String& value); virtual bool onComment(const String& comment); virtual bool onError(); /// for compatibility with older implementation offer methods with utf-8 encoded strings virtual bool onSection(const std::string& section); virtual bool onKey(const std::string& key); virtual bool onValue(const std::string& value); }; private: Event& event; String data; enum { state_0, state_section, state_key, state_key_sp, state_value0, state_value, state_valueesc, state_valuesq, // single quote state_valuesqesc, state_valuedq, // double quote state_valuedqesc, state_valueqend, state_comment } state; public: IniParser(Event& event_) : event(event_), state(state_0) { } bool parse(Char ch); void end(); void parse(std::istream& in, TextCodec* codec = new Utf8Codec()); void parse(std::basic_istream& in); }; } #endif cxxtools-3.0/include/cxxtools/streambuffer.h0000664000175000017500000001431713644433072016342 00000000000000/* * Copyright (C) 2005 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_System_StreamBuffer_h #define cxxtools_System_StreamBuffer_h #include #include #include namespace cxxtools { template class BasicStreamBuffer : public std::basic_streambuf { public: std::streamsize speekn(CharT* buffer, std::streamsize size) { return this->xspeekn(buffer, size); } std::streamsize out_avail() { if( this->pptr() ) return this->pptr() - this->pbase(); return 0; } protected: virtual std::streamsize xspeekn(CharT* buffer, std::streamsize size) { if(size == 0) return 0; buffer[0] = this->sgetc(); return 1; } }; //! @brief A stream buffer for IODevices with linear buffer area class StreamBuffer : public BasicStreamBuffer, public Connectable { public: //! @brief Constructs an IOBuffer for an IODevice explicit StreamBuffer(IODevice& ioDevice, size_t bufferSize = 8192, bool extend = false); //! @brief Default constructor explicit StreamBuffer(size_t bufferSize = 8192, bool extend = false); ~StreamBuffer(); void attach(IODevice& ioDevice); IODevice* device() { return _ioDevice; } /** Sets the stream buffer in reading mode. * * This signals the cxxtools::Selector, that the streambuffer is interested in * receiving data. When data is available the cxxtools::Selector will emit * the inputReady signal. After that endRead can be called without blocking. */ void beginRead(); /** Finalizes a read initiated with beginRead. * * The call to endRead reads at least one byte from the underlying I/O device * to the buffer. When no data is available, the call will block. */ void endRead(); /** Sets the stream buffer in writing mode if data is available in output buffer. * * The device will emit a outputReady signal when it will be ready to * write without blocking. When there is no data to be written, the * device mode is not changed. * * The streambuffer tries to write data immediately. The number of * bytes written is returned. When data is already written, the device * is still changed to writing mode and a endWrite must be called to * finalize the write. * * When the device is already in writing mode, nothing is done. */ size_t beginWrite(); /** Finalizes the write operation. * * A write operation must be finalized with the call to endWrite. * The method returns the number of bytes written either when * beginWrite was called or here on endWrite. */ size_t endWrite(); /** Returns true if the underlying device is in reading mode. * * The device is in reading mode, when beginRead has been called. * The call of endRead finished the reading mode. */ bool reading() const { return _ioDevice && _ioDevice->reading(); } /** Returns true if the underlying device is in writing mode. * * The device is in writing mode, when beginWrite has been called. * The call of endWrite finished the writing mode. */ bool writing() const { return _ioDevice && _ioDevice->writing(); } /** Empties the data in the buffer. * * The device must not be in reading or writing mode. A exception of * type cxxtools::IOPending will be thrown otherwise. */ void discard(); /** Signals, that the underlying I/O device has data to read. */ Signal inputReady; /** Signals, that the underlying I/O device can receive data without blocking. */ Signal outputReady; protected: virtual int sync(); virtual std::streamsize xspeekn(char* buffer, std::streamsize size); virtual int_type underflow(); virtual int_type overflow(int_type ch); virtual int_type pbackfail(int_type c); /** @brief Alters the stream positions */ virtual pos_type seekoff(off_type offset, std::ios::seekdir sd, std::ios::openmode mode); /** @brief Alters the stream positions */ virtual pos_type seekpos(pos_type p, std::ios::openmode mode ); private: void onRead(IODevice& dev); void onWrite(IODevice& dev); private: IODevice* _ioDevice; size_t _ibufferSize; char* _ibuffer; std::size_t _obufferSize; char* _obuffer; const size_t _pbmax; bool _oextend; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/typetraits.h0000664000175000017500000001404513644433072016063 00000000000000/* * Copyright (C) 2005 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_TypeTraits_h #define cxxtools_TypeTraits_h #include #include #include namespace cxxtools { template struct TypeTraitsBase { typedef T Value; typedef const T ConstValue; typedef T& Reference; typedef const T& ConstReference; typedef T* Pointer; typedef const T* ConstPointer; }; /** @brief Type-traits for for non-const value types Compile time type information (CTTI) is implemented in cxxtools by the means of TypeTraits. A number of specialisations allows compile type branching in gerneric code depending on the type. */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 0; static const unsigned int isReference = 0; }; /** @brief Type-traits for for const value types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 1; static const unsigned int isPointer = 0; static const unsigned int isReference = 0; }; /** @brief Type-traits for for non-const reference types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 0; static const unsigned int isReference = 1; }; /** @brief Type-traits for for const reference types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 1; static const unsigned int isPointer = 0; static const unsigned int isReference = 1; }; /** @brief Type-traits for for non-const pointer types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 1; static const unsigned int isReference = 0; }; /** @brief Type-traits for for const pointer types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 1; static const unsigned int isPointer = 1; static const unsigned int isReference = 0; }; /** @brief Type-traits for for fixed-size array types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 1; static const unsigned int isReference = 0; }; /** @brief Type-traits for for void */ template <> struct TypeTraits { typedef void Value; typedef void ConstType; typedef void Reference; typedef void ConstReference; typedef void* Pointer; typedef void* ConstPointer; static const unsigned int isConst = 0; static const unsigned int isPointer = 0; static const unsigned int isReference = 0; }; template struct IntTraits {}; template <> struct IntTraits { typedef unsigned char Unsigned; typedef signed char Signed; }; template <> struct IntTraits { typedef unsigned char Unsigned; typedef signed char Signed; }; template <> struct IntTraits { typedef unsigned short Unsigned; typedef signed short Signed; }; template <> struct IntTraits { typedef unsigned short Unsigned; typedef signed short Signed; }; template <> struct IntTraits { typedef unsigned int Unsigned; typedef signed int Signed; }; template <> struct IntTraits { typedef unsigned int Unsigned; typedef signed int Signed; }; template <> struct IntTraits { typedef unsigned long Unsigned; typedef signed long Signed; }; template <> struct IntTraits { typedef unsigned long Unsigned; typedef signed long Signed; }; #ifdef HAVE_LONG_LONG template <> struct IntTraits { typedef unsigned long long Unsigned; typedef signed long long Signed; }; #endif #ifdef HAVE_UNSIGNED_LONG_LONG template <> struct IntTraits { typedef unsigned long long Unsigned; typedef signed long long Signed; }; #endif } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/timer.h0000664000175000017500000001562013644433072014773 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef Cxxtools_System_Timer_h #define Cxxtools_System_Timer_h #include #include namespace cxxtools { class DateTime; class UtcDateTime; class SelectorBase; /** @brief Notifies clients in constant intervals Timers can be used to be notified if a time interval expires. It usually works with a Selector or event loop, where the Timer needs to be registered. Timers send the timeout signal in given intervals, to which the interested clients connect. The interval can be changed at any time and timers can switch between an active and inactive state. The following code calls the function onTimer every second: @code void onTimer() { std::cerr << "Time out!\n"; } int main() { cxxtools::EventLoop loop; cxxtools::Timer timer(&loop); connect(timer.timeout, onTimer); timer.start(1000); loop.run(); return 0; } @endcode Note that a timer can process just one interval at once. When one of the methods is called while the timer is active, the previous interval will be stopped. */ class Timer { class Sentry; public: /** @brief Default constructor Constructs an inactive timer and optionally sets the selector, which must be done anyway to run the timer. */ explicit Timer(SelectorBase* selector = 0); /** @brief Destructor The destructor sends the destroyed signal. */ ~Timer(); SelectorBase* selector() { return _selector; } void setSelector(SelectorBase* s); void setSelector(SelectorBase& s) { setSelector(&s); } /** @brief Returs true if timer is active */ bool active() const; /** @brief Returns the current timer interval Returns the current interval of the timer in milliseconds. */ const Timespan& interval() const; /** @brief Starts the timer Start a timer from the moment this method is called. The Timer needs to be registered with a Selector or event loop, otherwise the timeout signal will not be sent. @param interval Timeout interval as cxxtools::Timespan */ void start(const Milliseconds& interval); /** @brief Starts the timer Start a timer. The start time is passed as a cxxtools::DateTime. If the start time is in the past, the timer starts on the next cycle. Past timer ticks are not catched up. The Timer needs to be registered with a Selector or event loop, otherwise the timeout signal will not be sent. @param interval Timeout interval as a cxxtools::Timespan */ void start(const DateTime& startTime, const Milliseconds& interval, bool localtime = true); /** @brief Starts the timer Start a timer. The timer will tick once after the specified time span. The Timer needs to be registered with a Selector or event loop, otherwise the timeout signal will not be sent. @param interval Timeout interval as a cxxtools::Timespan */ void after(const Milliseconds& interval); /** @brief Starts the timer Start a timer. The timer will tick once at the specified point in time. @param tickTime The time, when the timer should tick. */ void at(const DateTime& tickTime, bool localtime = true); void at(const UtcDateTime& tickTime); /** @brief Stops the timer If the Timer is registered with a Selector or an event loop, the timout signal will not be sent anymore. */ void stop(); /** @brief Update the timer This method is supposed to be called by the Selector or an event loop. If the interval timeout is passed the Timer will send the timeout signal and return true, otherwise internal times are updated and false is returned. */ bool update(); bool update(const Milliseconds& now); /** @brief Notifies about interval timeouts This signal is sent if the interval time has expired. */ Signal<> timeout; /** @brief Notifies about interval timeouts This signal is sent if the interval time has expired. As a parameter the due time is passed as local time. */ Signal timeoutts; /** @brief Notifies about interval timeouts This signal is sent if the interval time has expired. As a parameter the due time is passed in utc. */ Signal timeoutUtc; /** @brief Returns the timespan since epoch when the timer expires */ Timespan finished() const { return _finished; } private: Sentry* _sentry; SelectorBase* _selector; bool _active; Timespan _interval; Timespan _finished; bool _once; }; } #endif cxxtools-3.0/include/cxxtools/deserializer.h0000664000175000017500000001120113644433072016324 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DESERIALIZER_H #define CXXTOOLS_DESERIALIZER_H #include #include #include #include namespace cxxtools { /** * convert format to SerializationInfo */ class Deserializer { public: #ifdef HAVE_LONG_LONG typedef long long int_type; #else typedef long int_type; #endif #ifdef HAVE_UNSIGNED_LONG_LONG typedef unsigned long long unsigned_type; #else typedef unsigned long unsigned_type; #endif Deserializer() { } virtual ~Deserializer() { } /** @brief Deserialize an object This method will deserialize the object \a type from an input format. The type \a type must be serializable. */ template void deserialize(T& type) const { if (current() == 0) throw SerializationError("no data was processed"); *current() >>= type; } template void deserialize(T& type, const std::string& name) const { const SerializationInfo* p; if (current() == 0) throw SerializationError("no data was processed"); if ((p = current()->findMember(name)) == 0) throw SerializationMemberNotFound(*current(), name); *p >>= type; } SerializationInfo& si() { return _si; } const SerializationInfo& si() const { return _si; } void begin(); void clear(); SerializationInfo* current() { return _current.empty() ? 0 : _current.top(); } const SerializationInfo* current() const { return _current.empty() ? 0 : _current.top(); } void setCategory(SerializationInfo::Category category) { current()->setCategory(category); } void setName(const std::string& name) { current()->setName(name); } void setTypeName(const std::string& type) { current()->setTypeName(type); } void setValue(const String& value) { current()->setValue(value); } void setValue(const std::string& value) { current()->setValue(value); } void setValue(const char* value) { current()->setValue(value); } void setValue(bool value) { current()->setValue(value); } void setValue(char value) { current()->setValue(value); } void setValue(int_type value) { current()->setValue(value); } void setValue(unsigned_type value) { current()->setValue(value); } void setValue(long double value) { current()->setValue(value); } void setNull() { current()->setNull(); } void beginMember(const std::string& name, const std::string& type, SerializationInfo::Category category); void leaveMember(); private: SerializationInfo _si; std::stack _current; }; } #endif // CXXTOOLS_DESERIALIZER_H cxxtools-3.0/include/cxxtools/library.h0000664000175000017500000001153713644433072015322 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LIBRARY_H #define CXXTOOLS_LIBRARY_H #include namespace cxxtools { class Symbol; /** @brief Shared library loader This class can be used to dynamically load shared libraries and resolve symbols from it. The example below shows how to retrieve the address of the function 'myProcedure' in library 'MyLibrary': @code Library shlib("MyLibrary.dll"); void* procAddr = shlib["myProcedure"]; typedef int (*MyProcType)(); MyProcType proc =(MyProcType)procAddr; int result = proc(); @endcode */ class Library { public: /** @brief Default Constructor which does not load a library. */ Library(); /** @brief Loads a shared library. If a file could not be found at the given path, the path will be extended by the platform-specific shared library extension first and then also by the shared library prefix. If still no file can be found an exception is thrown. The library is loaded immediately. */ explicit Library(const std::string& path); Library(const Library& other); Library& operator=(const Library& other); /** @brief The destructor unloads the shared library from memory. */ ~Library(); /** @brief Loads a shared library. If a file could not be found at the given path, the path will be extended by the platform-specific shared library extension first and then also by the shared library prefix. If still no file can be found an exception is thrown. Calling this method twice might close the previously loaded library. */ Library& open(const std::string& path); void close(); /** @brief Resolves the symbol \a symbol from the shared library Returns the address of the symbol or 0 if it was not found. */ void* operator[](const char* symbol) const { return this->resolve(symbol); } /** @brief Resolves the symbol \a symbol from the shared library Returns the address of the symbol or 0 if it was not found. */ void* resolve(const char* symbol) const; /** @brief Returns null if invalid */ operator const void*() const; Symbol getSymbol(const char* symbol) const; /** @brief Returns true if invalid */ bool operator!() const; /** @brief Returns the path to the shared library image */ const std::string& path() const; /** @brief Returns the extension for shared libraries Returns ".so" on Linux, ".dll" on Windows. */ static std::string suffix(); /** @brief Returns the prefix for shared libraries Returns "lib" on Linux, "" on Windows */ static std::string prefix(); protected: void detach(); private: //! @internal class LibraryImpl* _impl; //! @internal std::string _path; }; /** @brief Symbol resolved from a shared library */ class Symbol { public: Symbol() : _sym(0) { } Symbol(const Library& lib, void* sym) : _lib(lib), _sym(sym) { } void* sym() const { return _sym; } const Library& library() const { return _lib; } operator void*() const { return _sym; } private: Library _lib; void* _sym; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/bin/0000775000175000017500000000000013672344760014334 500000000000000cxxtools-3.0/include/cxxtools/bin/deserializer.h0000664000175000017500000000552313644433072017106 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_DESERIALIZER_H #define CXXTOOLS_BIN_DESERIALIZER_H #include #include #include #include #include namespace cxxtools { namespace bin { class Deserializer : public cxxtools::Deserializer { public: typedef bin::Serializer::TypeCode TypeCode; /// Default construct binary deserializer. Deserializer() { } /// Creates a binary deserializer and processes all input from passed stream. explicit Deserializer(std::istream& in) { read(in); } Deserializer(const char* data, size_t size); /// Processes all input from passed stream. void read(std::istream& in); /// Initialize the binary deserializer to receive data. void begin(bool resetDictionary = true); /// Process available characters in input stream buf. /// Only characters available in input buffer are processed. No /// underflow is triggered. /// Returns true, if the end of data is reached. bool advance(std::streambuf& in) { return _parser.advance(in); } /// Rest of input is parsed but do not process any data. void skip() { _parser.skip(); } private: void doDeserialize(std::istream& in); Parser _parser; }; } } #endif // CXXTOOLS_BIN_DESERIALIZER_H cxxtools-3.0/include/cxxtools/bin/parser.h0000664000175000017500000001025613644433072015717 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_PARSER_H #define CXXTOOLS_BIN_PARSER_H #include #include #include namespace cxxtools { namespace bin { class Deserializer; class Parser { #if __cplusplus >= 201103L Parser(const Parser&) = delete; Parser& operator= (const Parser&) = delete; #else Parser(const Parser&) { } Parser& operator= (const Parser&) { return *this; } #endif explicit Parser(std::vector* dictionary) : _deserializer(0), _next(0), _dictionary(dictionary) { } public: Parser() : _deserializer(0), _next(0), _dictionary(&_mydictionary) { } ~Parser() { delete _next; } void begin(Deserializer& handler, bool resetDictionary = true); void finish(); void skip(); bool advance(std::streambuf& in, bool atLeastOne = false); // returns true, if value is complete private: bool processFloatBase(char ch, unsigned shift, unsigned expOffset); void dict(const std::string& s); enum State { state_type, state_name, state_name_idx0, state_name_idx1, state_value_type_other, state_value_type_other_idx0, state_value_type_other_idx1, state_value_type_bcd, state_value_type_bcd_idx0, state_value_type_bcd_idx1, state_value_intsign, state_value_int, state_value_uint, state_value_bool, state_value_char, state_value_bcd0, state_value_bcd, state_value_binary_length, state_value_binary, state_value_value, state_sfloat_exp, state_sfloat_base, state_mfloat_exp, state_mfloat_base, state_lfloat_exp, state_lfloat_base, state_object_type, state_object_type_other, state_object_type_other_idx0, state_object_type_other_idx1, state_object_member, state_object_member_value, state_array_type, state_array_type_other, state_array_type_other_idx0, state_array_type_other_idx1, state_array_member, state_array_member_value, state_array_member_value_next, state_end } _state, _nextstate; std::string _token; unsigned _count; uint64_t _int; int _exp; bool _isNeg; unsigned _dictidx; Deserializer* _deserializer; Parser* _next; std::vector _mydictionary; std::vector* _dictionary; }; } } #endif // CXXTOOLS_BIN_PARSER_H cxxtools-3.0/include/cxxtools/bin/formatter.h0000664000175000017500000001027213666667450016441 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_FORMATTER_H #define CXXTOOLS_BIN_FORMATTER_H #include #include #include namespace cxxtools { namespace bin { class Formatter : public cxxtools::Formatter { public: Formatter(); explicit Formatter(std::ostream& out); void begin(std::ostream& out); void finish(); virtual void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value); virtual void addValueStdString(const std::string& name, const std::string& type, const std::string& value); virtual void addValueChar(const std::string& name, const std::string& type, char value); virtual void addValueBool(const std::string& name, const std::string& type, bool value); virtual void addValueInt(const std::string& name, const std::string& type, int_type value); virtual void addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value); virtual void addValueFloat(const std::string& name, const std::string& type, float value); virtual void addValueDouble(const std::string& name, const std::string& type, double value); virtual void addValueLongDouble(const std::string& name, const std::string& type, long double value); virtual void addNull(const std::string& name, const std::string& type); virtual void beginArray(const std::string& name, const std::string& type); virtual void finishArray(); virtual void beginObject(const std::string& name, const std::string& type); virtual void beginMember(const std::string& name); virtual void finishMember(); virtual void finishObject(); // function returns string as it is stored in binary data stream static std::string rawString(const std::string& value); private: void printUInt(uint64_t v, const std::string& name); void printInt(int64_t v, const std::string& name); void printTypeCode(const std::string& type, bool plain); void outputString(const std::string& value); std::ostream* _out; TextOStream _ts; std::vector _dictionary; }; } } #endif // CXXTOOLS_BIN_FORMATTER_H cxxtools-3.0/include/cxxtools/bin/rpcclient.h0000664000175000017500000001472113644433072016407 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_CLIENT_H #define CXXTOOLS_BIN_CLIENT_H #include #include #include namespace cxxtools { class SslCertificate; class SelectorBase; namespace net { class AddrInfo; class Uri; } namespace bin { class RpcClientImpl; class RpcClient : public RemoteClient { RpcClientImpl* _impl; RpcClientImpl* getImpl(); const RpcClientImpl* getImpl() const { return const_cast(this)->getImpl(); } public: RpcClient() : _impl(0) { } explicit RpcClient(SelectorBase& selector) : _impl(0) { setSelector(selector); } explicit RpcClient(const net::AddrInfo& addr, bool ssl = false) : _impl(0) { prepareConnect(addr, ssl); } RpcClient(const net::AddrInfo& addr, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, sslCertificate); } RpcClient(const std::string& addr, unsigned short port, bool ssl = false) : _impl(0) { prepareConnect(addr, port, ssl); } RpcClient(const std::string& addr, unsigned short port, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, port, sslCertificate); } explicit RpcClient(const net::Uri& uri) : _impl(0) { prepareConnect(uri); } RpcClient(const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { prepareConnect(uri, sslCertificate); } RpcClient(SelectorBase& selector, const net::AddrInfo& addr, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, ssl); } RpcClient(SelectorBase& selector, const net::AddrInfo& addr, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, sslCertificate); } RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, port, ssl); } RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, port, sslCertificate); } RpcClient(SelectorBase& selector, const net::Uri& uri) : _impl(0) { setSelector(selector); prepareConnect(uri); } RpcClient(SelectorBase& selector, const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(uri, sslCertificate); } RpcClient(const RpcClient&); RpcClient& operator= (const RpcClient&); virtual ~RpcClient(); void prepareConnect(const net::AddrInfo& addr, bool ssl = false); void prepareConnect(const net::AddrInfo& addr, const std::string& sslCertificate); void prepareConnect(const std::string& host, unsigned short port, bool ssl = false); void prepareConnect(const std::string& host, unsigned short port, const std::string& sslCertificate); void prepareConnect(const net::Uri& uri); void prepareConnect(const net::Uri& uri, const std::string& sslCertificate); void connect(const net::AddrInfo& addrinfo, bool ssl_ = false) { prepareConnect(addrinfo, ssl_); connect(); } void connect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { prepareConnect(addrinfo, sslCertificate); connect(); } void connect(const std::string& host, unsigned short int port, bool ssl_ = false) { prepareConnect(host, port, ssl_); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& sslCertificate) { prepareConnect(host, port, sslCertificate); connect(); } void connect(const net::Uri& uri) { prepareConnect(uri); connect(); } void connect(const net::Uri& uri, const std::string& sslCertificate) { prepareConnect(uri, sslCertificate); connect(); } void connect(); void close(); void setSelector(SelectorBase* selector); void setSelector(SelectorBase& selector) { setSelector(&selector); } /// @see cxxtools::net::TcpSocket::setSslVerify void setSslVerify(int level, const std::string& ca = std::string()); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Milliseconds timeout() const; void timeout(Milliseconds t); Milliseconds connectTimeout() const; void connectTimeout(Milliseconds t); const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(Milliseconds msecs = WaitInfinite); const std::string& domain() const; void domain(const std::string& p); Delegate& acceptSslCertificate(); }; } } #endif // CXXTOOLS_BIN_CLIENT_H cxxtools-3.0/include/cxxtools/bin/bin.h0000664000175000017500000001116313644433072015171 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_H #define CXXTOOLS_BIN_H #include #include #include namespace cxxtools { namespace bin { /** Wrapper object to easily print serializable objects in cxxtools binary format to a output stream. BinOObject is a little wrapper which makes it easy to output serializable objects into s ostream. For this the BinOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::basic_ostream, which prints the object in cxxtools binary format. Example: \code std::vector v; v.push_back(4); v.push_back(17); v.push_back(12); std::cout << cxxtools::bin::Bin(v) << std::endl; \endcode */ template class BinOObject { const ObjectType& _constObject; public: /// Constructor. Needs the wrapped object. explicit BinOObject(const ObjectType& object) : _constObject(object) { } const ObjectType& object() const { return _constObject; } }; /// The output operator for BinOObject. It does the actual work. template std::basic_ostream& operator<< (std::basic_ostream& out, const BinOObject& object) { try { Serializer serializer(out); serializer.serialize(object.object()) .finish(); } catch (const std::exception&) { out.setstate(std::ios::failbit); throw; } return out; } /// Function, which creates a BinOObject. /// This makes the syntactic sugar perfect. See the example at BinOObject /// for its use. template BinOObject Bin(const ObjectType& object) { return BinOObject(object); } template class BinIOObject : public BinOObject { ObjectType& _object; public: explicit BinIOObject(ObjectType& object) : BinOObject(object), _object(object) { } ObjectType& object() { return _object; } }; /// The input operator for BinIOObject. It does the actual work. template std::basic_istream& operator>> (std::basic_istream& in, BinIOObject object) { try { Deserializer deserializer(in); deserializer.deserialize(object.object()); } catch (const std::exception&) { in.setstate(std::ios::failbit); throw; } return in; } template BinIOObject Bin(ObjectType& object) { return BinIOObject(object); } } } #endif // CXXTOOLS_BIN_H cxxtools-3.0/include/cxxtools/bin/rpcserver.h0000664000175000017500000001347613644433072016445 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RPCSERVER_H #define CXXTOOLS_BIN_RPCSERVER_H #include #include #include #include namespace cxxtools { class EventLoopBase; class SslCertificate; namespace bin { class Responder; class RpcServerImpl; class RpcServer : public ServiceRegistry { friend class Responder; RpcServerImpl* newImpl(EventLoopBase& eventLoop); public: explicit RpcServer(EventLoopBase& eventLoop) : _impl(newImpl(eventLoop)) { } RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(ip, port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } RpcServer(EventLoopBase& eventLoop, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(std::string(), port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(ip, port, certificateFile, std::string(), sslVerifyLevel, sslCa); } RpcServer(EventLoopBase& eventLoop, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(std::string(), port, certificateFile, std::string(), sslVerifyLevel, sslCa); } ~RpcServer(); /** Listen to the specified ip and port. * * When a certificate file is given, ssl is enabled. If no private key file is given, the private key * is expected to be in the certificate file. * * Multiple listen calls can be made to listen on multiple interfaces or different settings. * * \see cxxtools::net::TcpSocket::setSslVerify for settings of `sslVerifyLevel` and `sslCa` */ void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()); void listen(unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) { listen(std::string(), port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) { listen(ip, port, certificateFile, std::string(), sslVerifyLevel, sslCa); } void listen(unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) { listen(std::string(), port, certificateFile, std::string(), sslVerifyLevel, sslCa); } void addService(const ServiceRegistry& service); void addService(const std::string& domain, const ServiceRegistry& service); unsigned minThreads() const; void minThreads(unsigned m); unsigned maxThreads() const; void maxThreads(unsigned m); enum Runmode { Stopped, Starting, Running, Terminating, Failed }; Signal runmodeChanged; Delegate& acceptSslCertificate(); private: RpcServerImpl* _impl; }; } } #endif // CXXTOOLS_BIN_RPCSERVER_H cxxtools-3.0/include/cxxtools/bin/serializer.h0000664000175000017500000001423513644433072016575 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_SERIALIZER_H #define CXXTOOLS_BIN_SERIALIZER_H #include #include namespace cxxtools { namespace bin { class Serializer { // make non copyable Serializer(const Serializer&) { } Serializer& operator=(const Serializer&) { return *this; } public: enum TypeCode { TypeEmpty = 0x00, TypeBool = 0x01, TypeChar = 0x02, TypeString = 0x03, TypeInt = 0x04, TypeBinary2 = 0x06, // followed by zero terminated, 2 byte length field + data TypeBinary4 = 0x07, // followed by zero terminated, 4 byte length field + data TypeInt8 = 0x10, TypeInt16 = 0x11, TypeInt32 = 0x12, TypeInt64 = 0x13, TypeUInt8 = 0x18, TypeUInt16 = 0x19, TypeUInt32 = 0x1a, TypeUInt64 = 0x1b, TypeBcdFloat = 0x20, TypeShortFloat = 0x21, // 1 bit sign, 7 bit exponent, 16 bit mantissa (3 byte) TypeMediumFloat = 0x22, // 1 bit sign, 7 bit exponent, 32 bit mantissa (5 byte) TypeLongFloat = 0x23, // 1 bit sign, 15 bit exponent, 64 bit mantissa (10 byte) TypePair = 0x30, TypeArray = 0x31, TypeVector = 0x32, TypeList = 0x33, TypeDeque = 0x34, TypeSet = 0x35, TypeMultiset = 0x36, TypeMap = 0x37, TypeMultimap = 0x38, TypeBcd = 0x3e, TypeOther = 0x3f, // followed by zero terminated type name, data is zero terminated TypePlainEmpty = 0x40, TypePlainBool = 0x41, TypePlainChar = 0x42, TypePlainString = 0x43, TypePlainInt = 0x44, TypePlainBinary2 = 0x46, TypePlainBinary4 = 0x47, TypePlainInt8 = 0x50, TypePlainInt16 = 0x51, TypePlainInt32 = 0x52, TypePlainInt64 = 0x53, TypePlainUInt8 = 0x58, TypePlainUInt16 = 0x59, TypePlainUInt32 = 0x5a, TypePlainUInt64 = 0x5b, TypePlainBcdFloat = 0x60, TypePlainShortFloat = 0x61, // 1 bit sign, 7 bit exponent, 16 bit mantissa TypePlainMediumFloat = 0x62, // 1 bit sign, 7 bit exponent, 32 bit mantissa TypePlainLongFloat = 0x63, // 1 bit sign, 15 bit exponent, 64 bit mantissa TypePlainPair = 0x70, TypePlainArray = 0x71, TypePlainVector = 0x72, TypePlainList = 0x73, TypePlainDeque = 0x74, TypePlainSet = 0x75, TypePlainMultiset = 0x76, TypePlainMap = 0x77, TypePlainMultimap = 0x78, TypePlainBcd = 0x7e, TypePlainOther = 0x7f, // followed by zero terminated type name, data is zero terminated CategoryObject = 0xa0, CategoryArray = 0xa1, CategoryReference = 0xa2, RpcRequest = 0xc0, RpcResponse = 0xc1, RpcException = 0xc2, Eod = 0xff }; Serializer() { } explicit Serializer(std::ostream& out) { _formatter.begin(out); } Serializer& begin(std::ostream& out) { _formatter.begin(out); return *this; } template Serializer& serialize(const T& v, const std::string& name) { Decomposer s; s.begin(v); s.setName(name); s.format(_formatter); return *this; } template Serializer& serialize(const T& v) { Decomposer s; s.begin(v); s.format(_formatter); return *this; } void finish() { } private: Formatter _formatter; }; } } #endif // CXXTOOLS_BIN_SERIALIZER_H cxxtools-3.0/include/cxxtools/iso8859_6codec.h0000664000175000017500000000412213644433072016221 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_6CODEC_H #define CXXTOOLS_ISO8859_6CODEC_H #include namespace cxxtools { class Iso8859_6Codec : public CharMapCodec { public: explicit Iso8859_6Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/win1252codec.h0000664000175000017500000000412013644433072015751 00000000000000/* * Copyright (C) 2019 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_WIN1252CODEC_H #define CXXTOOLS_WIN1252CODEC_H #include namespace cxxtools { class Win1252Codec : public CharMapCodec { public: explicit Win1252Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; typedef Win1252Codec Win1252Codec; } #endif cxxtools-3.0/include/cxxtools/string.tpp0000664000175000017500000002706113653121636015537 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace std { inline basic_string::basic_string(const allocator_type& a) : _data(a) { } inline basic_string::basic_string(const cxxtools::Char* str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const wchar_t* str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const wchar_t* str, size_type length, const allocator_type& a) : _data(a) { assign(str, length); } inline basic_string::basic_string(const std::string& str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const basic_string& str) : _data(str.get_allocator()) { assign(str); } inline basic_string::basic_string(const char* str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const char* str, size_type length, const allocator_type& a) : _data(a) { assign(str, length); } inline basic_string::basic_string(const cxxtools::Char* str, size_type n, const allocator_type& a) : _data(a) { assign(str, n); } inline basic_string::basic_string(size_type n, cxxtools::Char c, const allocator_type& a) : _data(a) { assign(n, c); } inline basic_string::basic_string(const basic_string& str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const basic_string& str, size_type pos, const allocator_type& a) : _data(a) { assign(str, pos, str.length() - pos); } inline basic_string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator_type& a) : _data(a) { assign(str, pos, n); } inline basic_string::basic_string(const cxxtools::Char* begin, const cxxtools::Char* end, const allocator_type& a) : _data(a) { assign(begin, end); } template basic_string::basic_string(InputIterator begin, InputIterator end, const allocator_type& a) : _data(a) { assign(begin, end); } inline basic_string::~basic_string() { if (!isShortString()) { _data.deallocate(longStringData(), longStringCapacity() + 1); } } inline basic_string& basic_string::assign(const basic_string& str, size_type pos, size_type n) { size_type len = str.length(); if (len <= pos) this->clear(); else this->assign( str.data() + pos, pos + n > len ? len - pos : n ); return *this; } inline basic_string& basic_string::assign(const cxxtools::Char* str) { return assign(str, traits_type::length(str)); } template basic_string& basic_string::assign(InputIterator begin, InputIterator end) { clear(); append(begin, end); return *this; } inline basic_string& basic_string::append(const cxxtools::Char* str) { return append( str, traits_type::length(str) ); } inline basic_string& basic_string::append(const basic_string& str) { return this->append( str.data(), str.length() ); } inline basic_string& basic_string::append(const basic_string& str, size_type pos, size_type n) { return this->append( str.data() + pos, n ); } template basic_string& basic_string::append(InputIterator begin, InputIterator end) { while (begin != end) { append(1, *begin++); } return *this; } inline basic_string& basic_string::append(const cxxtools::Char* begin, const cxxtools::Char* end) { return this->append( begin, end-begin ); } inline basic_string& basic_string::insert(size_type pos, const cxxtools::Char* str) { return this->insert( pos, str, traits_type::length(str) ); } inline basic_string& basic_string::insert(size_type pos, const basic_string& str) { return insert(pos, str.privdata_ro(), str.length()); } inline basic_string& basic_string::insert(size_type pos, const basic_string& str, size_type pos2, size_type n) { return insert(pos, str.privdata_ro() + pos2, n > str.length() ? str.length() : n); } inline basic_string& basic_string::insert(iterator p, cxxtools::Char ch) { return insert(p - begin(), 1, ch); } inline basic_string& basic_string::insert(iterator p, size_type n, cxxtools::Char ch) { return insert(p - begin(), n, ch); } inline basic_string::iterator basic_string::erase(iterator it) { size_type pos = it - begin(); erase(pos, 1); return begin() + pos; } inline basic_string::iterator basic_string::erase(iterator first, iterator last) { size_type pos = first - begin(); erase(pos, last - first); return begin() + pos; } inline basic_string& basic_string::replace(size_type pos, size_type n, const cxxtools::Char* str) { return replace(pos, n, str, traits_type::length(str)); } inline basic_string& basic_string::replace(size_type pos, size_type n, const basic_string& str) { return replace(pos, n, str.privdata_ro(), str.length()); } inline basic_string& basic_string::replace(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2) { return replace(pos, n, str.privdata_ro() + pos2, n2); } inline basic_string& basic_string::replace(iterator i1, iterator i2, const cxxtools::Char* str) { size_type pos = i1 - begin(); size_type n = i2 - i1; return replace(pos, n, str); } inline basic_string& basic_string::replace(iterator i1, iterator i2, const cxxtools::Char* str, size_type n) { size_type pos = i1 - begin(); size_type n1 = i2 - i1; return replace(pos, n1, str, n); } inline basic_string& basic_string::replace(iterator i1, iterator i2, size_type n, cxxtools::Char ch) { size_type pos = i1 - begin(); size_type n1 = i2 - i1; return replace(pos, n1, n, ch); } inline basic_string& basic_string::replace(iterator i1, iterator i2, const basic_string& str) { size_type pos = i1 - begin(); size_type n = i2 - i1; return replace(pos, n, str); } inline int basic_string::compare(const cxxtools::Char* str) const { return compare(str, traits_type::length(str)); } inline int basic_string::compare(size_type pos, size_type n, const basic_string& str) const { return compare(pos, n, str, 0, str.length()); } inline int basic_string::compare(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2) const { return compare(pos, n, str.privdata_ro() + pos2, n2); } inline int basic_string::compare(size_type pos, size_type n, const cxxtools::Char* str) const { return compare(pos, n, str, traits_type::length(str)); } inline basic_string::size_type basic_string::find(const basic_string& str, size_type pos) const { return this->find( str.privdata_ro(), pos, str.size() ); } inline basic_string::size_type basic_string::find(wchar_t ch, size_type pos) const { return this->find(cxxtools::Char(ch), pos); } inline basic_string::size_type basic_string::rfind(wchar_t ch, size_type pos) const { return this->rfind(cxxtools::Char(ch), pos); } inline basic_string::size_type basic_string::rfind(const basic_string& str, size_type pos) const { return this->rfind( str.privdata_ro(), pos, str.size() ); } inline basic_string::size_type basic_string::find(const cxxtools::Char* str, size_type pos) const { return this->find( str, pos, traits_type::length(str) ); } inline basic_string::size_type basic_string::rfind(const cxxtools::Char* str, size_type pos) const { return this->rfind( str, pos, traits_type::length(str) ); } template basic_string basic_string::fromUtf16(InIterT from, InIterT fromEnd) { std::basic_string ret; for( ; from != fromEnd; ++from) { unsigned ch = *from; // high surrogate if (ch >= 0xD800 && ch <= 0xDBFF) { // invalid or missing low surrogate if(++from == fromEnd || *from < 0xDC00 || *from > 0xDFFF) { ret += cxxtools::Char(0xFFFD); break; } const unsigned lo = *from; ch = ((ch - 0xD800) << 10) + (lo - 0xDC00) + 0x0010000U; ret += cxxtools::Char(static_cast(ch)); } // not a surrogate else if(ch < 0xDC00 || ch > 0xDFFF) { ret += cxxtools::Char(static_cast(ch)); } // not a valid unicode point else { ret += cxxtools::Char(static_cast(0xFFFD)); } } return ret; } template OutIterT basic_string::toUtf16(OutIterT to) const { const_iterator from = this->begin(); const_iterator fromEnd = this->end(); for( ; from != fromEnd; ++from) { const int ch = *from; if( ch < 0xD800 || (ch > 0xDFFF && ch <= 0xFFFF) ) { *to++ = *from; } else if(ch > 0xFFFF && ch <= 0x0010FFFF) { const int n = (ch - 0x0010000UL); *to++ = ((n >> 10) + 0xD800); *to++ = ((n & 0x3FFU) + 0xDC00); } else { *to++ = 0xFFFD; } } return to; } } cxxtools-3.0/include/cxxtools/arg.h0000664000175000017500000003442513644433072014430 00000000000000/* * Copyright (C) 2003,2004,2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ARG_H #define CXXTOOLS_ARG_H #include #include namespace cxxtools { /// @cond internal class ArgBase { protected: bool m_isset; static void removeArg(int& argc, char* argv[], int pos, int n) { for ( ; pos < argc - n; ++pos) argv[pos] = argv[pos + n]; argc -= n; argv[argc] = 0; } public: ArgBase() : m_isset(false) { } /** * returns true if the option was found and the default value was not used */ bool isSet() const { return m_isset; } }; template class ArgBaseT : public ArgBase { T m_value; protected: explicit ArgBaseT(const T& def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { std::istringstream s(str); s >> m_value; if (!s.fail()) { m_isset = true; removeArg(argc, argv, i, n); return true; } return false; } public: /** returns the value. */ const T& getValue() const { return m_value; } /** @brief Read and extract commandline parameters from argc/argv. Programs usually need some parameters. Usually they start with a '-' followed by a single character and optionally a value. Arg extracts these and other parameters. This default class processes paramters with a value, which defines a input-extractor-operator operator>> (istream&, T&). Options are removed from the option-list, so programs can easily check after all options are extracted, if there are parameters left. example: \code int main(int argc, char* argv[]) { cxxtools::Arg option_n(argc, argv, 'n', 0); std::cout << "value for -n: " << option_n << endl; } \endcode */ operator T() const { return m_value; } /// dereference operator returns value T operator *() const { return m_value; } ArgBaseT& operator= (const T& value) { m_value = value; return *this; } }; template <> class ArgBaseT : public ArgBase { const char* m_value; protected: explicit ArgBaseT(const char* def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { m_value = str; m_isset = true; removeArg(argc, argv, i, n); return true; } public: /// returns the extracted value. const char* getValue() const { return m_value; } /// class is convertible to "const char*" operator const char*() const { return m_value; } /// dereference operator returns value const char* operator *() const { return m_value; } ArgBaseT& operator= (const char* value) { m_value = value; return *this; } }; template <> class ArgBaseT : public ArgBase { std::string m_value; protected: explicit ArgBaseT(const std::string& def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { m_value = str; m_isset = true; removeArg(argc, argv, i, n); return true; } public: /// returns the extracted value. const std::string& getValue() const { return m_value; } /// class is convertible to "const std::string&" operator const std::string&() const { return m_value; } /// dereference operator returns value std::string operator *() const { return m_value; } ArgBaseT& operator= (const std::string& value) { m_value = value; return *this; } }; template <> class ArgBaseT : public ArgBase { char m_value; protected: explicit ArgBaseT(char def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { m_value = str[0]; m_isset = str[0] != '\0'; removeArg(argc, argv, i, n); return true; } public: /// returns the extracted value. char getValue() const { return m_value; } /// class is convertible to "char" operator char() const { return m_value; } /// dereference operator returns value char operator *() const { return m_value; } ArgBaseT& operator= (char value) { m_value = value; return *this; } }; /// @endcond internal /** @brief Read and extract commandline parameters from argc/argv. Programs usually need some parameters. Usually they start with a '-' followed by a single character and optionally a value. Arg extracts these and other parameters. This default class processes paramters with a value, which defines a input-extractor-operator operator>> (istream&, T&). Options are removed from the option-list, so programs can easily check after all options are extracted, if there are parameters left. example: \code int main(int argc, char* argv[]) { cxxtools::Arg option_n(argc, argv, 'n', 0); std::cout << "value for -n: " << option_n << endl; } \endcode */ template class Arg : public ArgBaseT { public: /** default constructor. Initializes value. \param def initial value */ explicit Arg(const T& def = T()) : ArgBaseT(def) { } /** extract parameter. \param argc 1. parameter of main \param argv 2. of main \param ch optioncharacter \param def default-value example: \code cxxtools::Arg offset(argc, argv, 'o', 0); unsigned value = offset.getValue(); \endcode */ Arg(int& argc, char* argv[], char ch, const T& def = T()) : ArgBaseT(def) { set(argc, argv, ch); } /** GNU defines long options starting with `--`. This (and more) is supported here. Instead of giving a single option-character, you specify a string. example: \code cxxtools::Arg option_number(argc, argv, "--number", 0); std::cout << "number =" << option_number.getValue() << std::endl; \endcode */ Arg(int& argc, char* argv[], const char* str, const T& def = T()) : ArgBaseT(def) { this->m_isset = set(argc, argv, str); } Arg(int& argc, char* argv[]) : ArgBaseT(T()) { this->m_isset = set(argc, argv); } /** extract parameter. \param argc 1. parameter of main \param argv 2. of main \param ch optioncharacter example: \code cxxtools::Arg offset; offset.set(argc, argv, 'o'); unsigned value = offset.getValue(); \endcode */ bool set(int& argc, char* argv[], char ch) { // don't extract value, when already found if (this->m_isset) return false; for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-' && argv[i][1] == ch) { if (argv[i][2] == '\0' && i < argc - 1) { // -O foo if (this->extract(argv[i + 1], argc, argv, i, 2)) return true; } // -Ofoo if (this->extract(argv[i] + 2, argc, argv, i, 1)) return true; } } return false; } /** GNU defines long options starting with "--". This (and more) is supported here. Instead of giving a single option-character, you specify a string. example: \code cxxtools::Arg option_number; number.set(argc, argv, "--number"); std::cout << "number =" << option_number.getValue() << std::endl; \endcode */ bool set(int& argc, char* argv[], const char* str) { // don't extract value, when already found if (this->m_isset) return false; unsigned n = strlen(str); for (int i = 1; i < argc; ++i) { if (strncmp(argv[i], str, n) == 0) { if (i < argc - 1 && argv[i][n] == '\0') { // --option value if (this->extract(argv[i + 1], argc, argv, i, 2)) return true; } if (argv[i][n] == '=') { // --option=vlaue if (this->extract(argv[i] + n + 1, argc, argv, i, 1)) return true; } } } return false; } /** Reads next parameter and removes it. */ bool set(int& argc, char* argv[]) { // don't extract value, when already found if (this->m_isset) return false; if (argc > 1) this->extract(argv[1], argc, argv, 1, 1); return this->m_isset; } }; //////////////////////////////////////////////////////////////////////// /** specialization for bool. Often programs need some switches, which are switched on or off. Users just enter a option without parameter. example: \code cxxtools::Arg debug(argc, argv, 'd'); if (debug) std::cout << "debug-mode is set" << std::endl; \endcode */ template <> class Arg : public ArgBase { public: /** default constructor. Initializes value. \param def initial value */ Arg(bool def = false) : m_value(def) { } /** Use this constructor to extract a bool-parameter. As a special case options can be grouped. The parameter is recognized also in a argument, which starts with a '-' and contains somewhere the given character. example: \code cxxtools::Arg debug(argc, argv, 'd'); cxxtools::Arg ignore(argc, argv, 'i'); \endcode Arguments debug and ignore are both set when the program is called with: \code prog -id prog -i -d \endcode Options can also switched off with a following '-' like this: \code prog -d- \endcode In the program use: \code Arg debug(argc, argv, 'd'); if (debug.isSet()) { if (debug) std::cout << "you entered -d" << std::endl; else std::cout << "you entered -d-" << std::endl; } else std::cout << "no -d option given" << std::endl; \endcode This is useful, if a program defaults to some enabled feature, which can be disabled. */ Arg(int& argc, char* argv[], char ch, bool def = false) : m_value(def) { m_isset = set(argc, argv, ch); } Arg(int& argc, char* argv[], const char* str, bool def = false) : m_value(def) { m_isset = set(argc, argv, str); } bool set(int& argc, char* argv[], char ch) { // don't extract value, when already found if (m_isset) return false; for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-' && argv[i][1] != '-') { // starts with a '-', but not with "--" if (argv[i][1] == ch && argv[i][2] == '\0') { // single option found m_value = true; m_isset = true; removeArg(argc, argv, i, 1); return true; } else if (argv[i][1] == ch && argv[i][2] == '-' && argv[i][3] == '\0') { // Option was explicitly disabled with -x- m_value = false; m_isset = true; removeArg(argc, argv, i, 1); return true; } else { // look, if we find the option in an optiongroup for (char* p = argv[i] + 1; *p != '\0'; ++p) if (*p == ch) { // here it is - extract it m_value = true; m_isset = true; do { *p = *(p + 1); } while (*p++ != '\0'); return true; } } } } return false; } /** Setter for long-options. The option-parameter is defined with a string. This can extract long-options like: \code prog --debug \endcode with \code Arg debug(argc, argv, "--debug"); \endcode */ bool set(int& argc, char* argv[], const char* str) { // don't extract value, when already found if (m_isset) return false; for (int i = 1; i < argc; ++i) { if (strcmp(argv[i], str) == 0) { m_value = true; m_isset = true; removeArg(argc, argv, i, 1); return true; } } return false; } /** returns true, if options is set. */ bool isTrue() const { return m_value; } /** returns true, if options is not set. */ bool isFalse() const { return !m_value; } /** convertable to bool. */ operator bool() const { return m_value; } private: bool m_value; }; /// Output operator for a argument. template std::ostream& operator<< (std::ostream& out, const ArgBaseT& arg) { return out << arg.getValue(); } } #endif // CXXTOOLS_ARG_H cxxtools-3.0/include/cxxtools/tz.h0000664000175000017500000001220313644433072014302 00000000000000/* * Copyright (C) 2018 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TZ_H #define CXXTOOLS_TZ_H #include #include #include #include #include namespace cxxtools { class TzError : public std::runtime_error { public: explicit TzError(const std::string& msg) : std::runtime_error(msg) { } }; class TzInvalidTimeZoneFile : public TzError { public: explicit TzInvalidTimeZoneFile(const std::string& msg = "invalid timezone file") : TzError(msg) { } }; class TzAmbiguousLocalTime : public TzError { DateTime _dt; public: explicit TzAmbiguousLocalTime(const DateTime& dt) : TzError("ambiguous local time <" + dt.toString() + '>'), _dt(dt) { } const DateTime& which() const { return _dt; } }; class TzInvalidLocalTime : public TzError { DateTime _dt; public: explicit TzInvalidLocalTime(const DateTime& dt) : TzError("invalid local time <" + dt.toString() + '>'), _dt(dt) { } const DateTime& which() const { return _dt; } }; class TzDateTime; /** * Time zone class. * * This class reads the iana time zone database of the system. * * It allows converting a date time in UTC to a time zoned date time. * * Example: * \code * Tz tz("Pacific/Nauru"); * std::cout << "the current time in Nauru is " << tz.toLocal().toString() << '\n'; * \endcode * * The time zones are cached so that instantiating the class * multiple times with the same time zone is no problem. * */ class Tz { friend class TzDateTime; class Impl; Impl* _impl; public: /// Returns the current time zone of the system. static std::string currentZone(); /// Returns the list of valid time zones static const std::vector& getTimeZones(); /// Instantiates a time zone object. /// The time zone data is read from the file system and cached. explicit Tz(const std::string& timeZone = currentZone()); Tz(const Tz& tz) : _impl(tz._impl) { } Tz& operator=(const Tz& tz) { _impl = tz._impl; return *this; } /// Outputs information about time zone for testing purpose. void dump(std::ostream& out) const; /// Returns the name of the time zone. const std::string& name() const; /// Interprets the specified date time as UTC and returns the time zoned date and time. TzDateTime toLocal(const UtcDateTime& dt) const; /// Returns the first UTC time witch matches the specified date time in the time zone. UtcDateTime toUtc(const LocalDateTime& dt) const; /// Returns the UTC time witch matches the specified date time in the time zone. /// When the result is not unique, the `early` flag specifies if the earlier or later /// time should be returned. UtcDateTime toUtc(const LocalDateTime& dt, bool early) const; UtcDateTime previousChange(const DateTime& gmtDt, bool local = true) const; UtcDateTime nextChange(const DateTime& gmtDt, bool local = true) const; Timespan offset(const UtcDateTime& gmtDt) const; }; /** * The class extends DateTime with time zone information. */ class TzDateTime : public LocalDateTime { std::string _tzName; Timespan _gmtoff; bool _isdst; uint32_t _leapSeconds; public: /// Initializes the object with the specified attributes. TzDateTime(const DateTime& dt, const std::string& tzName, Timespan gmtoff, bool isdst, uint32_t leapSeconds = 0) : LocalDateTime(dt), _tzName(tzName), _gmtoff(gmtoff), _isdst(isdst), _leapSeconds(leapSeconds) { } const std::string& tzName() const { return _tzName; } Timespan gmtoff() const { return _gmtoff; } bool isdst() const { return _isdst; } uint32_t leapSeconds() const { return _leapSeconds; } }; } #endif cxxtools-3.0/include/cxxtools/dir.h0000664000175000017500000000303613644433072014427 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DIR_H #define CXXTOOLS_DIR_H #include namespace cxxtools { /** * for compatibility with old implementation */ typedef Directory Dir; } #endif // DIR_H cxxtools-3.0/include/cxxtools/posix/0000775000175000017500000000000013672344760014726 500000000000000cxxtools-3.0/include/cxxtools/posix/pipestream.h0000664000175000017500000000712213644433072017164 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_PIPESTREAM_H #define CXXTOOLS_POSIX_PIPESTREAM_H #include #include namespace cxxtools { namespace posix { /** @brief Simple unix pipe iostream This iostream works only on POSIX systems. A portable alternative is to use an IOStream attached to the input or output end of a Pipe. */ class Pipestreambuf : public std::streambuf { std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); posix::Pipe pipe; unsigned bufsize; char* ibuffer; char* obuffer; public: explicit Pipestreambuf(unsigned bufsize = 8192); ~Pipestreambuf(); void closeReadFd() { sync(); pipe.closeReadFd(); } void closeWriteFd() { sync(); pipe.closeWriteFd(); } int getReadFd() const { return pipe.getReadFd(); } int getWriteFd() const { return pipe.getWriteFd(); } void redirectStdout(bool close = true) { pipe.redirectStdout(close); } void redirectStdin(bool close = true) { pipe.redirectStdin(close); } void redirectStderr(bool close = true) { pipe.redirectStderr(close); } IODevice& out() { return pipe.out(); } IODevice& in() { return pipe.in(); } }; class Pipestream : public std::iostream { Pipestreambuf streambuf; public: explicit Pipestream(unsigned bufsize = 8192) : std::iostream(0), streambuf(bufsize) { init(&streambuf); } void closeReadFd() { streambuf.closeReadFd(); } void closeWriteFd() { streambuf.closeWriteFd(); } void close() { closeReadFd(); closeWriteFd(); } int getReadFd() const { return streambuf.getReadFd(); } int getWriteFd() const { return streambuf.getWriteFd(); } void redirectStdout(bool close = true) { streambuf.redirectStdout(close); } void redirectStdin(bool close = true) { streambuf.redirectStdin(close); } void redirectStderr(bool close = true) { streambuf.redirectStderr(close); } IODevice& out() { return streambuf.out(); } IODevice& in() { return streambuf.in(); } }; } } #endif // CXXTOOLS_POSIX_PIPESTREAM_H cxxtools-3.0/include/cxxtools/posix/daemonize.h0000664000175000017500000000403413644433072016765 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_DAEMONIZE_H #define CXXTOOLS_POSIX_DAEMONIZE_H #include namespace cxxtools { namespace posix { /// This function makes a background daemon process out of the current /// process. The current process is forked twice and the 2 parents are exited, /// so that only the single child is kept. The standard input, standard output /// and standard error output are redirected to /dev/null. /// When a pidfile is passed, the pid of the child is written to that file /// and a signal handler is installed, which removes the file, when the process /// is terminated unsing SIGTERM. void daemonize(const std::string& pidfile = std::string()); } } #endif cxxtools-3.0/include/cxxtools/posix/exec.h0000664000175000017500000000604213644433072015737 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_EXEC_H #define CXXTOOLS_POSIX_EXEC_H #include #include #include #include namespace cxxtools { namespace posix { /** cxxtools::posix::Exec is a wrapper around the exec?? functions of posix. Note that after an fork, memory allocations are not allowed in a multithreaded application. So arguments must be set befor a possible call to fork. Usage is like this: \code cxxtools::posix::Exec e("ls"); e.push_back("-l"); // possibly fork here e.exec(); \endcode This replaces the current process with the unix command "ls -l". */ class Exec { std::vector _args; std::vector _argv; public: explicit Exec(const std::string& cmd) { _args.push_back(cmd); _argv.reserve(1); } /// Adds a parameter to the process. Exec& push_back(const std::string& arg) { _args.push_back(arg); _argv.reserve(_args.size()); return *this; } /// Alias for push_back if you prefer that name. Exec& arg(const std::string& arg) { return push_back(arg); } /// Call `execvp` to replace the current process. void exec() { for (unsigned n = 0; n < _args.size(); ++n) _argv.push_back(_args[n].c_str()); _argv.push_back(0); ::execvp(_argv[0], (char**)&_argv[0]); // `execvp` do not return and hence this won't never be executed. // Just in case: throw SystemError("execvp"); } }; } } #endif cxxtools-3.0/include/cxxtools/posix/pipe.h0000664000175000017500000000612113644433072015746 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_PIPE_H #define CXXTOOLS_POSIX_PIPE_H #include namespace cxxtools { namespace posix { class Pipe : public cxxtools::Pipe { public: /** @brief Creates the pipe with two IODevices The default constructor will create the pipe and the appropriate IODevices to read and write to the pipe. */ explicit Pipe(OpenMode mode = Sync) : cxxtools::Pipe(mode) { } /** @brief Endpoint of the pipe to read from @return An IODevice used to read from the pipe */ int getReadFd() const; int getWriteFd() const; void closeReadFd() { out().close(); } void closeWriteFd() { in().close(); } /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStdout(bool close = true, bool inherit = true); /// Redirect read-end to stdin. /// When the close argument is set, closes the original filedescriptor void redirectStdin(bool close = true, bool inherit = true); /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStderr(bool close = true, bool inherit = true); size_t write(const char* buf, size_t count) { return in().write(buf, count); } void write(char ch) { in().write(&ch, 1); } size_t read(char* buf, size_t count) { return out().read(buf, count); } char read() { char ch; out().read(&ch, 1); return ch; } }; } } #endif // CXXTOOLS_POSIX_PIPE_H cxxtools-3.0/include/cxxtools/posix/commandoutput.h0000664000175000017500000000561313644433072017715 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_COMMANDOUTPUT_H #define CXXTOOLS_POSIX_COMMANDOUTPUT_H #include #include #include namespace cxxtools { namespace posix { /** cxxtools::posix::CommandOutput starts a process and the stdout of the process can be read. The class is derived from std::istream, so all methods provided from that base class can be used to read the output. Typical usage example: \code cxxtools::posix::CommandOutput ls("ls"); ls.push_back("-l"); // add a parameter ls.push_back("/bin"); // and another one ls.run(); // start the process // read output line by line std::string line; while (std::getline(ls, line)) std::cout << line << std::endl; \endcode */ class CommandOutput : public std::istream { Fork _fork; Exec _exec; Pipestreambuf streambuf; public: explicit CommandOutput(const std::string& cmd, unsigned bufsize = 8192) : std::istream(&streambuf), _fork(false), _exec(cmd), streambuf(bufsize) { } void push_back(const std::string& arg) { _exec.push_back(arg); } void run(bool combineStderr = false); int wait(int options = 0) { return _fork.wait(options); } IODevice& in() { return streambuf.in(); } void close() { streambuf.closeReadFd(); } }; } } #endif // CXXTOOLS_POSIX_COMMANDOUTPUT_H cxxtools-3.0/include/cxxtools/posix/commandinput.h0000664000175000017500000000562213644433072017514 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_COMMANDINPUT_H #define CXXTOOLS_POSIX_COMMANDINPUT_H #include #include #include namespace cxxtools { namespace posix { /** cxxtools::posix::CommandInput starts a process and the stdin is connected to the current process. The class is derived from std::ostream. You can use all methods provided from that class to send data to the stdin of the process. Typical usage example: \code cxxtools::posix::CommandInput grep("grep"); grep.push_back("foo"); // add a parameter grep.run(); // runs the process grep << "foo" << std::endl; // this line is printed grep << "bar" << std::endl; // this line is not printed grep << "foobar" << std::endl; // this line is printed \endcode */ class CommandInput : public std::ostream { Fork _fork; Exec _exec; Pipestreambuf streambuf; public: explicit CommandInput(const std::string& cmd, unsigned bufsize = 8192) : std::ostream(&streambuf), _fork(false), _exec(cmd), streambuf(bufsize) { } void push_back(const std::string& arg) { _exec.push_back(arg); } void run(); int wait(int options = 0) { return _fork.wait(options); } IODevice& out() { return streambuf.out(); } void close() { streambuf.closeWriteFd(); } }; } } #endif // CXXTOOLS_POSIX_COMMANDINPUT_H cxxtools-3.0/include/cxxtools/posix/fork.h0000664000175000017500000000604613644433072015760 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FORK_H #define CXXTOOLS_FORK_H #include namespace cxxtools { namespace posix { /** A simple wrapper for the system function fork(2). * * The advantage of using this class instead of fork directly is, easyness, * robustness and readability due to less code. The constructor executes * fork(2) and does error checking. The destructor waits for the child * process, which prevents the creation of zombie processes. The user may * decide to deactivate it or waiting explicitly to receive the return * status, but this has to be done explicitly, which helps robustness. * * Logging in the child process is deactivated to prevent a dead lock when * another thread holds the logger lock while fork. * * Example: * \code * { * cxxtools::Fork process; * if (process.child()) * { * // we are in the child process here. * * exit(0); // normally the child either exits or execs an other * // process * } * } * \endcode */ class Fork { Fork(const Fork&); Fork& operator= (const Fork&); pid_t pid; public: explicit Fork(bool now = true) : pid(0) { if (now) fork(); } ~Fork() { if (pid) wait(); } void fork(); pid_t getPid() const { return pid; } bool parent() const { return pid > 0; } bool child() const { return !parent(); } void setNowait() { pid = 0; } int wait(int options = 0); }; } } #endif // CXXTOOLS_FORK_H cxxtools-3.0/include/cxxtools/sslcertificate.h0000664000175000017500000000454613644433072016664 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SSLCERTIFICATE_H #define CXXTOOLS_SSLCERTIFICATE_H #include #include #include namespace cxxtools { class SslCertificate { class SslCertificateImpl* _impl; public: SslCertificate() : _impl(0) { } /// Reads certificate from file. explicit SslCertificate(const std::string& filename); explicit SslCertificate(SslCertificateImpl* impl); SslCertificate(const SslCertificate& s); SslCertificate& operator=(const SslCertificate& s); ~SslCertificate(); operator bool() const { return _impl != 0; } void clear(); String getSubject() const; String getIssuer() const; DateTime getNotBefore() const; DateTime getNotAfter() const; std::string getSerial() const; bool isValid(const DateTime& dt = DateTime::gmtime()) const { return dt >= getNotBefore() && dt <= getNotAfter(); } }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/iso8859_11codec.h0000664000175000017500000000413213644433072016276 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_11CODEC_H #define CXXTOOLS_ISO8859_11CODEC_H #include namespace cxxtools { class Iso8859_11Codec : public CharMapCodec { public: explicit Iso8859_11Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/condition.h0000664000175000017500000001072013644433072015635 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_CONDITION_H #define CXXTOOLS_SYSTEM_CONDITION_H #include #include #include namespace cxxtools { /** @brief This class is used to control concurrent access. The Condition class is used to control concurrent access in a queued manner. The Condition class supports two types of signaling events, manual reset and automatic reset. Manual resets cause all blocked callers to be released. This can be understood as some kind of broadcast to signal all blocked callers at once. Manual resets are triggered by a call to signal(). Automatic resets cause only a single blocked caller to be released. So this can be seen as some kind of wait queue where only the topmost is signaled. Automatic resets are signaled by a call to broadcast(). */ class Condition { #if __cplusplus >= 201103L Condition(const Condition&) = delete; Condition& operator=(const Condition&) = delete; #else Condition(const Condition&) { } Condition& operator=(const Condition&) { return *this; } #endif public: //! @brief Default Constructor. Condition(); //! @brief Destructor. ~Condition(); /** @brief Wait until condition becomes signalled. Causes the caller to be suspended until the condition will be signaled. The given mutex will be unlocked before the caller is suspended. */ void wait( Mutex& mtx); void wait( MutexLock& m) { this->wait( m.mutex() ); } /** @brief Wait until condition becomes signalled. Causes the caller to be suspended until the condition will be signaled. The given mutex will be unlocked before the caller is suspended. The suspension takes at maximum the time specified by ts. Returns true if successful, false if a timeout occurred. The time is specified as a Millisecond object, which can be implicitly constructed with a number or another Timespan derived object like Second. Example: @code cxxtools::MutexLock lock(someMutex); cxxtools::Condition condition; ... condition.wait(lock, 2000); // waits up to 2 seconds for the condition // to be signaled by another thread condition.wait(lock, cxxtools::Seconds(2); // same as above @endcode */ bool wait( Mutex& mtx, const Milliseconds& ts); bool wait( MutexLock& m, const Milliseconds& ts) { return this->wait( m.mutex(), ts ); } //! @brief Unblock a single blocked thread. void signal(); //! @brief Unblock all blocked threads. void broadcast(); private: class ConditionImpl* _impl; }; } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/formatter.h0000664000175000017500000000706313644433072015660 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Formatter_h #define cxxtools_Formatter_h #include #include #include namespace cxxtools { class Formatter { public: #ifdef HAVE_LONG_LONG typedef long long int_type; #else typedef long int_type; #endif #ifdef HAVE_UNSIGNED_LONG_LONG typedef unsigned long long unsigned_type; #else typedef unsigned long unsigned_type; #endif virtual ~Formatter() { } virtual void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) = 0; virtual void addValueStdString(const std::string& name, const std::string& type, const std::string& value); virtual void addValueChar(const std::string& name, const std::string& type, char value); virtual void addValueBool(const std::string& name, const std::string& type, bool value); virtual void addValueInt(const std::string& name, const std::string& type, int_type value); virtual void addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value); virtual void addValueFloat(const std::string& name, const std::string& type, float value); virtual void addValueDouble(const std::string& name, const std::string& type, double value); virtual void addValueLongDouble(const std::string& name, const std::string& type, long double value); virtual void addNull(const std::string& name, const std::string& type); virtual void beginArray(const std::string& name, const std::string& type) = 0; virtual void finishArray() = 0; virtual void beginObject(const std::string& name, const std::string& type) = 0; virtual void beginMember(const std::string& name) = 0; virtual void finishMember() = 0; virtual void finishObject() = 0; virtual void finish() = 0; protected: Formatter() {} }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/uuencode.h0000664000175000017500000000537713644433072015472 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UUENCODE_H #define CXXTOOLS_UUENCODE_H #include namespace cxxtools { class Uuencode_streambuf : public std::streambuf { std::streambuf* sinksource; unsigned length; char* obuffer; bool inStream; public: Uuencode_streambuf(std::streambuf* sinksource_, unsigned length_ = 45) : sinksource(sinksource_), length(length_), obuffer(new char[length]), inStream(false) { } ~Uuencode_streambuf() { end(); delete[] obuffer; } void begin(const std::string& filename, unsigned mode = 0644); void end(); protected: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; /** * uuencoder. */ class UuencodeOstream : public std::ostream { Uuencode_streambuf streambuf; public: UuencodeOstream(std::ostream& out) : std::ostream(0), streambuf(out.rdbuf()) { init(&streambuf); } UuencodeOstream(std::streambuf* sb) : std::ostream(0), streambuf(sb) { init(&streambuf); } ~UuencodeOstream() { end(); } void begin(const std::string& filename, unsigned mode = 0644) { streambuf.begin(filename, mode); } void end() { streambuf.end(); } }; } #endif // CXXTOOLS_UUENCODE_H cxxtools-3.0/include/cxxtools/utf8codec.h0000664000175000017500000001204613644433072015536 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * Copyright (C) 2005 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Utf8Codec_h #define cxxtools_Utf8Codec_h #include #include #include #include namespace cxxtools { /** * @brief This Codec class is able to convert from UTF-8 to UTF-32 and from UTF-32 to UTF-8. * * The method do_in() converts an array of char containing UTF-8-encoded data into an array * of cxxtools::Char which is UTF-32-encoded, which means that the data is a direct readable * 32-bit representation of the character. * * The method do_out() converts an array of cxxtools::Char objects (UTF-32/Unicode) into an * array of char which contains the same sequence of characters in UTF-8-encoding. */ class Utf8Codec : public TextCodec { public: /** * @brief Constructs a new Utf8Codec object which converts UTF-8 to UTF-32 and UTF-32 to UTF-8. * * The internal type is cxxtools::Char and external type is $char$ * * @param ref This optional parameter is passed to std::codecvt. When ref == 0 the locale takes * care of deleting the facet. If ref == 1 the locale does not destroy the facet. Default value is 0. */ explicit Utf8Codec(size_t ref = 0); //! Empty destructor virtual ~Utf8Codec() {} protected: //! @brief Decodes UTF-8 to UTF-32. virtual result do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, Char* toBegin, Char* toEnd, Char*& toNext) const; //! @brief Encodes UTF-32 to UTF-8. virtual result do_out(MBState& s, const Char* fromBegin, const Char* fromEnd, const Char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; // inheritdoc virtual bool do_always_noconv() const throw(); // inheritdoc virtual int do_length(MBState& s, const char* fromBegin, const char* fromEnd, size_t max) const; // inheritdoc virtual int do_max_length() const throw(); // inheritdoc std::codecvt_base::result do_unshift(cxxtools::MBState&, char*, char*, char*&) const { return std::codecvt_base::noconv; } // inheritdoc int do_encoding() const throw() { return 0; } public: /** @brief shortcut for converting utf-8 encoded data to unicode string Example: @code std::string data = cxxtools::Utf8Codec::decode(utfdataptr, utfdatasize); @endcode */ static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } /** @brief shortcut for converting utf-8 encoded std::string to unicode string */ static String decode(const std::string& data) { return cxxtools::decode(data); } /** @brief shortcut for converting unicode data to utf-8 encoded std::string */ static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } /** @brief shortcut for converting unicode string to utf-8 encoded std::string */ static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/ioerror.h0000664000175000017500000000703613644433072015336 00000000000000/* * Copyright (C) 2004-2006 Marc Boris Duerner * Copyright (C) 2005 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_IOERROR_H #define CXXTOOLS_IOERROR_H #include #include namespace cxxtools { class IOError : public std::ios::failure { public: explicit IOError(const std::string& what); ~IOError() throw() {} }; class IOTimeout : public IOError { public: IOTimeout(); ~IOTimeout() throw() {} }; class AccessFailed : public IOError { public: explicit AccessFailed(const std::string& what); ~AccessFailed() throw() {} }; class PermissionDenied : public AccessFailed { public: explicit PermissionDenied(const std::string& resource); ~PermissionDenied() throw() {} }; class DeviceNotFound : public AccessFailed { public: explicit DeviceNotFound(const std::string& device); ~DeviceNotFound() throw() {} }; class FileNotFound : public AccessFailed { public: explicit FileNotFound(const std::string& path); ~FileNotFound() throw() {} }; /** @brief A directory could not be found at a given path */ class DirectoryNotFound : public AccessFailed { public: /** @brief Construct from path and source info Constructs the exception from the path where the directory could not be found and the location in the source code where he exception was thrown. */ explicit DirectoryNotFound(const std::string& path); //! @brief Destructor ~DirectoryNotFound() throw() {} }; class IOPending : public IOError { public: explicit IOPending(const std::string& what); ~IOPending() throw() {} }; class DeviceClosed : public IOError { public: explicit DeviceClosed(const std::string& what); DeviceClosed(const char* what); ~DeviceClosed() throw() {} }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/string.h0000664000175000017500000005363113644433072015165 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STRING_H #define CXXTOOLS_STRING_H #include #include #include #include #include namespace std { /** @brief Unicode capable strings @ingroup Unicode */ template <> class basic_string< cxxtools::Char > { public: typedef cxxtools::Char value_type; typedef size_t size_type; typedef char_traits< cxxtools::Char > traits_type; typedef std::allocator allocator_type; typedef allocator_type::difference_type difference_type; typedef allocator_type::reference reference; typedef allocator_type::const_reference const_reference; typedef allocator_type::pointer pointer; typedef allocator_type::const_pointer const_pointer; typedef value_type* iterator; typedef const value_type* const_iterator; #if defined(HAVE_REVERSE_ITERATOR) typedef std::reverse_iterator reverse_iterator; typedef const std::reverse_iterator const_reverse_iterator; # define HAVE_STRING_REVERSE_ITERATOR #elif defined(HAVE_REVERSE_ITERATOR_4) typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; # define HAVE_STRING_REVERSE_ITERATOR #endif static const size_type npos = static_cast(-1); public: explicit basic_string( const allocator_type& a = allocator_type()); basic_string(const cxxtools::Char* str, const allocator_type& a = allocator_type()); basic_string(const wchar_t* str, const allocator_type& a = allocator_type()); basic_string(const wchar_t* str, size_type n, const allocator_type& a = allocator_type()); explicit basic_string(const std::string& str, const allocator_type& a = allocator_type()); explicit basic_string(const char* str, const allocator_type& a = allocator_type()); basic_string(const char* str, size_type n, const allocator_type& a = allocator_type()); basic_string(const cxxtools::Char* str, size_type n, const allocator_type& a = allocator_type()); basic_string(size_type n, cxxtools::Char c, const allocator_type& a = allocator_type()); basic_string(const basic_string& str); basic_string(const basic_string& str, const allocator_type& a); basic_string(const basic_string& str, size_type pos, const allocator_type& a = allocator_type()); basic_string(const basic_string& str, size_type pos, size_type n, const allocator_type& a = allocator_type()); basic_string(const cxxtools::Char* begin, const cxxtools::Char* end, const allocator_type& a = allocator_type()); template basic_string(InputIterator begin, InputIterator end, const allocator_type& a = allocator_type()); #if __cplusplus >= 201103L basic_string(basic_string&& str) noexcept; basic_string& operator=(basic_string&& str); #endif ~basic_string(); public: iterator begin() { return privdata_rw(); } iterator end() { return privdata_rw() + length(); } const_iterator begin() const { return privdata_ro(); } const_iterator end() const { return privdata_ro() + length(); } #ifdef HAVE_STRING_REVERSE_ITERATOR reverse_iterator rbegin() { return reverse_iterator( this->end() ); } reverse_iterator rend() { return reverse_iterator( this->begin() ); } const_reverse_iterator rbegin() const { return const_reverse_iterator( this->end() ); } const_reverse_iterator rend() const { return const_reverse_iterator( this->begin() ); } #endif reference operator[](size_type n) { return privdata_rw()[n]; } const_reference operator[](size_type n) const { return privdata_ro()[n]; } reference at(size_type n) { return privdata_rw()[n]; } const_reference at(size_type n) const { return privdata_ro()[n]; } public: void push_back(cxxtools::Char ch) { this->append(1, ch); } void resize( size_t n, cxxtools::Char ch = value_type() ); void reserve(size_t n = 0); void swap(basic_string& str); allocator_type get_allocator() const { return _data; } size_type copy(cxxtools::Char* a, size_type n, size_type pos = 0) const; basic_string substr(size_type pos, size_type n) const { return basic_string(*this, pos, n); } basic_string substr(size_type pos = 0) const { return basic_string(*this, pos); } public: size_type length() const { return isShortString() ? shortStringLength() : longStringLength(); } size_type size() const { return length(); } bool empty() const { return length() == 0; } size_type max_size() const { return ( size_type(-1) / sizeof(cxxtools::Char) ) - 1; } size_type capacity() const { return isShortString() ? shortStringCapacity() : longStringCapacity(); } const cxxtools::Char* data() const { return privdata_ro(); } const cxxtools::Char* c_str() const { return privdata_ro(); } basic_string& assign(const basic_string& str); basic_string& assign(const basic_string& str, size_type pos, size_type n); basic_string& assign(const string& str); basic_string& assign(const string& str, size_type pos, size_type n); basic_string& assign(const wchar_t* str); basic_string& assign(const wchar_t* str, size_type n); basic_string& assign(const cxxtools::Char* str); basic_string& assign(const cxxtools::Char* str, size_type length); basic_string& assign(const char* str); basic_string& assign(const char* str, size_type length); basic_string& assign(size_type n, cxxtools::Char c); template basic_string& assign(InputIterator begin, InputIterator end); basic_string& append(const cxxtools::Char* str); basic_string& append(const cxxtools::Char* str, size_type n); basic_string& append(size_type n, cxxtools::Char ch); basic_string& append(const basic_string& str); basic_string& append(const basic_string& str, size_type pos, size_type n); template basic_string& append(InputIterator begin, InputIterator end); basic_string& append(const cxxtools::Char* begin, const cxxtools::Char* end); basic_string& insert(size_type pos, const cxxtools::Char* str); basic_string& insert(size_type pos, const cxxtools::Char* str, size_type n); basic_string& insert(size_type pos, size_type n, cxxtools::Char ch); basic_string& insert(size_type pos, const basic_string& str); basic_string& insert(size_type pos, const basic_string& str, size_type pos2, size_type n); basic_string& insert(iterator p, cxxtools::Char ch); basic_string& insert(iterator p, size_type n, cxxtools::Char ch); // unimplemented //template //basic_string& insert(iterator p, InputIterator first, InputIterator last); void clear() { setLength(0); } basic_string& erase(size_type pos = 0, size_type n = npos); iterator erase(iterator pos); iterator erase(iterator first, iterator last); basic_string& replace(size_type pos, size_type n, const cxxtools::Char* str); basic_string& replace(size_type pos, size_type n, const cxxtools::Char* str, size_type n2); basic_string& replace(size_type pos, size_type n, size_type n2, cxxtools::Char ch); basic_string& replace(size_type pos, size_type n, const basic_string& str); basic_string& replace(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2); basic_string& replace(iterator i1, iterator i2, const cxxtools::Char* str); basic_string& replace(iterator i1, iterator i2, const cxxtools::Char* str, size_type n); basic_string& replace(iterator i1, iterator i2, size_type n, cxxtools::Char ch); basic_string& replace(iterator i1, iterator i2, const basic_string& str); //template //basic_string& replace(iterator i1, iterator i2, InputIterator j1, InputIterator j2); int compare(const basic_string& str) const; int compare(const cxxtools::Char* str) const; int compare(const cxxtools::Char* str, size_type n) const; int compare(const wchar_t* str) const; int compare(const wchar_t* str, size_type n) const; int compare(const std::string& str) const { return compare(str.data(), str.length()); } int compare(const char* str) const; int compare(const char* str, size_type n) const; int compare(size_type pos, size_type n, const basic_string& str) const; int compare(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2) const; int compare(size_type pos, size_type n, const cxxtools::Char* str) const; int compare(size_type pos, size_type n, const cxxtools::Char* str, size_type n2) const; size_type find(const basic_string& str, size_type pos = 0) const; size_type find(const cxxtools::Char* str, size_type pos, size_type n) const; size_type find(const cxxtools::Char* str, size_type pos = 0) const; // size_type find(cxxtools::Char ch, size_type pos = 0) const; size_type find(wchar_t ch, size_type pos = 0) const; size_type rfind(const basic_string& str, size_type pos = npos) const; size_type rfind(const cxxtools::Char* str, size_type pos, size_type n) const; size_type rfind(const cxxtools::Char* str, size_type pos = npos) const; size_type rfind(cxxtools::Char ch, size_type pos = npos) const; size_type rfind(wchar_t ch, size_type pos = npos) const; size_type find_first_of(const basic_string& str, size_type pos = 0) const { return this->find_first_of( str.data(), pos, str.size() ); } size_type find_first_of(const cxxtools::Char* s, size_type pos, size_type n) const; size_type find_first_of(const cxxtools::Char* str, size_type pos = 0) const { return this->find_first_of( str, pos, traits_type::length(str) ); } size_type find_first_of(const cxxtools::Char ch, size_type pos = 0) const { return this->find(ch, pos); } size_type find_last_of(const basic_string& str, size_type pos = npos) const { return this->find_last_of( str.data(), pos, str.size() ); } size_type find_last_of(const cxxtools::Char* s, size_type pos, size_type n) const; size_type find_last_of(const cxxtools::Char* str, size_type pos = npos) const { return this->find_last_of( str, pos, traits_type::length(str) ); } size_type find_last_of(const cxxtools::Char ch, size_type pos = npos) const { return this->rfind(ch, pos); } size_type find_first_not_of(const basic_string& str, size_type pos = 0) const { return this->find_first_not_of( str.data(), pos, str.size() ); } size_type find_first_not_of(const cxxtools::Char* s, size_type pos, size_type n) const; size_type find_first_not_of(const cxxtools::Char* str, size_type pos = 0) const { // requires_string(str); return this->find_first_not_of( str, pos, traits_type::length(str) ); } size_type find_first_not_of(const cxxtools::Char ch, size_type pos = 0) const; size_type find_last_not_of(const basic_string& str, size_type pos = npos) const { return this->find_last_not_of( str.data(), pos, str.size() ); } size_type find_last_not_of(const cxxtools::Char* tok, size_type pos, size_type n) const; size_type find_last_not_of(const cxxtools::Char* str, size_type pos = npos) const { //requires_string(s); return this->find_last_not_of( str, pos, traits_type::length(str) ); } // untested size_type find_last_not_of(cxxtools::Char ch, size_type pos = npos) const; public: std::string narrow(char dfault = '?') const; static basic_string widen(const char* str); static basic_string widen(const std::string& str); template OutIterT toUtf16(OutIterT to) const; template static basic_string fromUtf16(InIterT from, InIterT fromEnd); public: basic_string& operator=(const basic_string& str) { return this->assign(str); } basic_string& operator=(const string& str) { return this->assign(str); } basic_string& operator=(const char* str) { return this->assign(str); } basic_string& operator=(const cxxtools::Char* str) { return this->assign(str); } basic_string& operator=(cxxtools::Char c) { return this->assign(1, c); } basic_string& operator+=(const basic_string& str) { return this->append(str); } basic_string& operator+=(const cxxtools::Char* str) { return this->append(str); } basic_string& operator+=(cxxtools::Char c) { return this->append(1, c); } private: struct Ptr { cxxtools::Char* _begin; cxxtools::Char* _end; cxxtools::Char* _capacity; }; static const unsigned _minN = (sizeof(Ptr) / sizeof(uint32_t)) + 1; static const unsigned _shortStringSize = _minN < 8 ? 8 : _minN; struct Data : public allocator_type { Data(const allocator_type& a) : allocator_type(a) { u.shortdata[0] = 0; u.shortdata[_shortStringSize - 1] = _shortStringSize - 1; } union { Ptr ptr; uint32_t shortdata[_shortStringSize]; } u; } _data; private: const cxxtools::Char* privdata_ro() const { return isShortString() ? shortStringData() : longStringData(); } cxxtools::Char* privdata_rw() { return isShortString() ? shortStringData() : longStringData(); } void privreserve(size_t n); bool isShortString() const { return shortStringMagic() != 0xffff; } void markLongString() { shortStringMagic() = 0xffff; } const cxxtools::Char* shortStringData() const { return reinterpret_cast(&_data.u.shortdata[0]); } cxxtools::Char* shortStringData() { return reinterpret_cast(&_data.u.shortdata[0]); } uint32_t shortStringMagic() const { return _data.u.shortdata[_shortStringSize - 1]; } uint32_t& shortStringMagic() { return _data.u.shortdata[_shortStringSize - 1]; } size_type shortStringLength() const { return _shortStringSize - 1 - shortStringMagic(); } size_type shortStringCapacity() const { return _shortStringSize - 1; } void setShortStringLength(size_type n) { shortStringData()[n] = cxxtools::Char::null(); shortStringMagic() = static_cast(_shortStringSize - n - 1); } void shortStringAssign(const cxxtools::Char* str, size_type n) { traits_type::copy(shortStringData(), str, n); shortStringData()[n] = cxxtools::Char::null(); shortStringMagic() = static_cast(_shortStringSize - n - 1); } void shortStringAssign(const wchar_t* str, size_type n) { for (size_type nn = 0; nn < n; ++nn) shortStringData()[nn] = str[nn]; shortStringData()[n] = cxxtools::Char::null(); shortStringMagic() = static_cast(_shortStringSize - n - 1); } const cxxtools::Char* longStringData() const { return _data.u.ptr._begin; } cxxtools::Char* longStringData() { return _data.u.ptr._begin; } size_type longStringLength() const { return _data.u.ptr._end - _data.u.ptr._begin; } size_type longStringCapacity() const { return _data.u.ptr._capacity - _data.u.ptr._begin; } void setLength(size_type n) { if (isShortString()) setShortStringLength(n); else { _data.u.ptr._end = _data.u.ptr._begin + n; _data.u.ptr._begin[n] = cxxtools::Char::null(); } } }; inline basic_string operator+(const basic_string& a, const basic_string& b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(const basic_string& a, const cxxtools::Char* b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(const cxxtools::Char* a, const basic_string& b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(const basic_string& a, cxxtools::Char b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(cxxtools::Char a, const basic_string& b) { basic_string temp; temp += a; temp += b; return temp; } // operator == inline bool operator==(const basic_string& a, const basic_string& b) { return a.compare(b) == 0; } inline bool operator==(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) == 0; } inline bool operator==(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) == 0; } inline bool operator==(const basic_string& a, const wchar_t* b) { return a.compare(b) == 0; } inline bool operator==(const wchar_t* b, const basic_string& a) { return a.compare(b) == 0; } inline bool operator==(const basic_string& a, const char* b) { return a.compare(b) == 0; } inline bool operator==(const char* b, const basic_string& a) { return a.compare(b) == 0; } inline bool operator==(const basic_string& a, const std::string& b) { return a.compare(b) == 0; } inline bool operator==(const std::string& b, const basic_string& a) { return a.compare(b) == 0; } // operator != inline bool operator!=(const basic_string& a, const basic_string& b) { return a.compare(b) != 0; } inline bool operator!=(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) != 0; } inline bool operator!=(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) != 0; } inline bool operator!=(const basic_string& a, const wchar_t* b) { return a.compare(b) != 0; } // operator < inline bool operator<(const basic_string& a, const basic_string& b) { return a.compare(b) < 0; } inline bool operator<(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) > 0; } inline bool operator<(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) < 0; } inline bool operator<(const basic_string& a, const wchar_t* b) { return a.compare(b) < 0; } // operator > inline bool operator>(const basic_string& a, const basic_string& b) { return a.compare(b) > 0; } inline bool operator>(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) < 0; } inline bool operator>(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) > 0; } inline bool operator>(const basic_string& a, const wchar_t* b) { return a.compare(b) > 0; } ostream& operator<< (ostream& out, const basic_string& str); } // namespace std namespace cxxtools { /** @brief Unicode capable strings @ingroup Unicode */ typedef std::basic_string String; } // Include the implementation header #include #endif cxxtools-3.0/include/cxxtools/iso8859_4codec.h0000664000175000017500000000412213644433072016217 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_4CODEC_H #define CXXTOOLS_ISO8859_4CODEC_H #include namespace cxxtools { class Iso8859_4Codec : public CharMapCodec { public: explicit Iso8859_4Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/event.h0000664000175000017500000000515713644433072015000 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_EVENT_H #define cxxtools_EVENT_H #include namespace cxxtools { /** \brief Base class for all event types. Specific Event objects, subclass from Event and implement the clone() and typeInfo() methods. The first is used to deep copy event objects for example in an EventLoop and the latter one is used to dispatch events by type. */ class Event { public: /** \brief Destructor. */ virtual ~Event() {} virtual Event* clone() const = 0; virtual void destroy() = 0; virtual const std::type_info& typeInfo() const = 0; }; template class BasicEvent : public Event { public: BasicEvent() { } BasicEvent(const BasicEvent& /*src*/) { } virtual const std::type_info& typeInfo() const { return typeid(T); } virtual Event* clone() const { return new T(*static_cast(this)); } virtual void destroy() { delete this; } }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/constmethod.h0000664000175000017500000000312713644433072016201 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_ConstMethod_h #define cxxtools_ConstMethod_h #include #include #include namespace cxxtools { #include } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/file.h0000664000175000017500000001124213644433072014566 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FILE_H #define CXXTOOLS_FILE_H #include #include #include namespace cxxtools { /** @brief Provides common operations on files. */ class File { public: /** @brief Constructs a %File object from the path \a path If no file exists at \a path, an exception of type FileNotFound is thrown. */ explicit File(const std::string& path); /** @brief Constructs a %File object from a FileInfo object An exception of type %FileNotFound is thrown if the %FileInfo does not represent a file. */ explicit File(const FileInfo& fi); //! @brief Copy constructor File(const File& file); //! @brief Destrctor ~File(); //! @brief Assignment operator File& operator=(const File& file); /** @brief Returns the full path of file in the file-system This method may return a relative path, or a fully qualified one depending on how this object was constructed. */ const std::string& path() const { return _path; } //! @brief Returns the size of the file in bytes std::size_t size() const; /** @brief Returns the parent directory path This method might return an empty string if the node was created without a complete path. If the directory is located in the root directory of a unix file system, a slash ("/") is returned. A returned directory path always ends with a trailing path separator character. (A backslash in Windows and a slash in Unix, for example.) */ std::string dirName() const; //! @brief Returns the file name including an extension std::string name() const; //! @brief Returns the file name without the extension std::string baseName() const; //! @brief Returns the file name extension or an empty string if not present std::string extension() const; //! @brief Resizes the file to a new size of \a n bytes void resize(std::size_t n); /** @brief Removes the file. This object will be invalid after calling this method. */ void remove(); /** @brief Moves the file to the location given by \a to The %File object will stay valid after this method was called and point to the moved file. */ void move(const std::string& to); void link(const std::string& newpath); void symlink(const std::string& newpath); void copy(const std::string& newpath); public: //! @brief Creates a new file at the path given by \a path static File create(const std::string& path); //! @brief Returns true if a file exists at \a path, or false otherwise static bool exists(const std::string& path); protected: //! @brief Default Constructor File(); private: //! @internal std::string _path; }; inline bool operator<(const File& a, const File& b) { return a.path() < b.path(); } inline bool operator==(const File& a, const File& b) { return a.path() == b.path(); } inline bool operator!=(const File& a, const File& b) { return !(a == b); } } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/timespan.h0000664000175000017500000003367513644433072015505 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Timespan_h #define cxxtools_Timespan_h #include #include #include namespace cxxtools { class SerializationInfo; /** @brief Represents time spans up to microsecond resolution. @ingroup DateTime */ class Timespan { public: //! @brief Creates a Timespan. explicit Timespan(int64_t microseconds = 0) : _span(microseconds) { } /** @brief Creates a Timespan. Useful for creating a Timespan from a struct timeval. */ Timespan(long seconds, long microseconds) : _span(int64_t(seconds)*1000*1000 + microseconds) { } //! @brief Creates a Timespan. Timespan(int days, int hours, int minutes, int seconds, int microseconds) : _span( int64_t(microseconds) + int64_t(seconds)*1000*1000 + int64_t(minutes)*1000*1000*60 + int64_t(hours)*1000*1000*60*60 + int64_t(days)*1000*1000*60*60*24 ) { } bool operator==(const Timespan& ts) const { return _span == ts._span; } bool operator!=(const Timespan& ts) const { return _span != ts._span; } bool operator>(const Timespan& ts) const { return _span > ts._span; } bool operator>=(const Timespan& ts) const { return _span >= ts._span; } bool operator<(const Timespan& ts) const { return _span < ts._span; } bool operator<=(const Timespan& ts) const { return _span <= ts._span; } Timespan operator+(const Timespan& d) const { return Timespan(_span + d._span); } Timespan operator-(const Timespan& d) const { return Timespan(_span - d._span); } Timespan& operator+=(const Timespan& d) { _span += d._span; return *this; } Timespan& operator-=(const Timespan& d) { _span -= d._span; return *this; } Timespan operator-() const { return Timespan(-_span); } //! @brief Returns the total number of hours. double totalDays() const { return double(_span) / 1000 / 1000 / 60 / 60 / 24; } //! @brief Returns the total number of hours. double totalHours() const { return double(_span) / 1000 / 1000 / 60 / 60; } //! @brief Returns the total number of minutes. double totalMinutes() const { return double(_span) / 1000 / 1000 / 60; } //! @brief Returns the total number of seconds. double totalSeconds() const { return double(_span) / 1000 / 1000; } //! @brief Returns the total number of milliseconds. double totalMSecs() const { return double(_span) / 1000; } //! @brief Returns the total number of microseconds. int64_t totalUSecs() const { return _span; } //! @brief returns the current time as a timespan value. static Timespan gettimeofday(); private: int64_t _span; }; /** @brief A WeakTimespan extends a Timespan with a implicit conversion to and from number. The template parameter specifies, which unit is returned. It is the divisor needed to convert a number of microseconds to the requested unit. The template class is normally not used directly but the typedefs cxxtools::Microseconds, cxxtools::Milliseconds, cxxtools::Seconds, cxxtools::Minutes, cxxtools::Hours and cxxtools::Days are used. */ template class WeakTimespan : public Timespan { public: WeakTimespan() : Timespan() { } WeakTimespan(short units) : Timespan(units * Resolution) { } WeakTimespan(unsigned short units) : Timespan(units * Resolution) { } WeakTimespan(int units) : Timespan(units * Resolution) { } WeakTimespan(unsigned int units) : Timespan(units * Resolution) { } WeakTimespan(long units) : Timespan(units * Resolution) { } WeakTimespan(unsigned long units) : Timespan(units * Resolution) { } #ifdef HAVE_LONG_LONG WeakTimespan(long long units) : Timespan(units * Resolution) { } #endif #ifdef HAVE_UNSIGNED_LONG_LONG WeakTimespan(unsigned long long units) : Timespan(units * Resolution) { } #endif WeakTimespan(float units) : Timespan(units * Resolution) { } WeakTimespan(double units) : Timespan(units * Resolution) { } WeakTimespan(long double units) : Timespan(units * Resolution) { } WeakTimespan(const Timespan& ts) : Timespan(ts) { } WeakTimespan(long seconds, long microseconds) : Timespan(seconds, microseconds) { } WeakTimespan(int days, int hours, int minutes, int seconds, int microseconds) : Timespan(days, hours, minutes, seconds, microseconds) { } operator double() const { return totalUSecs() / static_cast(Resolution); } int64_t ceil() const { int64_t r = totalUSecs(); return r % Resolution == 0 || r < 0 ? r / Resolution : r / Resolution + 1; } }; /** @brief A WeakTimespan<1> specializes a WeakTimespan for microseconds. Since the Timespan holds the total number of microseconds, it can be returned as a int64_t instead of double to prevent conversion. */ template <> class WeakTimespan<1> : public Timespan { public: WeakTimespan() : Timespan() { } WeakTimespan(short units) : Timespan(units) { } WeakTimespan(unsigned short units) : Timespan(units) { } WeakTimespan(int units) : Timespan(units) { } WeakTimespan(unsigned int units) : Timespan(units) { } WeakTimespan(long units) : Timespan(units) { } WeakTimespan(unsigned long units) : Timespan(units) { } #ifdef HAVE_LONG_LONG WeakTimespan(long long units) : Timespan(units) { } #endif #ifdef HAVE_UNSIGNED_LONG_LONG WeakTimespan(unsigned long long units) : Timespan(units) { } #endif WeakTimespan(float units) : Timespan(units) { } WeakTimespan(double units) : Timespan(units) { } WeakTimespan(long double units) : Timespan(units) { } WeakTimespan(const Timespan& ts) : Timespan(ts) { } operator int64_t() const { return totalUSecs(); } }; /// @cond internal namespace tshelper { void get(std::istream& in, Timespan& ts, uint64_t res); void get(const SerializationInfo& si, Timespan& ts, uint64_t res); } /// @endcond /** The typedefs makes specifying a timespan easy and readable. Examples: @code // for this example we assume these functions: void foo(Milliseconds t); // a function expecting a timespan - default unit is milliseconds Milliseconds foo(); // a function returning a timespan - default is to return milliseconds // specify 5 milliseconds: cxxtools::Timespan t = Milliseconds(5); // specify half second: cxxtools::Timespan halfSecond = Seconds(0.5); // get a timespan value in seconds: cxxtools::Timespan someTimespan = foo(); double numberOfSeconds = Seconds(someTimespan); // or shorter: double numberOfSeconds(Seconds(foo()); // pass a timespan to a function: foo(500); // since foo expects a cxxtools::Milliseconds, the default is // to convert a number to milliseconds timespan foo(cxxtools::Seconds(0.5)); // Seconds is a Timespan, which can be converted to Milliseconds // so that foo is here called with 500 milliseconds // get the number of milliseconds or some other unit in a timespan: cxxtools::Timespan someTimespan = foo(); double numberOfMilliseconds = cxxtools::Milliseconds(someTimespan); double numberOfSeconds = cxxtools::Seconds(someTimespan); double numberOfDays = cxxtools::Days(someTimespan); @endcode */ typedef WeakTimespan<1> Microseconds; typedef WeakTimespan Milliseconds; typedef WeakTimespan Seconds; typedef WeakTimespan Minutes; typedef WeakTimespan Hours; typedef WeakTimespan Days; inline Timespan operator * (const Timespan& d, double fac) { return Timespan(d.totalUSecs() * fac); } inline Timespan operator * (double fac, const Timespan& d) { return Timespan(d.totalUSecs() * fac); } inline Timespan operator / (const Timespan& d, double fac) { return Timespan(d.totalUSecs() / fac); } /// outputs timespan as number of seconds with the suffix 's' std::ostream& operator<< (std::ostream& out, const Timespan& ts); /// outputs timespan as number of microseconds with the suffix 'us' std::ostream& operator<< (std::ostream& out, const Microseconds& ts); /// outputs timespan as number of milliseconds with the suffix 'ms' std::ostream& operator<< (std::ostream& out, const Milliseconds& ts); /// outputs timespan as number of seconds with the suffix 's' std::ostream& operator<< (std::ostream& out, const Seconds& ts); /// outputs timespan as number of minutes with the suffix 'min' std::ostream& operator<< (std::ostream& out, const Minutes& ts); /// outputs timespan as number of hours with the suffix 'h' std::ostream& operator<< (std::ostream& out, const Hours& ts); /// outputs timespan as number of days with the suffix 'd' std::ostream& operator<< (std::ostream& out, const Days& ts); /// reads a whole number from stream and creates a timespan with the number of microseconds inline std::istream& operator>> (std::istream& in, Timespan& ts) { tshelper::get(in, ts, 1); return in; } /// reads a whole number from stream and creates a timespan with the number of microseconds inline std::istream& operator>> (std::istream& in, Microseconds& ts) { tshelper::get(in, ts, 1); return in; } /// reads a decimal number from stream and creates a timespan with the number of milliseconds inline std::istream& operator>> (std::istream& in, Milliseconds& ts) { tshelper::get(in, ts, int64_t(1000)); return in; } /// reads a decimal number from stream and creates a timespan with the number of seconds inline std::istream& operator>> (std::istream& in, Seconds& ts) { tshelper::get(in, ts, int64_t(1000)*1000); return in; } /// reads a decimal number from stream and creates a timespan with the number of minutes inline std::istream& operator>> (std::istream& in, Minutes& ts) { tshelper::get(in, ts, int64_t(1000)*1000*60); return in; } /// reads a decimal number from stream and creates a timespan with the number of hours inline std::istream& operator>> (std::istream& in, Hours& ts) { tshelper::get(in, ts, int64_t(1000)*1000*60*60); return in; } /// reads a decimal number from stream and creates a timespan with the number of days inline std::istream& operator>> (std::istream& in, Days& ts) { tshelper::get(in, ts, int64_t(1000)*1000*60*60*24); return in; } inline void operator >>=(const SerializationInfo& si, Timespan& timespan) { tshelper::get(si, timespan, 1); } inline void operator >>=(const SerializationInfo& si, Milliseconds& timespan) { tshelper::get(si, timespan, int64_t(1000)); } inline void operator >>=(const SerializationInfo& si, Seconds& timespan) { tshelper::get(si, timespan, int64_t(1000)*1000); } inline void operator >>=(const SerializationInfo& si, Minutes& timespan) { tshelper::get(si, timespan, int64_t(1000)*1000*60); } inline void operator >>=(const SerializationInfo& si, Hours& timespan) { tshelper::get(si, timespan, int64_t(1000)*1000*60*60); } inline void operator >>=(const SerializationInfo& si, Days& timespan) { tshelper::get(si, timespan, int64_t(1000)*1000*60*60*24); } void operator <<=(SerializationInfo& si, const Timespan& timespan); void operator <<=(SerializationInfo& si, const Microseconds& timespan); void operator <<=(SerializationInfo& si, const Milliseconds& timespan); void operator <<=(SerializationInfo& si, const Seconds& timespan); void operator <<=(SerializationInfo& si, const Minutes& timespan); void operator <<=(SerializationInfo& si, const Hours& timespan); void operator <<=(SerializationInfo& si, const Days& timespan); } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/systemerror.h0000664000175000017500000000644413644433072016255 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2005-2007 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_ERROR_H #define CXXTOOLS_SYSTEM_ERROR_H #include #include namespace cxxtools { /** @brief Exception class indicating a system error. */ class SystemError : public std::runtime_error { protected: explicit SystemError(const std::string& msg); public: SystemError(int err, const char* fn); explicit SystemError(const char* fn); SystemError(const char* fn, const std::string& msg); ~SystemError() throw(); int getErrno() const { return m_errno; } private: int m_errno; }; void throwSystemError(const char* fn); void throwSystemError(int errnum, const char* fn); /** @brief Thrown, when a shared library could not be loaded */ class OpenLibraryFailed : public SystemError { std::string _library; public: //! @brief Constructs from a message string explicit OpenLibraryFailed(const std::string& library); //! @brief Destructor ~OpenLibraryFailed() throw() {} const std::string& library() const { return _library; } }; /** @brief Thrown, when a symbol is not found in a library */ class SymbolNotFound : public SystemError { std::string _symbol; public: explicit SymbolNotFound(const std::string& sym); //! @brief Destructor ~SymbolNotFound() throw() {} //! @brief Returns the symbol, which was not found const std::string& symbol() const { return _symbol; } }; class SslError : public SystemError { public: SslError(const std::string& msg, unsigned long sslError) : SystemError(msg), _sslError(sslError) { } unsigned long getSslError() const { return _sslError; } /// \internal static void checkSslError(); private: unsigned long _sslError; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/cgi.h0000664000175000017500000000473413644433072014421 00000000000000/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CGI_H #define CXXTOOLS_CGI_H #include namespace cxxtools { /** Class for easy extraction of CGI-parameters. This class reads automatically GET- and POST-parameters from stdin and the environvariable QUERY_STRING, like CGI-programs do. This eases writing CGI-programs in C++. example: \code int main() { cxxtools::Cgi q; // this parses all input-parameters std::cout << q.header << "\n" << "\n" << "
\n" << "
\n" << "
\n" << "
\n" << "
\n" << "you entered: " << q["v"] << "\n" << "" << ""; } \endcode */ class Cgi : public QueryParams { public: /// constructor reads parameters from server Cgi(); static std::string header() { return "Content-Type: text/html\r\n\r\n"; } static std::string header(const std::string& type) { return "Content-Type: " + type + "\r\n\r\n"; } }; } #endif // CXXTOOLS_CGI_H cxxtools-3.0/include/cxxtools/noncopyable.h0000664000175000017500000000325613644433072016166 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NONCOPYABLE_H #define CXXTOOLS_NONCOPYABLE_H namespace cxxtools { /// @deprecated class NonCopyable { private: NonCopyable(const NonCopyable&); // no implementation NonCopyable& operator=(const NonCopyable&); // no implementation public: NonCopyable() { } }; } #endif // CXXTOOLS_NONCOPYABLE_H cxxtools-3.0/include/cxxtools/jsonserializer.h0000664000175000017500000001442713644433072016722 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONSERIALIZER_H #define CXXTOOLS_JSONSERIALIZER_H #include #include #include #include #include namespace cxxtools { /** * Here is a small example to use this class. * @code{.cpp} * #include * #include * #include * * // define a configuration object * struct Configuration * { * struct Indent * { * int length; * bool useSpace; * }; * * std::string encoding; * std::vector plugIns; * Indent indent; * }; * * // define how to serialize the indent struct of configuration * void operator<<= (cxxtools::SerializationInfo& si, const Configuration::Indent& indent) * { * si.addMember("length") <<= indent.length; * si.addMember("use_space") <<= indent.useSpace; * } * * // define how to serialize the configuration * void operator<<= (cxxtools::SerializationInfo& si, const Configuration& config) * { * si.addMember("encoding") <<= config.encoding; * si.addMember("plug-ins") <<= config.plugIns; * si.addMember("indent") <<= config.indent; * } * * int main(int argc, char* argv[]) * { * try * { * // create a configuration object: * Configuration config; * config.encoding = "UTF-8"; * config.plugIns.push_back("python"); * config.plugIns.push_back("c++"); * config.plugIns.push_back("ruby"); * config.indent.length = 3; * config.indent.useSpace = true; * * // serialize to json * cxxtools::JsonSerializer serializer(std::cout); * serializer.beautify(true); // this makes it just nice to read * serializer.serialize(config).finish(); * } * catch (const std::exception& e) * { * std::cerr << e.what() << std::endl; * } * } * @endcode */ class JsonSerializer { // make non copyable JsonSerializer(const JsonSerializer&) { } JsonSerializer& operator=(const JsonSerializer&) { return *this; } public: JsonSerializer() : _os(0), _inObject(false) { } explicit JsonSerializer(std::ostream& os) : _os(0), _inObject(false) { begin(os); } JsonSerializer& begin(std::ostream& os) { _os = &os; _formatter.begin(os); return *this; } void finish() { if (_inObject) { _formatter.finishObject(); _inObject = false; } _formatter.finish(); _os->flush(); } template JsonSerializer& serialize(const T& v, const std::string& name) { Decomposer s; s.begin(v); s.setName(name); if (!_inObject) { _formatter.beginObject(std::string(), std::string()); _inObject = true; } s.format(_formatter); return *this; } template JsonSerializer& serialize(const T& v) { if (_inObject) throw std::logic_error("can't serialize object without name into another object"); Decomposer s; s.begin(v); s.format(_formatter); _os->flush(); return *this; } void setObject() { _formatter.beginObject(std::string(), std::string()); _inObject = true; } bool object() const { return _inObject; } bool beautify() const { return _formatter.beautify(); } void beautify(bool sw) { _formatter.beautify(sw); } bool plainkey() const { return _formatter.plainkey(); } void plainkey(bool sw) { _formatter.plainkey(sw); } template static std::string toString(const T& type, const std::string& name, bool beautify = false) { std::ostringstream os; JsonSerializer s; if (beautify) s.beautify(true); s.begin(os); s.serialize(type, name); s.finish(); return os.str(); } private: JsonFormatter _formatter; std::ostream* _os; bool _inObject; }; } #endif // CXXTOOLS_JSONSERIALIZER_H cxxtools-3.0/include/cxxtools/time.h0000664000175000017500000002524413644433072014614 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006-2008 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TIME_H #define CXXTOOLS_TIME_H #include #include #include #include namespace cxxtools { class SerializationInfo; class InvalidTime : public std::invalid_argument { public: InvalidTime(); explicit InvalidTime(const std::string& what) : std::invalid_argument(what) { } ~InvalidTime() throw() {} }; /** @brief %Time expressed in hours, minutes, seconds and milliseconds @ingroup DateTime */ class Time { public: static const unsigned MaxHours = 23; static const unsigned HoursPerDay = 24; static const unsigned MaxMinutes = 59; static const unsigned MinutesPerHour = 60; static const unsigned MinutesPerDay = 1440; static const unsigned MaxSeconds = 59; static const unsigned SecondsPerDay = 86400; static const unsigned SecondsPerHour = 3600; static const unsigned SecondsPerMinute = 60; static const unsigned MSecsPerDay = 86400000; static const unsigned MSecsPerHour = 3600000; static const unsigned MSecsPerMinute = 60000; static const unsigned MSecsPerSecond = 1000; static const uint64_t USecsPerDay = static_cast(MSecsPerDay) * 1000; /** \brief Creates a Time set to zero. */ Time() : _usecs(0) {} /** \brief create Time from string using format Valid format codes are: %H hours (0-23) %I hours (0-11) %2I hours (00-11) %M minutes (0-59) %2M minutes (00-59) %S seconds (0-59) %2S seconds (00-59) %j fractional seconds (1-6 digits, optionally leading '.') %J fractional seconds (1-6 digits, with leading '.') %K milliseconds (3 digits, with leading '.') %k milliseconds (3 digits) %U microseconds (6 digits, with leading '.') %u microseconds (6 digits) %p AM/PM ? arbitrary character * skip non digit characters # skip word */ explicit Time(const std::string& d, const std::string& fmt = "%H:%M:%S%j"); /** \brief Creates a Time from given values. InvalidTime is thrown if one or more of the values are out of range */ Time(unsigned h, unsigned m, unsigned s = 0, unsigned ms = 0, unsigned usec = 0) { set(h, m, s, ms, usec); } /** \brief Returns the hour-part of the Time. */ unsigned hour() const { return unsigned(_usecs / 1000 / 1000 / 60 / 60); } /** \brief Returns the minute-part of the Time. */ unsigned minute() const { return unsigned(_usecs / 1000 / 1000 / 60) % 60; } /** \brief Returns the second part of the Time. */ unsigned second() const { return unsigned(_usecs / 1000 / 1000) % 60; } /** \brief Returns the millisecond part of the Time. */ unsigned msec() const { return unsigned(_usecs / 1000) % 1000; } /** \brief Returns the microseconds of the Time. * * Note that the microseconds contain the milliseconds also. */ unsigned usec() const { return unsigned(_usecs % 1000000); } unsigned totalMSecs() const { return _usecs / 1000; } uint64_t totalUSecs() const { return _usecs; } void setTotalMSecs(unsigned msecs) { _usecs = static_cast(msecs) * 1000; } void setTotalUSecs(uint64_t m) { _usecs = m; } /** \brief Sets the time. Sets the time to a new hour, minute, second, millisecond. InvalidTime is thrown if one or more of the values are out of range */ void set(unsigned hour, unsigned min, unsigned sec, unsigned msec = 0, unsigned usec = 0) { if ( ! isValid(hour, min, sec, msec, usec) ) { throw InvalidTime(); } _usecs = (((((static_cast(hour) * 60 + min) * 60) + sec) * 1000) + msec) * 1000 + usec; } /** @brief Get the time values Gets the hour, minute, second and millisecond parts of the time. */ void get(unsigned& h, unsigned& m, unsigned& s, unsigned& ms) const { h = hour(); m = minute(); s = second(); ms = msec(); } /** @brief Get the time values Gets the hour, minute, second, millisecond and microsecond parts of the time. Note that the microseconds include the millisecons. */ void get(unsigned& h, unsigned& m, unsigned& s, unsigned& ms, unsigned& us) const { h = hour(); m = minute(); s = second(); ms = msec(); us = usec(); } /** \brief format Time into a string using a format string Valid format codes are: %1H hours (0-23) %I hours (00-11) %1I hours (0-11) %M minutes (00-59) %1M minutes (0-59) %S seconds (00-59) %1S seconds (0-59) %j fractional seconds (1-6 digits, optionally leading '.') %J fractional seconds (1-6 digits, with leading '.') %K milliseconds (3 digits, with leading '.') %k milliseconds (3 digits) %U microseconds (6 digits, with leading '.') %u microseconds (6 digits) %p am/pm %P AM/PM */ std::string toString(const std::string& fmt = "%H:%M:%S%j") const; /** @brief Assignment operator */ Time& operator=(const Time& other) { _usecs=other._usecs; return *this; } /** @brief Equal comparison operator */ bool operator==(const Time& other) const { return _usecs == other._usecs; } /** @brief Inequal comparison operator */ bool operator!=(const Time& other) const { return _usecs != other._usecs; } /** @brief Less-than comparison operator */ bool operator<(const Time& other) const { return _usecs < other._usecs; } /** @brief Less-than-or-equal comparison operator */ bool operator<=(const Time& other) const { return _usecs <= other._usecs; } /** @brief Greater-than comparison operator */ bool operator>(const Time& other) const { return _usecs > other._usecs; } /** @brief Greater-than-or-equal comparison operator */ bool operator>=(const Time& other) const { return _usecs >= other._usecs; } /** @brief Assignment by sum operator */ Time& operator+=(const Timespan& ts); /** @brief Assignment by difference operator */ Time& operator-=(const Timespan& ts); /** @brief Addition operator */ friend Time operator+(const Time& time, const Timespan& ts); /** @brief Subtraction operator */ friend Time operator-(const Time& time, const Timespan& ts); /** @brief Subtraction operator */ friend Timespan operator-(const Time& a, const Time& b) { return Microseconds( a._usecs >= b._usecs ? double(a._usecs - b._usecs) : -double(b._usecs - a._usecs)); } /** \brief Returns the time in ISO-format (hh:mm:ss.hhh) */ std::string toIsoString() const { return toString(); } /** \brief Returns true if values are a valid time */ static bool isValid(unsigned h, unsigned m, unsigned s, unsigned ms) { return h < 24 && m < 60 && s < 60 && ms < 1000; } /** \brief Returns true if values are a valid time */ static bool isValid(unsigned h, unsigned m, unsigned s, unsigned ms, unsigned usec) { return h < 24 && m < 60 && s < 60 && ms < 1000 && usec < 1000000; } /** \brief Convert from an ISO time string Interprets the passed string as a time-string in ISO-format (hh:mm:ss.hhh) and returns a Time-object. If the string is not in ISO-format, InvalidTime is thrown. */ static Time fromIsoString(const std::string& s) { return Time(s); } private: //! @internal uint64_t _usecs; }; void operator >>=(const SerializationInfo& si, Time& time); void operator <<=(SerializationInfo& si, const Time& time); /** @brief Addition operator */ inline Time operator+(const Time& time, const Timespan& ts) { Time t(time); t += ts; return t; } /** @brief Subtraction operator */ inline Time operator-(const Time& time, const Timespan& ts) { Time t(time); t -= ts; return t; } } #endif // CXXTOOLS_TIME_H cxxtools-3.0/include/cxxtools/query_params.h0000664000175000017500000002111513644433072016357 00000000000000/* * Copyright (C) 2003,2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUERY_PARAMS_H #define CXXTOOLS_QUERY_PARAMS_H #include #include #include #include #include #include #include namespace cxxtools { class SerializationInfo; /** QueryParams represents parameters from a HTML-Form. There are 2 types of Query-Parameters from a HTML-Form: named and unnamed. And names are not unique. This results in a combination of a multiset and a set. this class uses a vector instead of a set, because order does matter in unnamed parameters. The class has a parser to extract parameters from a std::string or from a input-stream. */ class QueryParams { friend void operator<<= (cxxtools::SerializationInfo& si, const QueryParams& p); public: struct value_type { std::string name; std::string value; value_type() { } value_type(const std::string& name_, const std::string& value_) : name(name_), value(value_) { } }; typedef std::vector values_type; typedef values_type::size_type size_type; /** Iterator for named and unnamed parameters in QueryParams. */ class const_iterator : public std::iterator { const QueryParams* params; std::string name; size_type pos; size_type size() const { return (name.empty() ? params->paramcount() : params->paramcount(name)); } bool is_end() const { return params == 0 || pos >= size(); } size_type getpos() const { return is_end() ? size() : pos; } public: /// initialize generic end-iterator const_iterator() : params(0), pos(0) { } /// initialize iterator for unnamed params explicit const_iterator(const QueryParams& p) : params(&p), pos(0) { } /// initialize iterator for named params const_iterator(const QueryParams& p, const std::string& n) : params(&p), name(n), pos(0) { } bool operator== (const const_iterator& it) const { bool e = it.is_end(); return is_end() ? e : !e && pos == it.pos; } bool operator!= (const const_iterator& it) const { bool e = it.is_end(); return is_end() ? !e : e || pos != it.pos; } const_iterator& operator++() { ++pos; return *this; } const_iterator operator++(int) { const_iterator it = *this; ++pos; return it; } const_iterator& operator--() { --pos; return *this; } const_iterator operator--(int) { const_iterator it = *this; --pos; return it; } reference operator*() const { return name.empty() ? params->param(pos) : params->param(name, pos); } pointer operator->() const { return &(operator*()); } }; private: values_type _values; public: /// default constructor QueryParams() { } explicit QueryParams(const std::string& url) { parse_url(url); } explicit QueryParams(const char* url) { parse_url(url); } /// read parameters from url void parse_url(const std::string& url); /// read parameters from url void parse_url(const char* url); /// read parameters from stream void parse_url(std::istream& url_stream); // // unnamed parameter // /// get unnamed parameter by number (no range-check!) const std::string& param(size_type n) const { return param(std::string(), n); } /// get number of unnamed parameters size_type paramcount() const { return paramcount(std::string()); } /// get unnamed parameter with operator[] (no range-check!) const std::string& operator[] (size_type n) const { return param(n); } /// add unnamed parameter QueryParams& add(const std::string& value) { _values.push_back(value_type(std::string(), value)); return *this; } /// remove unnamed parameter QueryParams& remove() { remove(std::string()); return *this; } /// set unnamed parameter QueryParams& set(const std::string& value) { remove(); add(value); return *this; } // // named parameter // /// get nth named parameter. const std::string& param(const std::string& name, size_type n = 0) const; /// get nth named parameter with default value. std::string param(const std::string& name, size_type n, const std::string& def) const; /// get named parameter or default value. std::string param(const std::string& name, const std::string& def) const { return param(name, 0, def); } /// get number of parameters with the given name size_type paramcount(const std::string& name) const; /// get first named parameter with operator[] std::string operator[] (const std::string& name) const { return param(name, 0, std::string()); } /// checks if the named parameter exists bool has(const std::string& name) const; /// add named parameter QueryParams& add(const std::string& name, const std::string& value) { _values.push_back(value_type(name, value)); return *this; } /// remove named parameter QueryParams& remove(const std::string& name); /// sets named parameter QueryParams& set(const std::string& name, const std::string& value) { remove(name); add(name, value); return *this; } QueryParams& add(const QueryParams& other) { _values.insert(_values.end(), other._values.begin(), other._values.end()); return *this; } /// returns all names of parameters template void getNames(output_iterator o) const { for (values_type::const_iterator i = _values.begin(); i != _values.end(); ++i) *o++ = (*i).name; } /// removes all data void clear() { _values.clear(); } /// returns true, when no parameters exist (named and unnamed) bool empty() const { return _values.empty(); } // // iterator-methods // /// get iterator to unnamed parameters const_iterator begin() const { return const_iterator(*this); } /// get iterator to named parameter const_iterator begin(const std::string& name) const { return const_iterator(*this, name); } /// get end-iterator (named and unnamed) const_iterator end() const { return const_iterator(); } /// get parameters as url std::string getUrl() const; }; /// output QueryParams in url-syntax inline std::ostream& operator<< (std::ostream& out, const QueryParams& p) { return out << p.getUrl(); } inline std::istream& operator>> (std::istream& in, QueryParams& p) { p.parse_url(in); return in; } /// make QueryParams serializable void operator<<= (cxxtools::SerializationInfo& si, const QueryParams& p); } #endif // CXXTOOLS_QUERY_PARAMS_H cxxtools-3.0/include/cxxtools/pool.h0000664000175000017500000001521613644433072014625 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POOL_H #define CXXTOOLS_POOL_H #include #include #include namespace cxxtools { /// This class is a factory for objects wich are default constructable. template class DefaultCreator { public: T* operator() () { return new T(); } }; /** A Pool is a container for pooled objects It maintains a list of object instances which are not in use. If a program needs an instance, it can request one with the get-method. The pool returns a smart pointer to an instance. When the pointer is released, the instance is put back into the pool or dropped if the pool already has the maximum number of instances. */ template , template class OwnershipPolicy = RefLinked, template class DestroyPolicy = DeletePolicy> class Pool { #if __cplusplus >= 201103L Pool(const Pool&) = delete; Pool& operator=(const Pool&) = delete; #else Pool(const Pool&) { } Pool& operator=(const Pool&) { return *this; } #endif public: class Ptr : public OwnershipPolicy, public DestroyPolicy { ObjectType* object; Pool* pool; typedef OwnershipPolicy OwnershipPolicyType; typedef DestroyPolicy DestroyPolicyType; void doUnlink() { if (OwnershipPolicyType::unlink(object)) { if (pool == 0 || !pool->put(*this)) DestroyPolicyType::destroy(object); } } public: Ptr() : object(0), pool(0) {} Ptr(ObjectType* ptr) : object(ptr), pool(0) { OwnershipPolicyType::link(*this, ptr); } Ptr(const Ptr& ptr) : object(ptr.object), pool(ptr.pool) { OwnershipPolicyType::link(ptr, ptr.object); } ~Ptr() { doUnlink(); } Ptr& operator= (const Ptr& ptr) { if (object != ptr.object) { doUnlink(); object = ptr.object; pool = ptr.pool; OwnershipPolicyType::link(ptr, object); } return *this; } /// The object can be dereferenced like the held object ObjectType* operator->() const { return object; } /// The object can be dereferenced like the held object ObjectType& operator*() const { return *object; } bool operator== (const ObjectType* p) const { return object == p; } bool operator!= (const ObjectType* p) const { return object != p; } bool operator< (const ObjectType* p) const { return object < p; } bool operator! () const { return object == 0; } operator bool () const { return object != 0; } ObjectType* getPointer() { return object; } const ObjectType* getPointer() const { return object; } operator ObjectType* () { return object; } operator const ObjectType* () const { return object; } void setPool(Pool* p) { pool = p; } // don't put the object back to the pool void release() { pool = 0; } }; private: typedef std::vector Container; Container freePool; unsigned maxSpare; mutable Mutex mutex; CreatorType creator; bool put(Ptr& po) // returns true, if object was put into the freePool vector { MutexLock lock(mutex); if (maxSpare == 0 || freePool.size() < maxSpare) { po.setPool(0); freePool.push_back(po); return true; } return false; } public: explicit Pool(unsigned maxSpare_ = 0, CreatorType creator_ = CreatorType()) : maxSpare(maxSpare_), creator(creator_) { } explicit Pool(CreatorType creator_) : maxSpare(0), creator(creator_) { } ~Pool() { freePool.clear(); } Ptr get() { MutexLock lock(mutex); Ptr po; if (freePool.empty()) { po = creator(); } else { po = freePool.back(); freePool.pop_back(); } po.setPool(this); return po; } void drop(unsigned keep = 0) { MutexLock lock(mutex); if (freePool.size() > keep) freePool.resize(keep); } unsigned getMaximumSize() const { MutexLock lock(mutex); return maxSpare; } unsigned size() const { MutexLock lock(mutex); return freePool.size(); } unsigned getCurrentSize() const { MutexLock lock(mutex); return freePool.size(); } void setMaximumSize(unsigned s) { MutexLock lock(mutex); maxSpare = s; if (freePool.size() > s) freePool.resize(s); } CreatorType& getCreator() { return creator; } const CreatorType& getCreator() const { return creator; } }; } #endif cxxtools-3.0/include/cxxtools/method.h0000664000175000017500000000310113644433072015122 00000000000000/* * Copyright (C) 2005 by Dr. Marc Boris Drner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Method_h #define cxxtools_Method_h #include #include #include namespace cxxtools { #include } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/smartptr.h0000664000175000017500000002563113644433072015532 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SMARTPTR_H #define CXXTOOLS_SMARTPTR_H #include namespace cxxtools { /** \param ObjectType The managed object type */ template /** \brief Reference linking. Reference linking means that no counter is required to keep track of the smart pointer objects, but all smart pointers form a linked list. When the list becomes empty the raw pointer si deleted. This Model has the advantage that it does not need to allocate memory, but is prone to circular dependencies. */ class RefLinked { mutable const RefLinked* prev; mutable const RefLinked* next; protected: RefLinked() : prev(0), next(0) { } //! \brief Unlink a smart pointer from a managed object bool unlink(ObjectType* object) { if (object) { if (next == this) { next = prev = 0; return true; } else { next->prev = prev; prev->next = next; next = prev = this; } } return false; } //! \brief Link a smart pointer to a managed object void link(const RefLinked& ptr, ObjectType* object) { if (object) { if (ptr.next) { prev = &ptr; next = ptr.next; prev->next = this; next->prev = this; } else { prev = next = this; } } } }; /** \param ObjectType The managed object type */ template /** \brief Intrusive reference counting. Intrusive reference couting means that the reference count is part of the managed heap object. Linking and unlinking will only increase and decrease this counter, but not delete it. The managed object needs to implement the methods release() and addRef(). The release must return something, that equals 0 when the last reference is released. */ class InternalRefCounted { protected: //! \brief unlink a smart pointer from a managed object bool unlink(ObjectType* object) { return object && object->release() == 0; } //! \brief link a smart pointer to a managed object void link(const InternalRefCounted& /*ptr*/, ObjectType* object) { if (object) object->addRef(); } }; /** \param ObjectType The managed object type */ template /** \brief Non-intrusive reference counting. Non-intrusive reference couting means that the reference count is not part of the managed heap object but part of the policy. Linking and unlinking will increase and decrease the policies counter and delete the managed object if it reaches zero. A small amount of memory needs to be allocated for the counter variable. */ class ExternalRefCounted { unsigned* rc; protected: ExternalRefCounted() : rc(0) { } //! \brief unlink a smart pointer from a managed object bool unlink(ObjectType* object) { if (object && --*rc <= 0) { delete rc; rc = 0; return true; } else return false; } //! \brief link a smart pointer to a managed object void link(const ExternalRefCounted& ptr, ObjectType* object) { if (object) { if (ptr.rc == 0) rc = new unsigned(1); else { rc = ptr.rc; ++*rc; } } else rc = 0; } public: unsigned refs() const { return rc ? *rc : 0; } }; template class ExternalAtomicRefCounted { std::atomic* rc; protected: ExternalAtomicRefCounted() : rc(0) { } bool unlink(ObjectType* object) { if (object && --*rc <= 0) { delete rc; rc = 0; return true; } else return false; } void link(const ExternalAtomicRefCounted& ptr, ObjectType* object) { if (object) { if (ptr.rc == 0) rc = new std::atomic(1); else { rc = ptr.rc; --*rc; } } else rc = 0; } public: unsigned refs() const { return rc ? rc->load() : 0; } }; /** \param ObjectType The managed object type */ template /** \brief old name for DeletePolicy for compatibility. The DefaultDestroyPolicy implements the method, which instructs the SmartPtr to free the object which it helds by deleting it. */ class DefaultDestroyPolicy { public: static void destroy(ObjectType* ptr) { delete ptr; } }; /** \param ObjectType The managed object type */ template /** \brief deleter policy for smart pointer. The DeletePolicy is actually an alternative name for DefaultDestroyPolicy. */ class DeletePolicy { public: static void destroy(ObjectType* ptr) { delete ptr; } }; template class FreeDestroyPolicy { public: static void destroy(T* ptr) { free(ptr); } }; template class ArrayDestroyPolicy { public: static void destroy(ObjectType* ptr) { delete[] ptr; } }; /** * Policy-based smart-pointer-class. * * This class works like a pointer, but the destructor deletes the held * object if this is the last reference. The policy specifies, how the class * counts the references. There are 4 policies: * * ExternalRefCounted: allocates a reference-count * * ExternalAtomicRefCounted: like ExternalRefCounted, but thread safe * * InternalRefCounted: the pointed object needs to have a reference-counter * with methods addRef() and release(). The release-method deletes the * object, when the reference-count drops to 0. * * RefLinked: all pointers to a object are linked * * The default policy is InternalRefCounted. Another class * cxxtools::RefCounted implements proper methods for the pointer, which * makes it straight-forward to use. * */ template class OwnershipPolicy = InternalRefCounted, template class DestroyPolicy = DefaultDestroyPolicy> class SmartPtr : public OwnershipPolicy, public DestroyPolicy { ObjectType* object; typedef OwnershipPolicy OwnershipPolicyType; typedef DestroyPolicy DestroyPolicyType; public: SmartPtr() : object(0) {} SmartPtr(ObjectType* ptr) : object(ptr) { OwnershipPolicyType::link(*this, ptr); } SmartPtr(const SmartPtr& ptr) : object(ptr.object) { OwnershipPolicyType::link(ptr, ptr.object); } template SmartPtr(const SmartPtr& ptr) : object(ptr.object) { OwnershipPolicyType::link(ptr, ptr.object); } ~SmartPtr() { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); } SmartPtr& operator= (const SmartPtr& ptr) { if (object != ptr.object) { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); object = ptr.object; OwnershipPolicyType::link(ptr, object); } return *this; } template SmartPtr& operator= (const SmartPtr& ptr) { if (object != ptr.object) { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); object = ptr.object; OwnershipPolicyType::link(ptr, object); } return *this; } SmartPtr& operator= (ObjectType* ptr) { if (object != ptr) { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); object = ptr; OwnershipPolicyType::link(*this, ptr); } return *this; } /// The object can be dereferenced like the held object ObjectType* operator->() const { return object; } /// The object can be dereferenced like the held object ObjectType& operator*() const { return *object; } bool operator! () const { return object == 0; } operator bool () const { return object != 0; } ObjectType* getPointer() const { return object; } }; template bool operator== (const SmartPtr& p1, const T2* p2) { return p1.getPointer() == p2; } template bool operator== (const T1* p1, const SmartPtr& p2) { return p1 == p2.getPointer(); } template bool operator== (const SmartPtr& p1, const SmartPtr& p2) { return p1.getPointer() == p2.getPointer(); } template bool operator!= (const SmartPtr& p1, const T2* p2) { return p1.getPointer() != p2; } template bool operator!= (const T1* p1, const SmartPtr& p2) { return p1 != p2.getPointer(); } template bool operator!= (const SmartPtr& p1, const SmartPtr& p2) { return p1.getPointer() != p2.getPointer(); } } #endif // CXXTOOLS_SMARTPTR_H cxxtools-3.0/include/cxxtools/date.h0000664000175000017500000002700113666667450014601 00000000000000/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DATE_H #define CXXTOOLS_DATE_H #include #include #include namespace cxxtools { class SerializationInfo; class InvalidDate : public std::invalid_argument { public: InvalidDate(); explicit InvalidDate(const std::string& what); ~InvalidDate() throw() {} }; void greg2jul(unsigned& jd, int y, int m, int d); void jul2greg(unsigned jd, int& y, int& m, int& d); /* Notes: - Henry F. Fliegel and Thomas C. Van Flandern, "A Machine Algorithm for Processing Calendar Dates". CACM, Vol. 11, No. 10, October 1968, pp 657. */ /** @brief %Date expressed in year, month, and day @ingroup DateTime */ class Date { public: enum Month { Jan = 1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec }; enum WeekDay { Sun = 0, Mon, Tue, Wed, Thu, Fri, Sat }; /** * @brief The number of days of an ordinary year. */ static const unsigned DaysPerYear = 365; /** * @brief The number of days of a leap year. */ static const unsigned DaysPerLeapYear = 366; /** * @brief The number of days of a January. */ static const unsigned DaysOfJan = 31; /** * @brief The number of days of a February. */ static const unsigned DaysOfFeb = 28; /** * @brief The number of days of a February in a leap year. */ static const unsigned DaysOfLeapFeb = 29; /** * @brief The number of days of a March. */ static const unsigned DaysOfMar = 31; /** * @brief The number of days of a April. */ static const unsigned DaysOfApr = 30; /** * @brief The number of days of a May. */ static const unsigned DaysOfMay = 31; /** * @brief The number of days of a June. */ static const unsigned DaysOfJun = 30; /** * @brief The number of days of a July. */ static const unsigned DaysOfJul = 31; /** * @brief The number of days of a August. */ static const unsigned DaysOfAug = 31; /** * @brief The number of days of a September. */ static const unsigned DaysOfSep = 30; /** * @brief The number of days of a October. */ static const unsigned DaysOfOct = 31; /** * @brief The number of days of a November. */ static const unsigned DaysOfNov = 30; /** * @brief The number of days of a December. */ static const unsigned DaysOfDec = 31; public: /** \brief Default constructor. The default constructed date is undefined. */ Date() : _julian(0) {} /** \brief create Date from string using format Valid format codes are: %Y 4 digit year %y 2 digit year %m month (1-12) %2m month (01-12) %O english monthname (Jan-Dec) %d day (1-31) %2d day (01-31) ? arbitrary character * skip non digit characters # skip word */ explicit Date(const std::string& d, const std::string& fmt = "%Y-%m-%d"); /** \brief Constructs a Date from given values Sets the date to a new year, month and day. InvalidDate is thrown if any of the values is out of range */ Date(int y, unsigned m, unsigned d) { greg2jul(_julian, y, m, d); } /** \brief Constructs a Date from a julian day */ explicit Date(unsigned julianDays) : _julian(julianDays) {} /** @brief Sets the Date to a julian day */ void setJulian(unsigned d) { _julian=d; } /** @brief Returns the Date as a julian day */ unsigned julian() const { return _julian; } /** \brief Sets the date to a year, month and day Sets the date to a new year, month and day. InvalidDate is thrown if any of the values is out of range */ void set(int year, unsigned month, unsigned day) { greg2jul(_julian, year, month, day); } /** @brief Gets the year, month and day */ void get(int& year, unsigned& month, unsigned& day) const; /** \brief Returns the day-part of the date. */ unsigned day() const; /** \brief Returns the month-part of the date. */ unsigned month() const; /** \brief Returns the year-part of the date. */ int year() const; /** @brief Return day of the week, starting with sunday (=0) */ unsigned dayOfWeek() const; /** @brief Returns the days of the month of the date */ unsigned daysInMonth() const; /** @brief Returns the day of the year */ unsigned dayOfYear() const; /** @brief Returns true if the date is in a leap year */ bool leapYear() const; /** @brief Assignment operator */ Date& operator=(const Date& date) { _julian = date._julian; return *this; } /** @brief Add days to the date */ Date& operator+=(int days) { _julian += days; return *this; } /** @brief Subtract days from the date */ Date& operator-=(int days) { _julian -= days; return *this; } /** @brief Increments the date by one day */ Date& operator++() { _julian++; return *this; } /** @brief Decrements the date by one day */ Date& operator--() { _julian--; return *this; } /** @brief Returns true if the dates are equal */ bool operator==(const Date& date) const { return _julian==date._julian; } /** @brief Returns true if the dates are not equal */ bool operator!=(const Date& date) const { return _julian!=date._julian; } /** @brief Less-than comparison operator */ bool operator<(const Date& date) const { return _julian(const Date& date) const { return _julian>date._julian; } /** @brief Greater-than-equal comparison operator */ bool operator>=(const Date& date) const { return _julian>=date._julian; } friend inline Date operator+(const Date& d, int days); friend inline Date operator-(const Date& d, int days); friend inline Date operator+(int days, const Date& d); friend inline Days operator-(const Date& a, const Date& b); /** \brief format Date into a string using a format string Valid format codes are: %d day (01-31) %1d day (1-31) %m month (01-12) %1m month (1-12) %O english monthname (Jan-Dec) %Y 4 digit year %y 2 digit year %w day of week (0-6 sunday=6) %W day of week (1-7 sunday=7) */ std::string toString(const std::string& fmt = "%Y-%m-%d") const; /** \brief Returns the date in ISO-format Converts the date in ISO-format (yyyy-mm-dd). \return Date as iso formated string. */ std::string toIsoString() const { return toString("%Y-%m-%d"); } /** \brief Interprets a string as a date-string in ISO-format Interprets a string as a date-string in ISO-format (yyyy-mm-dd) and returns a Date-object. When the string is not in ISO-format, an exception is thrown. \param s Iso formated date string. \return Date result \throw IllegalArgument */ static Date fromIsoString(const std::string& s) { return Date(s, "%Y-%m-%d"); } public: /** \brief Returns true if values describe a valid date */ static bool isValid(int y, int m, int d); /** @brief Returns true if the year is in a leap year */ static bool leapYear(int year); private: //! @internal unsigned _julian; }; void operator >>=(const SerializationInfo& si, Date& date); void operator <<=(SerializationInfo& si, const Date& date); inline void Date::get(int& y, unsigned& m, unsigned& d) const { int mon, day; jul2greg(_julian, y, mon, day); m = mon; d = day; } inline bool Date::leapYear(int y) { return ((y%4==0) && (y%100!=0)) || (y%400==0); } inline unsigned Date::day() const { int d,m,y; jul2greg(_julian, y ,m, d); return d; } inline unsigned Date::month() const { int d,m,y; jul2greg(_julian, y, m, d); return m; } inline int Date::year() const { int d,m,y; jul2greg(_julian, y, m, d); return y; } inline unsigned Date::dayOfWeek() const { return (_julian+1) % 7; } inline unsigned Date::daysInMonth() const { static const unsigned char monthDays[13]= { 0,31,28,31,30,31,30,31,31,30,31,30,31 }; int y, m, d; jul2greg(_julian, y, m, d); if( m==2 && leapYear(y) ) return 29; return monthDays[m]; } inline unsigned Date::dayOfYear() const { int y,m,d; unsigned jd; jul2greg(_julian,y,m,d); greg2jul(jd,y,1,1); return _julian-jd+1; } inline bool Date::leapYear() const { int d,m,y; jul2greg(_julian,y,m,d); return leapYear(y); } inline Date operator+(const Date& d, int days) { return Date(d._julian + days); } inline Date operator-(const Date& d, int days) { return Date(d._julian - days); } inline Date operator+(int days, const Date& d) { return Date(days + d._julian); } inline Days operator-(const Date& a, const Date& b) { return Days(a._julian - b._julian); } } #endif cxxtools-3.0/include/cxxtools/delegate.tpp0000664000175000017500000012104213644433072015775 00000000000000// BEGIN_Delegate 10 /** A Delegate is essentially a Signal with only a single target slot. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return this->call(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } }; /** DelegateSlot wraps Deletegate object so that they can behave like Slots. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class DelegateSlot : public BasicSlot { public: /** Wraps the given Delegate. */ DelegateSlot(Delegate& delegate) : _method( delegate, &Delegate::call ) {} /** Creates a copy of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new DelegateSlot(*this); } /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_method; } virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } virtual bool equals(const Slot& slot) const { const DelegateSlot* ds = dynamic_cast(&slot); return ds ? (_method == ds->_method) : false; } private: mutable ConstMethod, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10 > _method; }; /** Creates and returns a DelegateSlot for the given Delegate. */ template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> DelegateSlot slot( Delegate& delegate ) { return DelegateSlot( delegate ); } /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect( slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 9 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return this->call(a1,a2,a3,a4,a5,a6,a7,a8,a9); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect( slot ); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 8 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7,a8); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7,a8); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return this->call(a1,a2,a3,a4,a5,a6,a7,a8); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 7 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return this->call(a1,a2,a3,a4,a5,a6,a7); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 6 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return this->call(a1,a2,a3,a4,a5,a6); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 5 template < typename R,class A1, class A2, class A3, class A4, class A5> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return this->call(a1,a2,a3,a4,a5); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 4 template < typename R,class A1, class A2, class A3, class A4> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return this->call(a1,a2,a3,a4); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 3 template < typename R,class A1, class A2, class A3> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3) const { return this->call(a1,a2,a3); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 2 template < typename R,class A1, class A2> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2) const { return this->call(a1,a2); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 1 template < typename R,class A1> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1); } /** Identical to call(...). */ R operator()(A1 a1) const { return this->call(a1); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 0 template < typename R> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call() const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke() const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(); } /** Identical to call(...). */ R operator()() const { return this->call(); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)()) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)()) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)() const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate cxxtools-3.0/include/cxxtools/iso8859_9codec.h0000664000175000017500000000412213644433072016224 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_9CODEC_H #define CXXTOOLS_ISO8859_9CODEC_H #include namespace cxxtools { class Iso8859_9Codec : public CharMapCodec { public: explicit Iso8859_9Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/trim.h0000664000175000017500000000725713644433072014635 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TRIM_H #define CXXTOOLS_TRIM_H #include namespace cxxtools { /// Removes white space from left of a string. Returns the modified string. template StringType ltrim(const StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type p = s.find_first_not_of(ws); return p == StringType::npos ? StringType() : s.substr(p); } /// Removes white space from right of a string. Returns the modified string. template StringType rtrim(const StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type p = s.find_last_not_of(ws); return p == StringType::npos ? StringType() : s.substr(0, p + 1); } /// Removes white space from left and right of a string. Returns the modified string. template StringType trim(const StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type pl = s.find_first_not_of(ws); if (pl == StringType::npos) return StringType(); typename StringType::size_type pr = s.find_last_not_of(ws); return s.substr(pl, pr - pl + 1); } /// Removes white space from left of a string. Returns the modified string. /// The passed string is modified. template StringType& ltrimi(StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type p = s.find_first_not_of(ws); s.erase(0, p); return s; } /// Removes white space from right of a string. Returns the modified string. /// The passed string is modified. template StringType& rtrimi(StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type p = s.find_last_not_of(ws); if (p == StringType::npos) s.clear(); else s.erase(p + 1); return s; } /// Removes white space from left and right of a string. Returns the modified string. /// The passed string is modified. template StringType& trimi(StringType& s, const StringType& ws = StringType(" \t\r\n")) { return ltrimi(rtrimi(s, ws), ws); } } #endif // CXXTOOLS_TRIM_H cxxtools-3.0/include/cxxtools/ini.h0000664000175000017500000001110013644433072014417 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_INI_H #define CXXTOOLS_INI_H #include #include #include namespace cxxtools { /** Wrapper object to easily print serializable objects as ini to a output stream. IniOObject is a little wrapper which makes it easy to output serializable objects into a ostream. For this the IniOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::ostream, which prints the object in ini format. */ template class IniOObject { const ObjectType& _constObject; public: /// Constructor. Needs the wrapped object. Optionally a flag can be /// passed whether the ini should be nicely formatted. explicit IniOObject(const ObjectType& object) : _constObject(object) { } const ObjectType& object() const { return _constObject; } }; /// The output operator for IniOObject. It does the actual work. template std::ostream& operator<< (std::ostream& out, const IniOObject& object) { try { IniSerializer serializer(out); serializer.serialize(object.object()); } catch (const std::exception&) { out.setstate(std::ios::failbit); throw; } return out; } /// Function, which creates a IniOObject. /// This makes the syntactic sugar perfect. See the example at IniOObject /// for its use. template IniOObject Ini(const ObjectType& object) { return IniOObject(object); } /** Wrapper object to easily read objects as ini from a input stream. IniIObject is a little wrapper which makes it easy to read objects from a istream. For this the IniIObject expects a reference to the wrapped object and has a input operator for a std::istream, or actually a std::basic_istream, which reads the object from ini format. */ template class IniIOObject : public IniOObject { ObjectType& _object; public: explicit IniIOObject(ObjectType& object) : IniOObject(object), _object(object) { } ObjectType& object() { return _object; } }; /// The input operator for IniIOObject. It does the actual work. template std::basic_istream& operator>> (std::basic_istream& in, IniIOObject object) { try { IniDeserializer deserializer(in); deserializer.deserialize(object.object()); } catch (const std::exception&) { in.setstate(std::ios::failbit); throw; } return in; } /// Creates a IniIObject with a reference to a deserializable object. /// See IniIObject for a usage example. template IniIOObject Ini(ObjectType& object) { return IniIOObject(object); } } #endif // CXXTOOLS_INI_H cxxtools-3.0/include/cxxtools/iso8859_10codec.h0000664000175000017500000000413213644433072016275 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_10CODEC_H #define CXXTOOLS_ISO8859_10CODEC_H #include namespace cxxtools { class Iso8859_10Codec : public CharMapCodec { public: explicit Iso8859_10Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/threadpool.h0000664000175000017500000001247013644433072016014 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_THREADPOOL_H #define CXXTOOLS_THREADPOOL_H #include #include namespace cxxtools { class ThreadPoolImpl; class ThreadPool { ThreadPool(const ThreadPool&) { } ThreadPool& operator=(const ThreadPool&) { return *this; } public: /** The Future class monitors the state of a job, which runs in the thread pool. When a job is run on the thread pool, a future is returned. The user can wait for the future to be finished. Futures can be copied, in which case all instances point to the same instance. */ class Future { friend class ThreadPoolImpl; class FutureImpl; FutureImpl* _impl; Future(FutureImpl* impl); public: /// A Future is default constructable. Future() : _impl(0) { } /// A Future is copyable. Future(const Future& f); /// A Future is assignable. Future& operator=(const Future& f); ~Future(); /** Wait up to timeout seconds for termination. Wait up to timeout seconds for termination. Return true when job was finished before timeout. */ bool wait(Seconds timeout = -1) const; /// Returns true, when the job is waiting to be run on a thread. bool isWaiting() const; /// Returns true, when the job is currently running on a thread. bool isRunning() const; /** Returns true, when the job is finished. Finished may be either successfully finished, finished by exception or canceled because the thread pool is stopped before the job started to run. */ bool isFinished() const; /** Returns true, when the job is canceled. Canceled means, that the thread pool is stopped before the job started. */ bool isCanceled() const; /// Returns true, when the job was finished with exceptoin. bool isFailed() const; }; /** @brief Creates a thread pool structure. When the argument \a doStart is set to true (which is the default), the threads are started. */ explicit ThreadPool(unsigned size, bool doStart = true); /** @brief Destroys a thread pool structure. Before destruction all jobs are processed and the threads are stopped. */ ~ThreadPool(); /** @brief Explict start of the thread pool. */ void start(); /** @brief Stops the thread of the thread pool. All threads of this pool are stopped. The current job is finished. Remaining jobs are discarded, when cancel is set. Otherwise the threads stop, when the queue is empty. */ void stop(bool cancel = false); /** @brief Schedules a task to be processed. The task is processed by the next available thread. */ Future schedule(const Callable& cb); /** @brief Returns true, if the threadpool is in running state. */ bool running() const; /** @brief Returns true, if the threadpool is in stopped state. */ bool stopped() const; private: ThreadPoolImpl* _impl; }; } #endif // CXXTOOLS_THREADPOOL_H cxxtools-3.0/include/cxxtools/datetime.h0000664000175000017500000003177713644433072015462 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DATETIME_H #define CXXTOOLS_DATETIME_H #include #include #include namespace cxxtools { class SerializationInfo; class LocalDateTime; class UtcDateTime; /** @brief Combined %Date and %Time value @ingroup DateTime */ class DateTime { public: DateTime() { } /** \brief create DateTime from string using format Valid format codes are: %Y 4 digit year %y 2 digit year %m month (1-12) %2m month (01-12) %O english monthname (Jan-Dec) %d day (1-31) %2d day (01-31) %H hours (0-23) %2H hours (00-23) %I hours (0-11) %2I hours (00-11) %M minutes (0-59) %2M minutes (00-59) %S seconds (0-59) %2S seconds (00-59) %j fractional seconds (1-6 digits, optionally leading '.') %J fractional seconds (1-6 digits, with leading '.') %K milliseconds (3 digits, with leading '.') %k milliseconds (3 digits) %U microseconds (6 digits, with leading '.') %u microseconds (6 digits) %p AM/PM ? arbitrary character * skip non digit characters # skip word */ explicit DateTime(const std::string& d, const std::string& fmt = "%Y-%m-%d %H:%M:%S%j"); DateTime(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec = 0, unsigned usec = 0) : _date(year, month, day) , _time(hour, minute, second, msec, usec) { } DateTime(const Date& date, const Time& time) : _date(date), _time(time) { } /** @brief Creates a DateTime object relative to the Unix epoch. The DateTime will be relative to the unix epoch (Jan 1st 1970) by the milli seconds specified by \a msecsSinceEpoch. The construction does not take care of any time zones. I.e. the milliseconds will be treated as if they were in the same time zone as the reference (January 1st 1970). Thus specifying a "time zoned" millisecond value will lead to a "time zoned" DateTime. And accordingly a "GMT" millisecond value will lead to a "GMT" DateTime. */ static DateTime fromMSecsSinceEpoch(cxxtools::Milliseconds sinceEpoch) { static const DateTime dt(1970, 1, 1, 0, 0, 0); return dt + sinceEpoch; } /// Returns the GMT time static UtcDateTime gmtime(); /// Returns the local time static LocalDateTime localtime(); /// Sets the date and time. void set(int year, unsigned month, unsigned day, unsigned hour, unsigned min, unsigned sec, unsigned msec = 0, unsigned usec = 0); /// Returns the components of the date time. void get(int& year, unsigned& month, unsigned& day, unsigned& hour, unsigned& min, unsigned& sec, unsigned& msec) const; /// Returns the components of the date time. void get(int& year, unsigned& month, unsigned& day, unsigned& hour, unsigned& min, unsigned& sec, unsigned& msec, unsigned& usec) const; /// Returns the date part of the DateTime object. const Date& date() const { return _date; } /// Set the date part and keeps the time of the DateTime object. DateTime& setDate(const Date& date) { _date = date; return *this; } /// Returns the time part of the DateTime object. const Time& time() const { return _time; } /// Set the time part and keeps the date of the DateTime object. DateTime& setTime(const Time& time) { _time = time; return *this; } /** @brief Returns the day part of the date. */ unsigned day() const { return date().day(); } /** @brief Returns the month part of the date. */ unsigned month() const { return date().month(); } /** @brief Returns the year part of the date. */ int year() const { return date().year(); } /** @brief Return day of the week, starting with sunday (=0) */ unsigned dayOfWeek() const { return date().dayOfWeek(); } /** \brief Returns the hour part of the Time. */ unsigned hour() const { return time().hour(); } /** \brief Returns the minute part of the Time. */ unsigned minute() const { return time().minute(); } /** \brief Returns the second part of the Time. */ unsigned second() const { return time().second(); } /** \brief Returns the millisecond part of the Time. */ unsigned msec() const { return time().msec(); } /** @brief Returns the milliseconds relative to the Unix epoch. The calculation does currently not take care of any time zones. I.e. the milliseconds will be calculated as if they were in the same time zone as the reference (January 1st 1970). Thus calling this API on a "time zoned" DateTime will lead to a "time zoned" millisecond value. And accordingly calling this API on a "GMT" DateTime will lead to a "GMT" millisecond value. */ Milliseconds msecsSinceEpoch() const; /** \brief format Date into a string using a format string Valid format codes are: %d day (01-31) %1d day (1-31) %m month (01-12) %1m month (1-12) %O english monthname (Jan-Dec) %Y 4 digit year %y 2 digit year %w day of week (0-6 sunday=6) %W day of week (1-7 sunday=7) %N day of week as english abbrivation (Mon-Sun) %H hours (00-23) %1H hours (0-23) %I hours (00-11) %1I hours (0-11) %M minutes (00-59) %1M minutes (0-59) %S seconds (00-59) %1S seconds (0-59) %j fractional seconds (1-6 digits, optionally leading '.') %J fractional seconds (1-6 digits, with leading '.') %K milliseconds (3 digits, with leading '.') %k milliseconds (3 digits) %U microseconds (6 digits, with leading '.') %u microseconds (6 digits) %p am/pm %P AM/PM */ std::string toString(const std::string& fmt = "%Y-%m-%d %H:%M:%S%j") const; std::string toIsoString() const { return toString(); } static DateTime fromIsoString(const std::string& s) { return DateTime(s); } static bool isValid(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec = 0); bool operator==(const DateTime& rhs) const { return _date == rhs._date && _time == rhs._time ; } bool operator!=(const DateTime& rhs) const { return !operator==(rhs); } /** @brief Assignment by sum operator */ DateTime& operator+=(const Timespan& ts); /** @brief Assignment by difference operator */ DateTime& operator-=(const Timespan& ts) { return operator+= (-ts); } friend Timespan operator-(const DateTime& first, const DateTime& second); friend DateTime operator+(const DateTime& dt, const Timespan& ts); friend DateTime operator-(const DateTime& dt, const Timespan& ts); bool operator< (const DateTime& dt) const { return _date < dt._date || (_date == dt._date && _time < dt._time); } bool operator<= (const DateTime& dt) const { return _date < dt._date || (_date == dt._date && _time <= dt._time); } bool operator> (const DateTime& dt) const { return _date > dt._date || (_date == dt._date && _time > dt._time); } bool operator>= (const DateTime& dt) const { return _date > dt._date || (_date == dt._date && _time >= dt._time); } private: Date _date; Time _time; }; void operator >>=(const SerializationInfo& si, DateTime& dt); void operator <<=(SerializationInfo& si, const DateTime& dt); /// Same ad DateTime - just a separate type for local date time better type safety class LocalDateTime : public DateTime { public: LocalDateTime() { } explicit LocalDateTime(const std::string& d, const std::string& fmt = "%Y-%m-%d %H:%M:%S%j") : DateTime(d, fmt) { } LocalDateTime(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec = 0, unsigned usec = 0) : DateTime(year, month, day, hour, minute, second, msec, usec) { } LocalDateTime(const Date& date, const Time& time) : DateTime(date, time) { } explicit LocalDateTime(const DateTime& dt) : DateTime(dt) { } }; /// Same ad DateTime - just a separate type for utc date time better type safety class UtcDateTime : public DateTime { public: UtcDateTime() { } explicit UtcDateTime(const std::string& d, const std::string& fmt = "%Y-%m-%d %H:%M:%S%j") : DateTime(d, fmt) { } UtcDateTime(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec = 0, unsigned usec = 0) : DateTime(year, month, day, hour, minute, second, msec, usec) { } UtcDateTime(const Date& date, const Time& time) : DateTime(date, time) { } explicit UtcDateTime(const DateTime& dt) : DateTime(dt) { } }; inline void operator>>= (const SerializationInfo& si, LocalDateTime& dt) { si >>= static_cast(dt); } inline void operator<<= (SerializationInfo& si, const LocalDateTime& dt) { si <<= static_cast(dt); } inline void operator>>= (const SerializationInfo& si, UtcDateTime& dt) { si >>= static_cast(dt); } inline void operator<<= (SerializationInfo& si, const UtcDateTime& dt) { si <<= static_cast(dt); } inline void DateTime::set(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec, unsigned usec) { _date.set(year, month, day); _time.set(hour, minute, second, msec, usec); } inline void DateTime::get(int& y, unsigned& month, unsigned& d, unsigned& h, unsigned& min, unsigned& s, unsigned& ms) const { _date.get(y, month, d); _time.get(h, min, s, ms); } inline void DateTime::get(int& y, unsigned& month, unsigned& d, unsigned& h, unsigned& min, unsigned& s, unsigned& ms, unsigned& usec) const { _date.get(y, month, d); _time.get(h, min, s, ms, usec); } inline bool DateTime::isValid(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec) { return Date::isValid(year, month, day) && Time::isValid(hour, minute, second, msec); } } #endif // CXXTOOLS_DATETIME_H cxxtools-3.0/include/cxxtools/selectable.h0000664000175000017500000000724013644433072015755 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SELECTABLE_H #define CXXTOOLS_SELECTABLE_H #include #include #include namespace cxxtools { class SelectableImpl; class Selectable { #if __cplusplus >= 201103L Selectable(const Selectable&) = delete; Selectable& operator=(const Selectable&)= delete; #else Selectable(const Selectable&) { } Selectable& operator=(const Selectable&) { return *this; } #endif public: static const std::size_t WaitInfinite = Selector::WaitInfinite; enum State { Disabled = 0, Idle = 1, Busy = 2, Avail = 3 }; public: //! @brief Destructor virtual ~Selectable(); /// Sets the selector for this device. void setSelector(SelectorBase* parent); /// For convenience the application may pass a reference to a selector. void setSelector(SelectorBase& parent) { setSelector(&parent); } SelectorBase* selector() const; //! @brief Closes the I/O device /*! Frees any resources associated with this object, like I/O handles. */ void close(); bool wait(Milliseconds msecs = WaitInfinite); //! @brief Test if the I/O device object is enabled /*! Test if the I/O device object is enabled i.e. open and ready to perform I/O operations \return true if the I/O device is usable, false otherwise. */ bool enabled() const; bool idle() const; bool busy() const; bool avail() const; virtual SelectableImpl& simpl() = 0; protected: //! @brief Default Constructor Selectable(); //! @brief Sets or unsets the device enabled void setEnabled(bool isEnabled); //TODO: tell Selector more specifically what changed // add onReinit() to Selector: // pass old state as second arg with onChanged() void setState(State state); //! @brief Closes the Selector virtual void onClose(); virtual bool onWait(Timespan timeout); virtual void onAttach(SelectorBase&) { } virtual void onDetach(SelectorBase&) { } private: SelectorBase* _parent; State _state; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/iso8859_5codec.h0000664000175000017500000000412213644433072016220 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_5CODEC_H #define CXXTOOLS_ISO8859_5CODEC_H #include namespace cxxtools { class Iso8859_5Codec : public CharMapCodec { public: explicit Iso8859_5Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/iso8859_16codec.h0000664000175000017500000000413213644433072016303 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_16CODEC_H #define CXXTOOLS_ISO8859_16CODEC_H #include namespace cxxtools { class Iso8859_16Codec : public CharMapCodec { public: explicit Iso8859_16Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/iso8859_15codec.h0000664000175000017500000000413213644433072016302 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_15CODEC_H #define CXXTOOLS_ISO8859_15CODEC_H #include namespace cxxtools { class Iso8859_15Codec : public CharMapCodec { public: explicit Iso8859_15Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/remoteclient.h0000664000175000017500000000520013644433072016336 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTECLIENT_H #define CXXTOOLS_REMOTECLIENT_H #include #include namespace cxxtools { class IComposer; class IDecomposer; class IRemoteProcedure; class SelectorBase; /// Base class for rpc client. class RemoteClient { public: static const std::size_t WaitInfinite = static_cast(-1); virtual ~RemoteClient() { } virtual void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) = 0; virtual void endCall() = 0; virtual void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) = 0; virtual const IRemoteProcedure* activeProcedure() const = 0; virtual void cancel() = 0; virtual void wait(Milliseconds msecs = WaitInfinite) = 0; virtual Milliseconds timeout() const = 0; virtual void timeout(Milliseconds t) = 0; virtual Milliseconds connectTimeout() const = 0; virtual void connectTimeout(Milliseconds t) = 0; virtual void setSelector(SelectorBase* selector) = 0; void setSelector(SelectorBase& selector) { setSelector(&selector); } }; } #endif // CXXTOOLS_REMOTECLIENT_H cxxtools-3.0/include/cxxtools/unit/0000775000175000017500000000000013672344760014543 500000000000000cxxtools-3.0/include/cxxtools/unit/testmethod.h0000664000175000017500000001010713644433072017005 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTMETHOD_H #define CXXTOOLS_UNIT_TESTMETHOD_H #include #include #include namespace cxxtools { class SerializationInfo; namespace unit { class TestMethod : public cxxtools::unit::Test { public: TestMethod(const std::string& name) : cxxtools::unit::Test(name) {} virtual ~TestMethod() {} virtual void run() {} virtual void exec(const SerializationInfo* si, unsigned argCount) = 0; }; //! @cond internal template < class C, typename A1 = cxxtools::Void, typename A2 = cxxtools::Void, typename A3 = cxxtools::Void, typename A4 = cxxtools::Void, typename A5 = cxxtools::Void, typename A6 = cxxtools::Void, typename A7 = cxxtools::Void, typename A8 = cxxtools::Void > class BasicTestMethod : public cxxtools::Method , public TestMethod { public: typedef C ClassT; typedef void (C::*MemFuncT)(A1, A2, A3, A4, A5, A6, A7, A8); public: BasicTestMethod(const std::string& name, C& object, MemFuncT ptr) : cxxtools::Method(object, ptr) , TestMethod(name) {} void exec(const SerializationInfo* args, unsigned argCount) { throw std::logic_error("SerializationInfo not implemented"); } virtual void run() {} }; template < class C > class BasicTestMethod : public cxxtools::Method , public TestMethod { public: typedef C ClassT; typedef void (C::*MemFuncT)(); public: BasicTestMethod(const std::string& name, C& object, MemFuncT ptr) : cxxtools::Method(object, ptr) , TestMethod(name) {} void exec(const SerializationInfo* /*si*/, unsigned /*argCount*/) { cxxtools::Method::call(); } virtual void run() {} }; //! @endcond internal } // namespace unit } // namespace cxxtools #endif // for header cxxtools-3.0/include/cxxtools/unit/testsuite.h0000664000175000017500000002127513644433072016666 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTSUITE_H #define CXXTOOLS_UNIT_TESTSUITE_H #include #include #include #include #include #include namespace cxxtools { class SerializationInfo; namespace unit { /** @brief Protocol and data driven testing @ingroup UnitTests The TestSuite is used to implement protocol and data driven tests. It inherits its ability to register methods and properties from %Reflectable. The implementor is supposed to write and register the required test methods on construction. @code class MyTest : public TestSuite { public: MyTest() : TestSuite("MyTest") { this->registerMethod("test1", *this, &MyTest::test1); } void test1(); }; @endcode Once the test is written it can be registered to an application by using the RegisterTest class template. The default protocol will run each registered test method when the test is run. Before each test method setUp is called and tearDown after each test. The TestProtocol can be replaced with a customised one and reflection can be used to call any method multiple times with the required data. */ class TestSuite : public Test , public TestFixture { private: class Context : public TestContext { public: Context(TestFixture& fixture, TestMethod& test, const SerializationInfo* args, unsigned argCount) : TestContext(fixture, test) , _test(test) , _args(args) , _argCount(argCount) {} virtual ~Context() {} protected: virtual void exec() { _test.exec(_args, _argCount); } private: TestMethod& _test; const SerializationInfo* _args; unsigned _argCount; }; public: /** @brief Construct by name and protocol Constructs a %TestCase with the passed name and optionally a custom protocol. The protocol is not owned by the TestSuite, but can be owned by the derived class. @param name Name of the test @param protocol Protocol for the test. */ explicit TestSuite(const std::string& name, TestProtocol& protocol = TestSuite::defaultProtocol); ~TestSuite(); //! @brief TODO: rename setParameter virtual void setParameter(const std::string& name, const cxxtools::SerializationInfo& value); /** @brief Sets the protocol. @param protocol Protocol for the test */ void setProtocol(TestProtocol* protocol); /** \brief Set up conText before running a test. This function is called before each registered tester function is invoked. It is meant to initialize any required resources. */ virtual void setUp(); /** \brief Clean up after the test run. This function is called after each registered tester function is invoked. It is meant to remove any resources previously initialized in TestSuite::setUp. */ virtual void tearDown(); /** @brief Runs the test suite The TestProtocol associated with the test will be executed. The default protocol will simply call all registered tests. */ virtual void run(); /** @brief Runs a registered test A test method will be called by name and the given arguments are passe to it just like when the reflection API is used. The method 'setUp' will be called before, and the method tearDown after the test. Signals inherited from unit::Test are sent appropriatly. @param name Name of the method to be run @param args Arguments to invoke the method */ void runTest( const std::string& name, const SerializationInfo* args = 0, size_t argCount = 0); void runAll(); protected: template void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)() ) { cxxtools::unit::TestMethod* test = new BasicTestMethod(this->name() + "::" + name, parent, method); this->registerTest(test); } template void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod(this->name() + "::" + name, parent, method); this->registerTest(test); } template void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod(this->name() + "::" + name, parent, method); this->registerTest(test); } template void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2, A3) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod(this->name() + "::" + name, parent, method); this->registerTest(test); } template void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2, A3, A4) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod(this->name() + "::" + name, parent, method); this->registerTest(test); } template void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2, A3, A4, A5) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod(this->name() + "::" + name, parent, method); this->registerTest(test); } private: void registerTest(TestMethod* test); TestMethod* findTest(const std::string& name); /** @brief The associated test protocol */ TestProtocol* _protocol; typedef std::vector > Tests; Tests _tests; public: static TestProtocol defaultProtocol; }; } // namespace unit } // namespace cxxtools #endif // for header cxxtools-3.0/include/cxxtools/unit/testcontext.h0000664000175000017500000000370713644433072017221 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTCONTEXT_H #define CXXTOOLS_UNIT_TESTCONTEXT_H #include #include namespace cxxtools { namespace unit { class Test; class TestFixture; class TestContext { public: virtual ~TestContext(); std::string testName() const; void run(); protected: TestContext(TestFixture& fixture, Test& test); virtual void exec() = 0; private: TestFixture& _fixture; Test& _test; bool _setUp; }; } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/assertion.h0000664000175000017500000001460613644433072016644 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ASSERTION_H #define CXXTOOLS_ASSERTION_H #include "cxxtools/sourceinfo.h" #include #include #include namespace cxxtools { namespace unit { /** @brief %Test %Assertion exception @ingroup UnitTests Assertions are modeled as an exception type, which is thrown by Unit tests when an assertion has failed. This class implements std::exception and overrides std::exception::what() to return an error message Besides the error message, Assertions can provide information where the exception was raised in the source code through a SourceInfo object. It is recommended to use the CXXTOOLS_UNIT_ASSERT for easy creation from a source info object. @code void myTest() { int ten = 5 + 5; CXXTOOLS_UNIT_ASSERT(ten == 10) } @endcode */ class Assertion { public: /** @brief Construct from a message and source info. Constructs a assertion exception from a message string and a source info object that describes where the assertion failed. Use the CXXTOOLS_UNIT_ASSERT macro instead of this constructor. @param what Error message @param si Info where the assertion failed */ Assertion(const std::string& what, const SourceInfo& si); const SourceInfo& sourceInfo() const; const char* what() const { return _what.c_str(); } private: SourceInfo _sourceInfo; std::string _what; }; class Skip { }; #define CXXTOOLS_UNIT_ASSERT(cond) \ do { \ if( !(cond) ) \ throw cxxtools::unit::Assertion(#cond, CXXTOOLS_SOURCEINFO); \ } while (false) #define CXXTOOLS_UNIT_ASSERT_MSG(cond, what) \ do { \ if( !(cond) ) \ { \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << what; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } \ } while (false) //! @internal template void assertEquals(const char* cond1, const A& value1, const char* cond2, const B& value2, const SourceInfo& si) { if ( ! (value1 == value2) ) { std::ostringstream _cxxtools_msg; _cxxtools_msg << "not equal:\n\tvalue1 (" << cond1 << ")=\n\t\t<" << value1 << ">\n\tvalue2 (" << cond2 << ")=\n\t\t<" << value2 << '>'; throw cxxtools::unit::Assertion(_cxxtools_msg.str(), si); } } //! @internal template void assertEquals(const char* cond1, const A& value1, const char* cond2, const B& value2, C outputFn, const SourceInfo& si) { if ( ! (value1 == value2) ) { std::ostringstream _cxxtools_msg; _cxxtools_msg << "not equal:\n\tvalue1 (" << cond1 << ")=\n\t\t<" << outputFn(value1) << ">\n\tvalue2 (" << cond2 << ")=\n\t\t<" << outputFn(value2) << '>'; throw cxxtools::unit::Assertion(_cxxtools_msg.str(), si); } } #define CXXTOOLS_UNIT_ASSERT_EQUALS(value1, value2) \ cxxtools::unit::assertEquals(#value1, (value1), #value2, (value2), CXXTOOLS_SOURCEINFO) #define CXXTOOLS_UNIT_ASSERT_EQUALS2(value1, value2, outputFn) \ cxxtools::unit::assertEquals(#value1, (value1), #value2, (value2), outputFn, CXXTOOLS_SOURCEINFO) #define CXXTOOLS_UNIT_ASSERT_THROW(cond, EX) \ do { \ try \ { \ cond; \ \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << "exception of type " #EX " expected in " #cond; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } \ catch(const EX &) \ {} \ } while (false) #define CXXTOOLS_UNIT_ASSERT_NOTHROW(cond) \ do { \ try { \ \ cond; \ } \ catch(const std::exception& e) \ { \ throw cxxtools::unit::Assertion( \ std::string("unexpected exception of type ") + typeid(e).name() + ": " + e.what(), \ CXXTOOLS_SOURCEINFO); \ } \ catch(const cxxtools::unit::Assertion&) \ { \ throw; \ } \ catch(...) \ { \ throw cxxtools::unit::Assertion("unexpected exception." , CXXTOOLS_SOURCEINFO); \ } \ } while (false) #define CXXTOOLS_UNIT_SKIP() throw cxxtools::unit::Skip() #define CXXTOOLS_UNIT_FAIL(what) \ do { \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << what; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } while (false) } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/testprotocol.h0000664000175000017500000000520413644433072017370 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTPROTOCOL_H #define CXXTOOLS_UNIT_TESTPROTOCOL_H #include #include namespace cxxtools { namespace unit { class TestSuite; /** @brief Protocol for test suites @ingroup UnitTests This is the base class for protocols that can be used to run a test suite. The default implementation will simply run each registered test of the test suite without passing it any data. Implementors need to override the method TestProtocol::run. */ class TestProtocol { public: /** @brief Destructor */ virtual ~TestProtocol() {} /** @brief Executes the protocol This method can be overriden to specify a custom protocol for a test suite. The default implementation will simply call each registered method of the test suite. Implementors will most likely call TestSuite::runTest to resolve a test method by name and pass it required arguments. @param test The test suite to apply the protocol */ virtual void run(TestSuite& test); }; } // namespace onit } // namespace cxxtools #endif // for header cxxtools-3.0/include/cxxtools/unit/test.h0000664000175000017500000001276313644433072015616 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TEST_H #define CXXTOOLS_UNIT_TEST_H #include #include #include #include namespace cxxtools { namespace unit { class TestContext; /** @brief Test base class @ingroup UnitTests This is the base class for all types of tests that can be registered and run in a test application. It provides a virtual method run that is overriden by the derived classes and signals to inform about events that occur while the test is run. */ class Test : public Connectable { #if __cplusplus >= 201103L Test(const Test&) = delete; Test& operator=(const Test&) = delete; #else Test(const Test&) { } Test& operator=(const Test&) { return *this; } #endif public: /** @brief Destructor */ virtual ~Test() { } /** @brief Runs the test Derived test classes are supposed to implement this method to run the test procedure. A derived class should send the 'started' signal at the begin of the test and send the 'finished' signal at the end of the test. If the test was successful, the 'success' signal is sent, otheriwse one of the signals indicating a failrue. In case of a failed assertion, the signal 'assertion' is sent, if a regular std::exception was the cause of the error the signal 'exception' is sent and and the signal 'error' indicates an unknown exception or error. This method should not propagate any exceptions */ virtual void run() = 0; const std::string& name() const; /** @brief Reports the start of a test */ void reportStart(const TestContext& ctx); /** @brief Finished notification This signal is sent when the test finished. It does not indicate that the test was successful. */ void reportFinish(const TestContext& ctx); /** @brief Success notification This signal is sent when the test was successful. */ void reportSuccess(const TestContext& ctx); /** @brief Skip notification This signal is sent when the test was skipped. */ void reportSkip(const TestContext& ctx); /** @brief Assertion notification This signal is sent when a assertion failed. */ void reportAssertion(const TestContext& ctx, const Assertion& ass); /** @brief Exception notification This signal is sent when a regular std::exception occured. */ void reportException(const TestContext& ctx, const std::exception& ex); /** @brief Error notification This signal is sent when an unknown error occured. */ void reportError(const TestContext& ctx); /** @brief Message notification This signal can be sent to report informational messages. */ void reportMessage(const std::string& msg); void setParent(Test* test); Test* parent(); const Test* parent() const; /** @brief Add reporter for test events Adds the reporter \a r to report test events. The caller owns the reporter and must make sure it lives as long as the test. */ void attachReporter(Reporter& r); void detachReporter(Reporter& r); protected: /** @brief Construct a test by name @param name Name of the test */ explicit Test(const std::string& name) : _name(name) , _parent(0) { } private: std::string _name; Test* _parent; std::list _reporter; }; } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/testfixture.h0000664000175000017500000000417113644433072017217 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Drner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTFIXTURE_H #define CXXTOOLS_UNIT_TESTFIXTURE_H namespace cxxtools { namespace unit { class TestFixture { public: virtual ~TestFixture() {} /** \brief Set up conText before running a test. This function is called before each registered tester function is invoked. It is meant to initialize any required resources. */ virtual void setUp() {} /** \brief Clean up after the test run. This function is called after each registered tester function is invoked. It is meant to remove any resources previously initialized in TestCase::setUp. */ virtual void tearDown() {} }; } // namespace init } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/registertest.h0000664000175000017500000000451113644433072017353 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_REGISTERTEST_H #define CXXTOOLS_UNIT_REGISTERTEST_H #include namespace cxxtools { namespace unit { /** @param TestT The type of test to register */ template /** @brief Registers tests to an application Tests can be registered easily with the RegisterTest<> class template to an Unit::Application at program initialisation. A typical example looks like this: @code class MyTest : public Unit::TestCase { ... }; RegisterTest _registerMyTest; @endcode The constructor of the RegisterTest class template will register an instance of its template parameter to the application. */ struct RegisterTest { RegisterTest() { static TestT test; Application::staticRegisterTest(test); } }; } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/application.h0000664000175000017500000001274713644433072017144 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_APPLICATION_H #define CXXTOOLS_UNIT_APPLICATION_H #include #include #include #include namespace cxxtools { namespace unit { /** @brief Run registered tests The application class serves as an environment for a number of tests to be run. An application object is usually created in the main loop of a program and the return value of Unit::Application::run returned. A reporter can be set for the application to process test events. Reporters can be made to print information to the console or write XML logs. A typical example may look like this: @code int main() { cxxtools::Unit::Reporter reporter; cxxtools::Unit::Application app; app.setReporter(reporter); return app.run(); } @endcode The TestMain.h include already defines a main loop with an application for the common use case. */ class Application : public Test { public: /** @brief Default Constructor */ Application(); /** @brief Destructor */ virtual ~Application(); static Application& instance(); /** @brief Find a test by name Returns a pointer to the found test or 0 if not found. */ Test* findTest(const std::string& testname); /** @brief Add reporter for test events Adds the reporter \a r to report test events. */ void attachReporter(Reporter& r); /** @brief Add reporter for test events Adds the reporter \a r to report test events of the test name \a testname. */ void attachReporter(Reporter& r, const std::string& testname); /** @brief Run test by name This method will run a previously registered test. Use the RegisterTest template to register a test to the application. @param testName name of the test to be run */ void run(const std::string& testName); /** @brief Run all tests This method will run all tests that have been registered previously. Use the RegisterTest template to register a test to the application. */ virtual void run(); //! @brief Returns the number of successful tests which occured during a run unsigned success() const { return _success; } //! @brief Returns the number of skipped tests which occured during a run unsigned skipped() const { return _skipped; } //! @brief Returns the number of errors which occured during a run unsigned errors() const { return _errors; } /** @brief Returns a list of all registered test @return Reference to the registered tests. */ static std::list& tests(); /** @brief Register a test Registers the test \a test to the application. The application will not own the test and the caller has to make sure it exists as long as the application object. Tests can be deregistered by calling %deregisterTest. */ static void staticRegisterTest(Test& test); /** @brief Register a test Registers the test \a test to the application. The application will not own the test and the caller has to make sure it exists as long as the application object. Tests can be deregistered by calling %deregisterTest. */ void registerTest(Test& test); void deregisterTest(Test& test); private: static Application* _app; unsigned _success; unsigned _skipped; unsigned _errors; }; } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/jsonreporter.h0000664000175000017500000000621113644433072017362 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_JSONREPORTER_H #define CXXTOOLS_UNIT_JSONREPORTER_H #include #include namespace cxxtools { namespace unit { /** This class collects test results and makes them serialziable. The name of the class is somewhat misleading since it can be used as well with xml serializer. To use it, attach the reporter to the test application. When the tests were run, output the reporter with a suitable serializer like the json serializer. \code // instantiate the test application cxxtools::unit::Application app; // create a JsonReporter and attach it to the app JsonReporter reporter; app.attachReporter(reporter); // run all registered tests app.run(); // output the results in json format std::cout << cxxtools::Json(reporter).beautify(true); \endcode */ class JsonReporter : public cxxtools::unit::Reporter { friend void operator <<= (cxxtools::SerializationInfo& si, const JsonReporter& result); cxxtools::SerializationInfo si; cxxtools::SerializationInfo* current; public: JsonReporter() : current(0) { } virtual void reportStart(const cxxtools::unit::TestContext& test); virtual void reportFinish(const cxxtools::unit::TestContext& test); virtual void reportMessage(const std::string& msg); virtual void reportSuccess(const cxxtools::unit::TestContext& test); virtual void reportAssertion(const cxxtools::unit::TestContext& test, const cxxtools::unit::Assertion& a); virtual void reportException(const cxxtools::unit::TestContext& test, const std::exception& ex); virtual void reportError(const cxxtools::unit::TestContext& test); virtual void reportSkip(const cxxtools::unit::TestContext& test); }; } } #endif cxxtools-3.0/include/cxxtools/unit/testcase.h0000664000175000017500000001111413644433072016437 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTCASE_H #define CXXTOOLS_UNIT_TESTCASE_H #include #include #include namespace cxxtools { namespace unit { /** @brief Single test with setup and teardown @ingroup UnitTests A %TestCase can be used for simple tests that require a initialization and deinitialization of resources. The implementor is supposed to implement the abstract method 'test' and the methods 'setUp' and 'tearDown' for resource management. When the test is run, 'setUp' will be called first, then 'test' and finally 'tearDown'. @code class MyTest : public TestCase { public: MyTest() : TestCase("MyTest") {} virtual void setUp() { // init resource } virtual void tearDown() { // release resource } void test() { // test code using a resourc } }; @endcode Once the test is written it can be registered to an application by using the RegisterTest class template. */ class TestCase : public Test , public TestFixture { private: class Context : public TestContext { public: Context(TestFixture& fixture, TestCase& test) : TestContext(fixture, test) , _test(test) {} protected: virtual void exec() { _test.test(); } private: TestCase& _test; }; public: /** @brief Construct by name Constructs a %TestCase with the passed name. @param name Name of the test */ TestCase(const std::string& name); /** @brief Runs the test When the test is run, 'setUp' will be called first, then 'test' and finally 'tearDown'. Signals inherited from Unit::Test are sent appropriatly. */ virtual void run(); /** \brief Set up conText before running a test. This function is called before each registered tester function is invoked. It is meant to initialize any required resources. */ virtual void setUp(); /** \brief Clean up after the test run. This function is called after each registered tester function is invoked. It is meant to remove any resources previously initialized in TestCase::setUp. */ virtual void tearDown(); protected: /** @brief Implements the actual test procedure When the test is run, this method will be called after setUp and before tearDown. */ virtual void test() = 0; }; } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/reporter.h0000664000175000017500000001261013644433072016470 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_REPORTER_H #define CXXTOOLS_UNIT_REPORTER_H #include #include #include #include #include namespace cxxtools { namespace unit { /** @brief Test event reporter This class is the base class for all reporters for test events. It lets the implementor override several virtual methods that are called on perticular events during the test. Reporters can be made to print information to the console or write XML logs. */ class Reporter { Reporter(const Reporter&) { } Reporter& operator=(const Reporter&) { return *this; } public: /** @brief Destructor */ virtual ~Reporter() { destroyed.send(*this);} /** @brief Start notification This method is called when a test has started. Every test sends this signal at startup. @param test The started test */ virtual void reportStart(const TestContext& /*test*/) { } /** @brief Finished notification This method is called when a test has finished. Every test sends this signal at its end no matter if it failed or succeeded. @param test The finished test */ virtual void reportFinish(const TestContext& /*test*/) { } /** @brief Message notification This method is called when a test has produced an informational message. @param msg The message */ virtual void reportMessage(const std::string& /*msg*/) { } /** @brief Success notification This method is called when a test was successful. @param test The succeeded test */ virtual void reportSuccess(const TestContext& /*test*/) { } /** @brief Assertion notification This method is called when a an assertion failed during a test. an assertion fails when a user defined condition is not met. @param test The failed test */ virtual void reportAssertion(const TestContext& /*test*/, const Assertion& /*a*/) { } /** @brief Exception notification This method is called when a an exception failed during a test. An exception usually means that an error occured that was even u nexpected in a test scenario @param test The failed test */ virtual void reportException(const TestContext& /*test*/, const std::exception& /*ex*/) { } /** @brief Error notification This method is called when a an unknown error occurs during a test. @param test The failed test */ virtual void reportError(const TestContext& /*test*/) { } /** @brief Skipped notification This method is called when was skipped. @param test The skipped test */ virtual void reportSkip(const TestContext& /*test*/) { } Signal destroyed; protected: /** @brief Constructs a reporter */ Reporter() {} }; class BriefReporter : public Reporter { public: explicit BriefReporter(std::ostream* out = &std::cout); virtual ~BriefReporter(); void setOutput(std::ostream& out); virtual void reportStart(const TestContext& test); virtual void reportFinish(const TestContext& test); virtual void reportMessage(const std::string& msg); virtual void reportSuccess(const TestContext& test); virtual void reportAssertion(const TestContext& test, const Assertion& a); virtual void reportException(const TestContext& test, const std::exception& ex); virtual void reportError(const TestContext& test); virtual void reportSkip(const TestContext& test); private: /** @brief Ostream to print output to */ std::ostream* _out; }; } // namespace unit } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/unit/testmain.h0000664000175000017500000000755513644433072016466 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTMAIN_H #define CXXTOOLS_UNIT_TESTMAIN_H #include #include #include #include #include #include #include int main(int argc, char** argv) { log_init(); cxxtools::unit::Application app; cxxtools::Arg help(argc, argv, 'h'); cxxtools::Arg list(argc, argv, 'l'); cxxtools::Arg json(argc, argv, "--json"); cxxtools::Arg json1(argc, argv, 'j'); cxxtools::Arg summary(argc, argv, 's'); if( help || list ) { std::cerr << "Usage: " << argv[0] << " {options} {testname}\n" "Options:\n" " -f output results into file\n" " -s print statistic summary\n" " -j, --json print output in json format instead of standard\n" "Available Tests:\n"; for (std::list::const_iterator it = app.tests().begin(); it != app.tests().end(); ++it) { std::cerr << " - " << (*it)->name() << '\n'; } return 0; } cxxtools::unit::BriefReporter consoleReporter; cxxtools::unit::JsonReporter jsonReporter; if (json || json1) app.attachReporter(jsonReporter); else app.attachReporter(consoleReporter); cxxtools::Arg file(argc, argv, 'f'); std::ofstream logFile; cxxtools::unit::BriefReporter fileReporter; if (file.isSet()) { logFile.open(file); fileReporter.setOutput(logFile); app.attachReporter(fileReporter); } try { if (argc <= 1) { app.run(); } else { for (int a = 1; a < argc; ++a) { std::string testName = argv[a]; app.run(testName); } } if (json || json1) std::cout << cxxtools::Json(jsonReporter).beautify(true); if (summary) { std::cout << "success: " << app.success() << "\n" "errors: " << app.errors() << "\n" "skipped: " << app.skipped() << "\n"; } return app.errors(); } catch(const std::exception& ex) { std::cerr << ex.what() << std::endl; } return 1; } #endif// CXXTOOLS_UNIT_TESTMAIN_H cxxtools-3.0/include/cxxtools/tee.h0000664000175000017500000000527613644433072014436 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TEE_H #define CXXTOOLS_TEE_H #include namespace cxxtools { class Teestreambuf : public std::streambuf { public: Teestreambuf(std::streambuf* buf1 = 0, std::streambuf* buf2 = 0) : streambuf1(buf1), streambuf2(buf2) { setp(0, 0); } void tie(std::streambuf* buf1, std::streambuf* buf2 = 0) { streambuf1 = buf1; streambuf2 = buf2; } private: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); std::streambuf* streambuf1; std::streambuf* streambuf2; }; ///////////////////////////////////////////////////////////////////////////// class Tee : public std::ostream { typedef std::ostream base_class; Teestreambuf streambuf; public: Tee() : std::ostream(0), streambuf(std::cout.rdbuf()) { init(&streambuf); } Tee(std::ostream& s1, std::ostream& s2) : std::ostream(0), streambuf(s1.rdbuf(), s2.rdbuf()) { init(&streambuf); } Tee(std::ostream& s) : std::ostream(0), streambuf(s.rdbuf(), std::cout.rdbuf()) { init(&streambuf); } void assign(std::ostream& s1, std::ostream& s2); void assign(std::ostream& s) { assign(s, std::cout); } void assign_single(std::ostream& s); }; } #endif // CXXTOOLS_TEE_H cxxtools-3.0/include/cxxtools/iso8859_8codec.h0000664000175000017500000000412213644433072016223 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_8CODEC_H #define CXXTOOLS_ISO8859_8CODEC_H #include namespace cxxtools { class Iso8859_8Codec : public CharMapCodec { public: explicit Iso8859_8Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/propertiesdeserializer.h0000664000175000017500000000524613644433072020455 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIESDESERIALIZER_H #define CXXTOOLS_PROPERTIESDESERIALIZER_H #include #include namespace cxxtools { class PropertiesDeserializer : public Deserializer { class Ev; friend class Ev; bool _envSubst; bool _trim; public: PropertiesDeserializer(std::istream& in, TextCodec* codec = 0); PropertiesDeserializer(std::basic_istream& in); PropertiesDeserializer(); void read(std::istream& in, TextCodec* codec = 0); void read(std::basic_istream& in); /// Sets the envSubst flag. /// When set flag is set, environment variables are substituted in the /// value using / `cxxtools::envSubst`. void envSubst(bool sw) { _envSubst = sw; } /// Returns the envSubst flag. bool envSubst() const { return _envSubst; } /// Sets the trim flag. /// When set flag is set, white space is removed from the beginning /// and end of the values. void trim(bool sw) { _trim = sw; } /// Returns the trim flag. bool trim() const { return _trim; } private: void doDeserialize(std::basic_istream& in); }; } #endif // CXXTOOLS_PROPERTIESDESERIALIZER_H cxxtools-3.0/include/cxxtools/json/0000775000175000017500000000000013672344760014535 500000000000000cxxtools-3.0/include/cxxtools/json/httpservice.h0000664000175000017500000000356413644433072017170 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_SERVICE_H #define CXXTOOLS_JSON_SERVICE_H #include #include #include namespace cxxtools { namespace json { class HttpService : public http::Service, public ServiceRegistry { friend class Responder; public: HttpService() { } virtual ~HttpService(); protected: virtual http::Responder* createResponder(const http::Request&); virtual void releaseResponder(http::Responder* resp); }; } } #endif cxxtools-3.0/include/cxxtools/json/request.h0000664000175000017500000000372213644433072016314 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_REQUEST_H #define CXXTOOLS_JSON_REQUEST_H namespace cxxtools { namespace json { class Request { friend void operator<<= (SerializationInfo& si, const Request& r); friend void operator>>= (const SerializationInfo& si, Request& r); public: Request(); private: std::string _method; std::string _id; }; void operator<<= (SerializationInfo& si, const Request& r); void operator>>= (const SerializationInfo& si, Request& r); } } #endif // CXXTOOLS_JSON_REQUEST_H cxxtools-3.0/include/cxxtools/json/httpclient.h0000664000175000017500000001635513644433072017010 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_HTTPCLIENT_H #define CXXTOOLS_JSON_HTTPCLIENT_H #include #include namespace cxxtools { class SelectorBase; namespace net { class Uri; class AddrInfo; } namespace json { class HttpClientImpl; class HttpClient : public RemoteClient { public: HttpClient() : _impl(0) { } explicit HttpClient(SelectorBase& selector) : _impl(0) { setSelector(selector); } explicit HttpClient(const net::AddrInfo& addr, const std::string& url, bool ssl = false) : _impl(0) { prepareConnect(addr, url, ssl); } HttpClient(const net::AddrInfo& addr, const std::string& url, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, url, sslCertificate); } HttpClient(const std::string& addr, unsigned short port, const std::string& url, bool ssl = false) : _impl(0) { prepareConnect(addr, port, url, ssl); } HttpClient(const std::string& addr, unsigned short port, const std::string& url, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, port, url, sslCertificate); } explicit HttpClient(const net::Uri& uri) : _impl(0) { prepareConnect(uri); } HttpClient(const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { prepareConnect(uri, sslCertificate); } HttpClient(SelectorBase& selector, const net::AddrInfo& addr, const std::string& url, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, url, ssl); } HttpClient(SelectorBase& selector, const net::AddrInfo& addr, const std::string& url, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, url, sslCertificate); } HttpClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& url, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, port, url, ssl); } HttpClient(SelectorBase& selector, const std::string& addr, const std::string& url, unsigned short port, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, port, url, sslCertificate); } HttpClient(SelectorBase& selector, const net::Uri& uri) : _impl(0) { setSelector(selector); prepareConnect(uri); } HttpClient(SelectorBase& selector, const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(uri, sslCertificate); } HttpClient(const HttpClient&); HttpClient& operator= (const HttpClient&); virtual ~HttpClient(); void prepareConnect(const net::AddrInfo& addr, const std::string& url, bool ssl = false); void prepareConnect(const net::AddrInfo& addr, const std::string& url, const std::string& sslCertificate); void prepareConnect(const std::string& host, unsigned short port, const std::string& url, bool ssl = false); void prepareConnect(const std::string& host, unsigned short port, const std::string& url, const std::string& sslCertificate); void prepareConnect(const net::Uri& uri); void prepareConnect(const net::Uri& uri, const std::string& sslCertificate); void connect(const net::AddrInfo& addrinfo, const std::string& url, bool ssl_ = false) { prepareConnect(addrinfo, url, ssl_); connect(); } void connect(const net::AddrInfo& addrinfo, const std::string& url, const std::string& sslCertificate) { prepareConnect(addrinfo, url, sslCertificate); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& url, bool ssl_ = false) { prepareConnect(host, port, url, ssl_); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& url, const std::string& sslCertificate) { prepareConnect(host, port, url, sslCertificate); connect(); } void connect(const net::Uri& uri) { prepareConnect(uri); connect(); } void connect(const net::Uri& uri, const std::string& sslCertificate) { prepareConnect(uri, sslCertificate); connect(); } void connect(); void url(const std::string& url); void auth(const std::string& username, const std::string& password); void clearAuth(); void setSelector(SelectorBase* selector); void setSelector(SelectorBase& selector) { setSelector(&selector); } /// @see cxxtools::net::TcpSocket::setSslVerify void setSslVerify(int level, const std::string& ca = std::string()); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Milliseconds timeout() const; void timeout(Milliseconds t); Milliseconds connectTimeout() const; void connectTimeout(Milliseconds t); const std::string& url() const; const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(Milliseconds msecs = WaitInfinite); private: HttpClientImpl* _impl; HttpClientImpl* getImpl(); const HttpClientImpl* getImpl() const { return const_cast(this)->getImpl(); } }; } } #endif cxxtools-3.0/include/cxxtools/json/rpcclient.h0000664000175000017500000001474013644433072016611 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCCLIENT_H #define CXXTOOLS_JSON_RPCCLIENT_H #include #include #include namespace cxxtools { class SslCertificate; class SelectorBase; namespace net { class AddrInfo; class Uri; } namespace json { class RpcClientImpl; class RpcClient : public RemoteClient { RpcClientImpl* _impl; RpcClientImpl* getImpl(); const RpcClientImpl* getImpl() const { return const_cast(this)->getImpl(); } public: RpcClient() : _impl(0) { } explicit RpcClient(SelectorBase& selector) : _impl(0) { setSelector(selector); } explicit RpcClient(const net::AddrInfo& addr, bool ssl = false) : _impl(0) { prepareConnect(addr, ssl); } RpcClient(const net::AddrInfo& addr, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, sslCertificate); } RpcClient(const std::string& addr, unsigned short port, bool ssl = false) : _impl(0) { prepareConnect(addr, port, ssl); } RpcClient(const std::string& addr, unsigned short port, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, port, sslCertificate); } explicit RpcClient(const net::Uri& uri) : _impl(0) { prepareConnect(uri); } RpcClient(const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { prepareConnect(uri, sslCertificate); } RpcClient(SelectorBase& selector, const net::AddrInfo& addr, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, ssl); } RpcClient(SelectorBase& selector, const net::AddrInfo& addr, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, sslCertificate); } RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, port, ssl); } RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, port, sslCertificate); } RpcClient(SelectorBase& selector, const net::Uri& uri) : _impl(0) { setSelector(selector); prepareConnect(uri); } RpcClient(SelectorBase& selector, const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(uri, sslCertificate); } RpcClient(const RpcClient&); RpcClient& operator= (const RpcClient&); virtual ~RpcClient(); void prepareConnect(const net::AddrInfo& addr, bool ssl = false); void prepareConnect(const net::AddrInfo& addr, const std::string& sslCertificate); void prepareConnect(const std::string& host, unsigned short port, bool ssl = false); void prepareConnect(const std::string& host, unsigned short port, const std::string& sslCertificate); void prepareConnect(const net::Uri& uri); void prepareConnect(const net::Uri& uri, const std::string& sslCertificate); void connect(const net::AddrInfo& addrinfo, bool ssl_ = false) { prepareConnect(addrinfo, ssl_); connect(); } void connect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { prepareConnect(addrinfo, sslCertificate); connect(); } void connect(const std::string& host, unsigned short int port, bool ssl_ = false) { prepareConnect(host, port, ssl_); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& sslCertificate) { prepareConnect(host, port, sslCertificate); connect(); } void connect(const net::Uri& uri) { prepareConnect(uri); connect(); } void connect(const net::Uri& uri, const std::string& sslCertificate) { prepareConnect(uri, sslCertificate); connect(); } void connect(); void close(); void setSelector(SelectorBase* selector); void setSelector(SelectorBase& selector) { setSelector(&selector); } /// @see cxxtools::net::TcpSocket::setSslVerify void setSslVerify(int level, const std::string& ca = std::string()); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); Milliseconds timeout() const; void timeout(Milliseconds t); Milliseconds connectTimeout() const; void connectTimeout(Milliseconds t); const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(Milliseconds msecs = WaitInfinite); const std::string& prefix() const; void prefix(const std::string& p); Delegate& acceptSslCertificate(); }; } } #endif // CXXTOOLS_JSON_RPCCLIENT_H cxxtools-3.0/include/cxxtools/json/rpcserver.h0000664000175000017500000001340213644433072016633 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCSERVER_H #define CXXTOOLS_JSON_RPCSERVER_H #include #include #include #include namespace cxxtools { class EventLoopBase; class SslCertificate; namespace json { class Responder; class RpcServerImpl; class RpcServer : public ServiceRegistry { friend class Responder; RpcServerImpl* newImpl(EventLoopBase& eventLoop); public: explicit RpcServer(EventLoopBase& eventLoop) : _impl(newImpl(eventLoop)) { } RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(ip, port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } RpcServer(EventLoopBase& eventLoop, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(std::string(), port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(ip, port, certificateFile, std::string(), sslVerifyLevel, sslCa); } RpcServer(EventLoopBase& eventLoop, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(std::string(), port, certificateFile, std::string(), sslVerifyLevel, sslCa); } ~RpcServer(); /** Listen to the specified ip and port. * * When a certificate file is given, ssl is enabled. If no private key file is given, the private key * is expected to be in the certificate file. * * Multiple listen calls can be made to listen on multiple interfaces or different settings. * * \see cxxtools::net::TcpSocket::setSslVerify for settings of `sslVerifyLevel` and `sslCa` */ void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()); void listen(unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) { listen(std::string(), port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) { listen(ip, port, certificateFile, std::string(), sslVerifyLevel, sslCa); } void listen(unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) { listen(std::string(), port, certificateFile, std::string(), sslVerifyLevel, sslCa); } void addService(const std::string& praefix, const ServiceRegistry& service); unsigned minThreads() const; void minThreads(unsigned m); unsigned maxThreads() const; void maxThreads(unsigned m); enum Runmode { Stopped, Starting, Running, Terminating, Failed }; Signal runmodeChanged; Delegate& acceptSslCertificate(); private: RpcServerImpl* _impl; }; } } #endif // CXXTOOLS_JSON_RPCSERVER_H cxxtools-3.0/include/cxxtools/json/responder.h0000664000175000017500000000465113644433072016627 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RESPONDER_H #define CXXTOOLS_JSON_RESPONDER_H #include #include #include #include #include namespace cxxtools { class ServiceProcedure; class IComposer; class IDecomposer; namespace json { class ServiceRegistry; class Responder : public http::Responder { public: explicit Responder(ServiceRegistry& service); ~Responder(); void beginRequest(net::TcpSocket& socket, std::istream& in, http::Request& request); std::size_t readBody(std::istream& is); void replyError(std::ostream& os, http::Request& request, http::Reply& reply, const std::exception& ex); void reply(std::ostream& os, http::Request& request, http::Reply& reply); private: ServiceRegistry& _serviceRegistry; JsonDeserializer _deserializer; ServiceProcedure* _proc; IComposer** _args; IDecomposer* _result; RemoteException _fault; }; } } #endif cxxtools-3.0/include/cxxtools/callable.h0000664000175000017500000000301513644433072015405 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Callable_h #define cxxtools_Callable_h #include namespace cxxtools { #include } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/jsonparser.h0000664000175000017500000001150713644433072016041 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONPARSER_H #define CXXTOOLS_JSONPARSER_H #include #include namespace cxxtools { class JsonDeserializer; class JsonParserError : public SerializationError { friend class JsonParser; unsigned _lineNo; mutable std::string _msg; public: JsonParserError(const std::string& msg, unsigned lineNo) : SerializationError(msg), _lineNo(lineNo) { } ~JsonParserError() throw() { } const char* what() const throw(); }; class JsonParser { class JsonStringParser { JsonParser* _jsonParser; String _str; unsigned _count; unsigned short _value; unsigned short _surrogateValue; enum { state_0, state_esc, state_hex, state_highsurrogate0, state_lowsurrogate0, state_highsurrogate_esc, state_lowsurrogate_esc, state_highsurrogate_hex, state_lowsurrogate_hex } _state; public: explicit JsonStringParser(JsonParser* jsonParser) : _jsonParser(jsonParser), _state(state_0) { } bool advance(Char ch); void clear() { _state = state_0; _str.clear(); } const String& str() const { return _str; } void str(const String& s) { _str = s; } }; // make non copyable: JsonParser(const JsonParser&); JsonParser& operator=(const JsonParser&); public: JsonParser(); ~JsonParser(); void begin(JsonDeserializer& handler) { _state = state_0; _token.clear(); _deserializer = &handler; } int advance(Char ch); // 1: end character detected; -1: end but char not consumed; 0: no end void finish(); private: enum { state_0, state_object, state_object_plainname, state_object_name, state_object_after_name, state_object_value, state_object_e, state_object_next_member0, state_object_next_member, state_array, state_array_value0, state_array_value, state_array_e, state_string, state_number, state_float, state_token, state_comment0, state_commentline, state_comment, state_comment_e, state_end } _state, _nextState; String _token; JsonDeserializer* _deserializer; JsonStringParser _stringParser; JsonParser* _next; unsigned _lineNo; void doThrow(const std::string& msg); void throwInvalidCharacter(Char ch); }; } #endif // CXXTOOLS_JSONPARSER_H cxxtools-3.0/include/cxxtools/queue.h0000664000175000017500000002210613644433072014774 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUEUE_H #define CXXTOOLS_QUEUE_H #include #include #include #include #include namespace cxxtools { /** @brief This class implements a thread safe queue. A queue is a container where the elements put into the queue are fetched in the same order (first-in-first-out, fifo). The class has a optional maximum size. If the size is set to 0 the queue has no limit. Otherwise putting a element to the queue may block until another thread fetches a element or increases the limit. */ template class Queue { public: typedef T value_type; typedef typename std::deque::size_type size_type; typedef typename std::deque::const_reference const_reference; private: mutable Mutex _mutex; mutable Condition _notEmpty; mutable Condition _notFull; std::deque _queue; size_type _maxSize; size_type _numWaiting; public: /// @brief Default Constructor. Queue() : _maxSize(0), _numWaiting(0) { } /** @brief Returns the next element. This method returns the next element. If the queue is empty, the thread will be locked until a element is available. */ value_type get(); /** @brief Returns the next element if the queue is not empty. This method returns the next element. If the queue is empty, the thread will wait up to timeout milliseconds until a element is available. If the queue was empty after the timeout, a pair of a default constructed value_type and the value false are returned. Otherwise the next element is removed and returned together with a true value. Spurious wakeups are ignored so that when that happens, the method might return before the timeout is over even when the queue is empty. */ std::pair get(const Milliseconds& timeout); /** @brief Returns the next element if the queue is not empty. If the queue is empty, a default constructed value_type is returned. The returned flag is set to false, if the queue was empty. */ std::pair tryGet(); /** @brief Adds a element to the queue. This method adds a element to the queue. If the queue has reached his maximum size, the method blocks until there is space available. */ void put(const_reference element, bool force = false); /** @brief Removes one specific element. This method removes one specific element from the queue. It returns true, when the element was found and removed. */ bool remove(const_reference element); /// @brief Returns true, if the queue is empty. bool empty() const { MutexLock lock(_mutex); return _queue.empty(); } /// @brief Waits until timeout or queue empty. /// Waits until timeout or queue empty. Returns true /// when queue is not empty. bool waitEmpty(Milliseconds timeout = -1) const { MutexLock lock(_mutex); if (timeout >= Milliseconds(0)) { Timespan until = Timespan::gettimeofday() + timeout; Timespan remaining; while (!_queue.empty() && (remaining = until - Timespan::gettimeofday()) > Timespan(0)) _notEmpty.wait(_mutex, remaining); } else { while (!_queue.empty()) _notEmpty.wait(lock); } return !_queue.empty(); } /// @brief Returns the number of elements currently in queue. size_type size() const { MutexLock lock(_mutex); return _queue.size(); } /** @brief sets the maximum size of the queue. Setting the maximum size of the queue may wake up another thread, if it is waiting for space to get available and the limit is increased. */ void maxSize(size_type m); /// @brief returns the maximum size of the queue. size_type maxSize() const { MutexLock lock(_mutex); return _maxSize; } /// @brief returns the number of threads blocked in the get method. size_type numWaiting() const { MutexLock lock(_mutex); return _numWaiting; } }; template typename Queue::value_type Queue::get() { MutexLock lock(_mutex); ScopedIncrement inc(_numWaiting); while (_queue.empty()) _notEmpty.wait(lock); value_type element = _queue.front(); _queue.pop_front(); if (!_queue.empty()) _notEmpty.signal(); _notFull.signal(); return element; } template std::pair::value_type, bool> Queue::get(const Milliseconds& timeout) { typedef typename Queue::value_type value_type; typedef typename std::pair return_type; MutexLock lock(_mutex); ScopedIncrement inc(_numWaiting); if (_queue.empty()) { if (_notEmpty.wait(lock, timeout) == false) { return return_type(value_type(), false); } } value_type element = _queue.front(); _queue.pop_front(); if (!_queue.empty()) _notEmpty.signal(); _notFull.signal(); return return_type(element, true); } template std::pair::value_type, bool> Queue::tryGet() { typedef typename Queue::value_type value_type; typedef typename std::pair return_type; MutexLock lock(_mutex); if (_queue.empty()) return return_type(value_type(), false); value_type element = _queue.front(); _queue.pop_front(); if (!_queue.empty()) _notEmpty.signal(); _notFull.signal(); return return_type(element, true); } template void Queue::put(typename Queue::const_reference element, bool force) { MutexLock lock(_mutex); if (!force) while (_maxSize > 0 && _queue.size() >= _maxSize) _notFull.wait(lock); _queue.push_back(element); _notEmpty.signal(); if (_maxSize > 0 && _queue.size() < _maxSize) _notFull.signal(); } template bool Queue::remove(const_reference element) { MutexLock lock(_mutex); for (typename std::deque::iterator it = _queue.begin(); it != _queue.end(); ++it) if (*it == element) return true; return false; } template void Queue::maxSize(size_type m) { _maxSize = m; MutexLock lock(_mutex); if (_queue.size() < _maxSize) _notFull.signal(); } } #endif // CXXTOOLS_QUEUE_H cxxtools-3.0/include/cxxtools/stdstream.h0000664000175000017500000000427613644433072015666 00000000000000/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STDSTREAM_H #define CXXTOOLS_STDSTREAM_H #include #include namespace cxxtools { /** Combines a cxxtools::IStream with a StdinDevice. * The class defines a cxxtools::IStream which is connected to * stdin. */ class Cin : public IStream { StdinDevice _device; public: Cin() { attachDevice(_device); } }; /** Combines a cxxtools::OStream with a StdoutDevice. * The class defines a cxxtools::OStream which is connected to * stdout. */ class Cout : public OStream { StdoutDevice _device; public: Cout() { attachDevice(_device); } }; /** Combines a cxxtools::OStream with a StderrDevice. * The class defines a cxxtools::OStream which is connected to * stderr. */ class Cerr : public OStream { StderrDevice _device; public: Cerr() { attachDevice(_device); } }; } #endif cxxtools-3.0/include/cxxtools/selector.h0000664000175000017500000001776713644433072015511 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 PTV AG * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_SELECTOR_H #define CXXTOOLS_SYSTEM_SELECTOR_H #include #include #include namespace cxxtools { class Timer; class Selectable; class Application; class SelectorImpl; /** @brief Reports activity on a set of devices. A Selector can be used to monitor a set of Selectables and Timers and wait for activity on them. The wait call can be performed with a timeout and the respective timeout signal is sent if it occurs. Clients can be notified about Timer and Selectable activity by connecting to the appropriate signals of the Timer and Selectable classes. The following example uses a %Selector to wait on acitvity on a %Timer, which is set to time-out after 1000 msecs. @code // slot to handle timer activity void onTimer(); int main() { Timer timer; timer.start(1000); connect(timer.timeout, ontimer); Selector selector; selector.addTimer(timer); selector wait(); return 0; } @endcode A Selector is the heart of the EventLoop, which calls Selector::wait continously. The %EventLoop and %Application classes provide the same API as the Selector itself. */ class SelectorBase : public Connectable { friend class Selectable; friend class Timer; #if __cplusplus >= 201103L SelectorBase(SelectorBase&) = delete; SelectorBase& operator=(SelectorBase&) = delete; #else SelectorBase(SelectorBase&) { } SelectorBase& operator=(SelectorBase&) { return *this; } #endif public: static const int WaitInfinite = -1; //! @brief Destructor virtual ~SelectorBase(); /** @brief Adds an IOResult Adds an IOResult to the selector. IOResult are removed automatically when they get destroyed. */ void add(Selectable& s); /** @brief Cancel an IOResult. */ void remove(Selectable& s); /** @brief Adds a Timer Adds a Timer to the selector. Timers are removed automatically when they get destroyed. @param timer The device to add */ void add(Timer& timer); /** @brief Removes a Timer @param timer The timer to remove */ void remove(Timer& timer); /** @brief Wait for activity This method will wait for activity on the registered Selectables and Timers and execute the registered callbacks. It will return when either the timeout has expired or at least one event has occured. When the timeout is 0, then just active events are triggered. When the timeout is negative, it will wait until the next event without timeout. Use Selector::WaitInfinite to wait without timeout. Note that the class Milliseconds has a implicit constructor which accepts a double value, so that you can pass just a number to the method to get a timeout in milliseconds. @param msecs timeout @return false on timeout */ bool wait(Milliseconds msecs = WaitInfinite); /** @brief Wait for activity This method is like wait but the timeout is specified as a timestamp. The method will wait until the specified time. When the timespan is negative, the method will wait until the next event without timeout. When the timespan is smaller or equal the current time, it will just check for active events and execute them. @param t timeout as a timespan since 1970-01-01 00:00:00 */ bool waitUntil(Timespan t); /** @brief Wakes the selctor from waiting This method can be used to end a Selector::wait call before the timeout expires. It is supposed to be used from another thread and thus is thread-safe. */ void wake(); /** @brief Wait for activity This method executes just the pending events and returns the time when the next timer is due. When there are no active timers a negative timespan is returned. */ Timespan waitTimer(); protected: //! @brief Default constructor SelectorBase(); void onAddTimer(Timer& timer); void onRemoveTimer(Timer& timer); void onTimerChanged(Timer& timer); /** @brief A Selectable is added to this %Selector Do not throw exceptions. */ virtual void onAdd(Selectable&) = 0; /** @brief A Selectable is removed from this %Selector Do not throw exceptions. */ virtual void onRemove(Selectable&) = 0; /** @brief A Selectable is reinitialised and needs to be updated Do not throw exceptions. */ virtual void onReinit(Selectable&) = 0; /** @brief A Selectable in this %Selector has changed Do not throw exceptions. */ virtual void onChanged(Selectable& s) = 0; virtual bool onWaitUntil(Timespan timeout) = 0; virtual void onWake() = 0; private: /** @internal Update all timers and return true if a timer fired @param timeout interval to next expiring timer */ bool updateTimer(Timespan& timeout); //! @internal typedef std::multimap TimerMap; //! @internal TimerMap _timers; }; class Selector : public SelectorBase { public: Selector(); virtual ~Selector(); SelectorImpl& impl(); protected: void onAdd( Selectable& dev ); void onRemove( Selectable& dev ); void onReinit(Selectable&); void onChanged(Selectable&); bool onWaitUntil(Timespan timeout); void onWake(); private: //! @internal class SelectorImpl* _impl; }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/cache.h0000664000175000017500000002735613644433072014727 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CACHE_H #define CXXTOOLS_CACHE_H #include #include #ifdef DEBUG #include #endif namespace cxxtools { /** Implements a container for caching elements. The cache holds a list of key-value-pairs. There are 2 main operations for accessing the cache: put and get. Put takes a key and a value and puts the element into the list. Get takes a key and optional a value. If the value for the key is found, it is returned. The passed value otherwise. By default the value is constructed with the empty ctor of the value-type. The cache has a maximum size, after which key-value-pairs are dropped, when a new item is put into the cache. The algorithm for this cache is as follows: - when the cache is not full, new elements are appended - new elements are put into the middle of the list otherwise - the last element of the list is then dropped - when getting a value and the value is found, it is put to the beginning of the list When elements are searched, a linear search is done using the ==-operator of the key type. The caching algorithm keeps elements, which are fetched more than once in the first half of the list. In the second half the elements are either new or the elements are pushed from the first half to the second half by other elements, which are found in the cache. You should be aware, that the key type should be simple. Comparing keys must be cheap. Copying elements (both key and value) must be possible and should be cheap, since they are moved in the underlying container. */ template class Cache { struct Data { bool winner; unsigned serial; Value value; Data() { } Data(bool winner_, unsigned serial_, const Value& value_) : winner(winner_), serial(serial_), value(value_) { } }; typedef std::map DataType; DataType data; typename DataType::size_type maxElements; unsigned serial; unsigned hits; unsigned misses; unsigned _nextSerial() { if (serial == std::numeric_limits::max()) { for (typename DataType::iterator it = data.begin(); it != data.end(); ++it) it->second.serial = 0; serial = 1; } return serial++; } typename DataType::iterator _getOldest(bool winner) { typename DataType::iterator foundElement = data.begin(); typename DataType::iterator it = data.begin(); for (++it; it != data.end(); ++it) if (it->second.winner == winner && (foundElement->second.winner != winner || it->second.serial < foundElement->second.serial)) foundElement = it; return foundElement; } typename DataType::iterator _getNewest(bool winner) { typename DataType::iterator foundElement = data.begin(); typename DataType::iterator it = data.begin(); for (++it; it != data.end(); ++it) if (it->second.winner == winner && (foundElement->second.winner != winner || it->second.serial > foundElement->second.serial)) foundElement = it; return foundElement; } // drop one element void _dropLooser() { // look for the oldest element in the list of loosers to drop it data.erase(_getOldest(false)); } void _makeLooser() { // look for the oldest element in the list of winners to make it a looser typename DataType::iterator it = _getOldest(true); it->second.winner = false; it->second.serial = _nextSerial(); } public: typedef typename DataType::size_type size_type; typedef Value value_type; explicit Cache(size_type maxElements_) : maxElements(maxElements_ + (maxElements_ & 1)), serial(0), hits(0), misses(0) { } /// returns the number of elements currently in the cache size_type size() const { return data.size(); } /// returns the maximum number of elements in the cache size_type getMaxElements() const { return maxElements; } void setMaxElements(size_type maxElements_) { size_type numWinners = winners(); maxElements_ += (maxElements_ & 1); if (maxElements_ > maxElements) { while (numWinners < maxElements_ / 2) { _getNewest(false)->second.winner = true; ++numWinners; } } else { while (size() > maxElements_) _dropLooser(); numWinners = winners(); while (numWinners > maxElements_ / 2) { _makeLooser(); --numWinners; } } maxElements = maxElements_; } /// removes a element from the cache and returns true, if found bool erase(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) return false; if (it->second.winner) _getNewest(false)->second.winner = true; data.erase(it); return true; } /// clears the cache. void clear(bool stats = false) { data.clear(); if (stats) hits = misses = 0; } /// puts a new element in the cache. If the element is already found in /// the cache, it is considered a cache hit and pushed to the top of the /// list. Value& put(const Key& key, const Value& value) { typename DataType::iterator it = data.find(key); if (it == data.end()) { if (data.size() < maxElements) { it = data.insert(data.begin(), typename DataType::value_type(key, Data(data.size() < maxElements / 2, _nextSerial(), value))); } else { // element not found _dropLooser(); it = data.insert(data.begin(), typename DataType::value_type(key, Data(false, _nextSerial(), value))); } } else { // element found it->second.serial = _nextSerial(); if (!it->second.winner) { // move element to the winner part it->second.winner = true; _makeLooser(); } it->second.value = value; } return it->second.value; } /// puts a new element on the top of the cache. If the element is already /// found in the cache, it is considered a cache hit and pushed to the /// top of the list. This method actually overrides the need, that a element /// needs a hit to get to the top of the cache. void put_top(const Key& key, const Value& value) { typename DataType::iterator it; if (data.size() < maxElements) { if (data.size() >= maxElements / 2) _makeLooser(); data.insert(data.begin(), typename DataType::value_type(key, Data(true, _nextSerial(), value))); } else if ((it = data.find(key)) == data.end()) { // element not found _dropLooser(); _makeLooser(); data.insert(data.begin(), typename DataType::value_type(key, Data(true, _nextSerial(), value))); } else { // element found it->second.serial = _nextSerial(); if (!it->second.winner) { // move element to the winner part it->second.winner = true; _makeLooser(); } } } Value* getptr(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) { ++misses; return 0; } it->second.serial = _nextSerial(); if (!it->second.winner) { // move element to the winner part it->second.winner = true; _makeLooser(); } ++hits; return &it->second.value; } /// returns a pair of values - a flag, if the value was found and the /// value if found or the passed default otherwise. If the value is /// found it is a cache hit and pushed to the top of the list. std::pair getx(const Key& key, Value def = Value()) { Value* v = getptr(key); return v ? std::pair(true, *v) : std::pair(false, def); } /// returns the value to a key or the passed default value if not found. /// If the value is found it is a cahce hit and pushed to the top of the /// list. Value get(const Key& key, Value def = Value()) { return getx(key, def).second; } /// returns the number of hits. unsigned getHits() const { return hits; } /// returns the number of misses. unsigned getMisses() const { return misses; } /// returns the cache hit ratio between 0 and 1. double hitRatio() const { return hits+misses > 0 ? static_cast(hits)/static_cast(hits+misses) : 0; } /// returns the ratio, between held elements and maximum elements. double fillfactor() const { return static_cast(data.size()) / static_cast(maxElements); } unsigned winners() const { unsigned w = 0; for (typename DataType::const_iterator it = data.begin(); it != data.end(); ++it) if (it->second.winner) ++w; return w; } unsigned loosers() const { unsigned l = 0; for (typename DataType::const_iterator it = data.begin(); it != data.end(); ++it) if (!it->second.winner) ++l; return l; } #ifdef DEBUG void dump(std::ostream& out) const { out << "cache max size=" << maxElements << " current size=" << size() << '\n'; for (typename DataType::const_iterator it = data.begin(); it != data.end(); ++it) { out << "\tkey=\"" << it->first << "\" value=\"" << it->second.value << "\" serial=" << it->second.serial << " winner=" << it->second.winner << '\n'; } out << "--------\n"; } #endif }; } #endif // CXXTOOLS_CACHE_H cxxtools-3.0/include/cxxtools/fdstream.h0000664000175000017500000000504313644433072015456 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FDSTREAM_H #define CXXTOOLS_FDSTREAM_H #include namespace cxxtools { class Fdstreambuf : public std::streambuf { std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); int fd; bool doClose; unsigned bufsize; char* buffer; public: explicit Fdstreambuf(int fd, unsigned bufsize = 8192, bool doClose = false); ~Fdstreambuf(); void setClose(bool sw = true) { doClose = sw; } bool isClose() const { return doClose; } void close(); int getFd() const { return fd; } }; class Fdiostream : public std::iostream { Fdstreambuf streambuf; public: explicit Fdiostream(int fd, unsigned bufsize = 8192, bool close = false) : std::iostream(0), streambuf(fd, bufsize, close) { init(&streambuf); } void setClose(bool sw = true) { streambuf.setClose(sw); } bool isClose() const { return streambuf.isClose(); } void close() { streambuf.close(); } int getFd() const { return streambuf.getFd(); } }; } #endif // CXXTOOLS_FDSTREAM_H cxxtools-3.0/include/cxxtools/function.h0000664000175000017500000000311213644433072015471 00000000000000/* * Copyright (C) 2005 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Function_h #define cxxtools_Function_h #include #include #include namespace cxxtools { #include } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/inideserializer.h0000664000175000017500000000733213644433072017036 00000000000000/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_INIDESERIALIZER_H #define CXXTOOLS_INIDESERIALIZER_H #include #include #include #include namespace cxxtools { /** * This class converts ini format to cxxtools::SerializationInfo. * * Here is a usage example: * * @code * * #include * #include * #include * * struct Configuration * { * struct Indent * { * int length; * bool useSpace; * }; * * std::string encoding; * std::vector plugIns; * Indent indent; * }; * * void operator>>= (const cxxtools::SerializationInfo& si, Configuration::Indent& indent) * { * si.getMember("length") >>= indent.length; * si.getMember("use_space") >>= indent.useSpace; * } * * void operator>>= (const cxxtools::SerializationInfo& si, Configuration& config) * { * si.getMember("encoding") >>= config.encoding; * si.getMember("plug-ins") >>= config.plugIns; * si.getMember("indent") >>= config.indent; * } * * int main(int argc, char* argv[]) * { * try * { * // define a empty config object * Configuration config; * * // read ini configuration struct from stdin: * cxxtools::IniDeserializer deserializer(std::cin); * deserializer.deserialize(config); * * // print configuration * std::cout << "encoding=" << config.encoding << '\n' * << "plugIns="; * for (unsigned n = 0; n < config.plugIns.size(); ++n) * std::cout << config.plugIns[n] << ' '; * std::cout << '\n' * << "indent.length=" << config.indent.length << '\n' * << "indent.useSpace=" << config.indent.useSpace << '\n'; * } * catch (const std::exception& e) * { * std::cerr << e.what() << std::endl; * } * } * @endcode */ class IniDeserializer : public Deserializer { public: explicit IniDeserializer(std::istream& in, TextCodec* codec = new Utf8Codec()); explicit IniDeserializer(std::basic_istream& in); }; } #endif // CXXTOOLS_INIDESERIALIZER_H cxxtools-3.0/include/cxxtools/iso8859_13codec.h0000664000175000017500000000413213644433072016300 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_13CODEC_H #define CXXTOOLS_ISO8859_13CODEC_H #include namespace cxxtools { class Iso8859_13Codec : public CharMapCodec { public: explicit Iso8859_13Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/jsonformatter.h0000664000175000017500000001046513644433072016552 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONFORMATTER_H #define CXXTOOLS_JSONFORMATTER_H #include #include namespace cxxtools { class JsonFormatter : public Formatter { public: JsonFormatter() : _os(0), _level(1), _lastLevel(0), _beautify(false), _plainkey(false) { } explicit JsonFormatter(std::ostream& out) : _os(0), _level(1), _lastLevel(0), _beautify(false), _plainkey(false) { begin(out); } void begin(std::ostream& out); void finish(); virtual void addValueString(const std::string& name, const std::string& type, const String& value); virtual void addValueStdString(const std::string& name, const std::string& type, const std::string& value); virtual void addValueBool(const std::string& name, const std::string& type, bool value); virtual void addValueInt(const std::string& name, const std::string& type, int_type value); virtual void addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value); virtual void addValueFloat(const std::string& name, const std::string& type, float value); virtual void addValueDouble(const std::string& name, const std::string& type, double value); virtual void addValueLongDouble(const std::string& name, const std::string& type, long double value); virtual void addNull(const std::string& name, const std::string& type); virtual void beginArray(const std::string& name, const std::string& type); virtual void finishArray(); virtual void beginObject(const std::string& name, const std::string& type); virtual void beginMember(const std::string& name); virtual void finishMember(); virtual void finishObject(); bool beautify() const { return _beautify; } void beautify(bool sw) { _beautify = sw; } bool plainkey() const { return _plainkey; } void plainkey(bool sw) { _plainkey = sw; } void beginValue(const std::string& name); void finishValue(); private: void indent(); void stringOut(const std::string& str); void stringOut(const cxxtools::String& str); std::ostream* _os; unsigned _level; unsigned _lastLevel; bool _beautify; bool _plainkey; }; } #endif // CXXTOOLS_JSONFORMATTER_H cxxtools-3.0/include/cxxtools/iconvstream.h0000664000175000017500000001151113644433072016200 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ICONVSTREAM_H #define CXXTOOLS_ICONVSTREAM_H #include #include #include "iconvwrap.h" namespace cxxtools { class iconv_error : public std::runtime_error { private: mutable std::string msg; size_t pos; public: explicit iconv_error(size_t pos); virtual size_t position() const throw(); virtual const char *what() const throw(); virtual ~iconv_error() throw(); }; /** std::streambuf-Interface for iconv(3) and related. iconv converts charactersets. */ class iconvstreambuf : public std::streambuf { public: /** Behaviour on iconv error. */ typedef enum { /** Old behaviour, just send EOF. */ mode_eof, /** Throw iconv_error. */ mode_throw, /** Skip invalid characters. */ mode_skip, mode_default = mode_eof } mode_t; private: std::ostream* sink; iconvwrap conv; char buffer[256]; mode_t mode; size_t pos; public: iconvstreambuf() : sink(0), mode(mode_default), pos(0) { setg(buffer, buffer, buffer + (sizeof(buffer) - 1)); setp(buffer, buffer + (sizeof(buffer) - 1)); } ~iconvstreambuf() { close(); } iconvstreambuf* open(std::ostream& sink_, const char* tocode, const char* fromcode); iconvstreambuf* open(std::ostream& sink_, const char* tocode, const char* fromcode, mode_t mode_); iconvstreambuf* close() throw(); /// overloaded from std::streambuf int_type overflow(int_type c); /// overloaded from std::streambuf int_type underflow(); /// overloaded from std::streambuf int sync(); /** overloaded from std::streambuf, for input returned value represents * number of bytes succesfully converted (does not count skipped bytes). */ virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which); /** overloaded from std::streambuf, for input returned value represents * number of bytes succesfully converted (does not count skipped bytes). */ virtual std::streampos seekpos(std::streampos sp, std::ios_base::openmode which); }; /** std::ostream-Interface for iconv(3) and related. iconv converts charactersets. To perform a character set conversion from one characterset to another, instantiate a iconvstream with a std::ostream as a sink. Write the data to the iconvstream and the converted stream is written to the sink. example (unix2win-filter): \code int main(int argc, char* argv[]) { cxxtools::iconvstream out(std::cout, "LATIN1", "WINDOWS-1251"); // copy input to output: out << std::cin.rdbuf(); } \endcode */ class iconvstream : public std::ostream { iconvstreambuf streambuf; public: iconvstream(std::ostream& sink, const char* tocode, const char* fromcode) : std::ostream(0) { init(&streambuf); open(sink, tocode, fromcode); } iconvstream(std::ostream& sink, const char* tocode, const char* fromcode, iconvstreambuf::mode_t mode) : std::ostream(0) { init(&streambuf); open(sink, tocode, fromcode, mode); } iconvstream() : std::ostream(0) { init(&streambuf); } void open(std::ostream& sink_, const char* tocode, const char* fromcode); void open(std::ostream& sink_, const char* tocode, const char* fromcode, iconvstreambuf::mode_t mode_); void close() throw() { streambuf.close(); } }; } #endif // CXXTOOLS_ICONVSTREAM_H cxxtools-3.0/include/cxxtools/json.h0000664000175000017500000001343013644433072014621 00000000000000/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_H #define CXXTOOLS_JSON_H #include #include #include namespace cxxtools { /** Wrapper object to easily print serializable objects as json to a output stream. JsonOObject is a little wrapper which makes it easy to output serializable objects into a ostream. For this the JsonOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::ostream, which prints the object in json format. Example: \code std::vector v; v.push_back(4); v.push_back(17); v.push_back(12); std::cout << cxxtools::Json(v).beautify(true) << std::endl; \endcode */ template class JsonOObject { const ObjectType& _constObject; bool _beautify; bool _plainkey; public: /// Constructor. Needs the wrapped object. Optionally a flag can be /// passed whether the json should be nicely formatted. explicit JsonOObject(const ObjectType& object, bool beautify = false) : _constObject(object), _beautify(beautify), _plainkey(false) { } /// Sets the formatting for json. If the passed flag is true, enables /// nice formatting, otherwise disables it. The json is printed then /// without whitespace JsonOObject& beautify(bool sw) { _beautify = sw; return *this; } bool beautify() const { return _beautify; } JsonOObject& plainkey(bool sw) { _plainkey = sw; return *this; } bool plainkey() const { return _plainkey; } const ObjectType& object() const { return _constObject; } }; /// The output operator for JsonOObject. It does the actual work. template std::ostream& operator<< (std::ostream& out, const JsonOObject& object) { try { JsonSerializer serializer(out); serializer.beautify(object.beautify()); serializer.plainkey(object.plainkey()); serializer.serialize(object.object()) .finish(); } catch (const std::exception&) { out.setstate(std::ios::failbit); throw; } return out; } /// Function, which creates a JsonOObject. /// This makes the syntactic sugar perfect. See the example at JsonOObject /// for its use. template JsonOObject Json(const ObjectType& object, bool beautify = false) { return JsonOObject(object, beautify); } /** Wrapper object to easily read objects as json from a input stream. JsonIObject is a little wrapper which makes it easy to read objects from a istream. For this the JsonIObject expects a reference to the wrapped object and has a input operator for a std::istream, or actually a std::basic_istream, which reads the object from json format. Example: \code std::vector v; std::istringstream in("[ 45, 23 ]"); in >> cxxtools::Json(v); for (unsigned n = 0; n < v.size(); ++n) std::cout << v[n] << '\n'; // prints 45 and 23 \endcode */ template class JsonIOObject : public JsonOObject { ObjectType& _object; public: explicit JsonIOObject(ObjectType& object) : JsonOObject(object), _object(object) { } ObjectType& object() { return _object; } }; /// The input operator for JsonIOObject. It does the actual work. template std::basic_istream& operator>> (std::basic_istream& in, JsonIOObject object) { try { JsonDeserializer deserializer(in); deserializer.deserialize(object.object()); } catch (const std::exception&) { in.setstate(std::ios::failbit); throw; } return in; } /// Creates a JsonIObject with a reference to a deserializable object. /// See JsonIObject for a usage example. template JsonIOObject Json(ObjectType& object) { return JsonIOObject(object); } } #endif // CXXTOOLS_JSON_H cxxtools-3.0/include/cxxtools/split.h0000664000175000017500000001404613644433072015007 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SPLIT_H #define CXXTOOLS_SPLIT_H #include #include namespace cxxtools { /** @brief Splits a std::string into tokens using a delimiter character This is a little helper functions, which splits a string into tokens. A delimiter character is passed as a character and the resulting tokens are written to a output iterator. The most common output iterator is a std::back_inserter. Example (print username and uid on a unix system): \code std::ifstream passwd("/etc/passwd"); std::string line; while (std::getline(passwd, line)) { std::vector tokens; cxxtools::split(':', line, std::back_inserter(tokens)); if (tokens.size() > 2) std::cout << "username: " << tokens[0] << " uid=" << tokens[2] << std::endl; } \endcode */ template void split(characterType ch, const std::basic_string& line, outputIterator it) { if (line.empty()) return; typename std::basic_string::size_type b; typename std::basic_string::size_type e; b = 0; while ((e = line.find(ch, b)) != std::basic_string::npos) { (*it) = std::basic_string(line, b, e - b); ++it; b = e + 1; } *it = std::basic_string(line, b); ++it; } /** @brief Splits a std::string into tokens using a set of delimiter characters This is a little helper functions, which splits a string into tokens. A set of delimiter characters is passed as a zero terminated char array and the resulting tokens are written to a output iterator. The most common output iterator is a std::back_inserter. Example (splits a line on white space): \code std::string line = ...; std::vector tokens; cxxtools::split(" \t", line, std::back_inserter(tokens)); \endcode */ template void split(const characterType* chars, const std::basic_string& line, outputIterator it) { if (line.empty()) return; typename std::basic_string::size_type b; typename std::basic_string::size_type e; b = 0; while ((e = line.find_first_of(chars, b)) != std::basic_string::npos) { (*it) = std::basic_string(line, b, e - b); ++it; b = e + 1; } *it = std::basic_string(line, b); ++it; } /** @brief Splits a std::string into tokens using a set of delimiter characters This is a little helper functions, which splits a string into tokens. A set of delimiter characters is passed as a string and the resulting tokens are written to a output iterator. The most common output iterator is a std::back_inserter. Example (splits a line on white space): \code std::string line = ...; std::vector tokens; cxxtools::split("[ \t]+", line, std::back_inserter(tokens)); \endcode */ template void split(const std::basic_string& chars, const std::basic_string& line, outputIterator it) { if (line.empty()) return; typename std::basic_string::size_type e; typename std::basic_string::size_type b; b = 0; while ((e = line.find_first_of(chars, b)) != std::basic_string::npos) { (*it) = std::basic_string(line, b, e - b); ++it; b = e + 1; } *it = std::basic_string(line, b); ++it; } /** @brief Splits a std::string into tokens using a regular expression. This function is much like the other split function, but uses a regular expression to find a delimiter. This is useful e.g. to split a string using white space: Example (splits a line on white space): \code std::string line = ...; std::vector tokens; cxxtools::split(cxxtools::Regex("[ \t]+"), line, std::back_inserter(tokens)); \endcode */ template void split(const Regex& re, const std::string& line, outputIterator it) { if (line.empty()) return; RegexSMatch sm; typename std::string::size_type b; b = 0; while (re.matchp(line, b, sm)) { (*it) = std::string(line, b, sm.offsetBegin(0) - b); ++it; b = sm.offsetEnd(0); } *it = std::string(line, b); ++it; } } #endif // CXXTOOLS_SPLIT_H cxxtools-3.0/include/cxxtools/jsondeserializer.h0000664000175000017500000001007313644433072017224 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONDESERIALIZER_H #define CXXTOOLS_JSONDESERIALIZER_H #include #include #include #include namespace cxxtools { /** * This class converts json format to cxxtools::SerializationInfo. * * Here is a usage example: * * @code * * #include * #include * #include * * struct Configuration * { * struct Indent * { * int length; * bool useSpace; * }; * * std::string encoding; * std::vector plugIns; * Indent indent; * }; * * void operator>>= (const cxxtools::SerializationInfo& si, Configuration::Indent& indent) * { * si.getMember("length") >>= indent.length; * si.getMember("use_space") >>= indent.useSpace; * } * * void operator>>= (const cxxtools::SerializationInfo& si, Configuration& config) * { * si.getMember("encoding") >>= config.encoding; * si.getMember("plug-ins") >>= config.plugIns; * si.getMember("indent") >>= config.indent; * } * * int main(int argc, char* argv[]) * { * try * { * // define a empty config object * Configuration config; * * // read json configuration struct from stdin: * cxxtools::JsonDeserializer deserializer(std::cin); * deserializer.deserialize(config); * * // print configuration * std::cout << "encoding=" << config.encoding << '\n' * << "plugIns="; * for (unsigned n = 0; n < config.plugIns.size(); ++n) * std::cout << config.plugIns[n] << ' '; * std::cout << '\n' * << "indent.length=" << config.indent.length << '\n' * << "indent.useSpace=" << config.indent.useSpace << '\n'; * } * catch (const std::exception& e) * { * std::cerr << e.what() << std::endl; * } * } * @endcode */ class JsonDeserializer : public Deserializer { public: explicit JsonDeserializer(std::istream& in, TextCodec* codec = new Utf8Codec()); explicit JsonDeserializer(std::basic_istream& in); JsonDeserializer() { } void begin(); int advance(Char ch) // 1: end character detected; -1: end but char not consumed; 0: no end { return _parser.advance(ch); } void finish() { return _parser.finish(); } private: JsonParser _parser; }; } #endif // CXXTOOLS_JSONDESERIALIZER_H cxxtools-3.0/include/cxxtools/md5stream.h0000664000175000017500000000620513644433072015553 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MD5STREAM_H #define CXXTOOLS_MD5STREAM_H #include struct cxxtools_MD5_CTX; namespace cxxtools { class Md5streambuf : public std::streambuf { public: Md5streambuf(); ~Md5streambuf(); void getDigest(unsigned char digest[16]); private: static const unsigned int bufsize = 64; char buffer[bufsize]; cxxtools_MD5_CTX* context; unsigned char digest[16]; std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; /** This is a easy and safe interface to MD5-calculation. To get a MD5-sum of data, instantiate a md5stream, copy your data into it and read the digest. After calling getDigest or getHexDigest, the class can be reused for another md5-calculation. The algorithm is automatically reinitialized when the first character is received. example: \code int main(int argc, char* argv[]) { Md5stream s; for (int i = 1; i < argc; ++i) { std::ifstream in(argv[i]); if (in) { s << in.rdbuf(); std::cout << s.getHexDigest() << " " << argv[i] << std::endl; } } } \endcode */ class Md5stream : public std::ostream { public: typedef std::ostreambuf_iterator iterator; private: Md5streambuf streambuf; char hexdigest[33]; public: /// initializes md5-calculation Md5stream() : std::ostream(0) { init(&streambuf); } /// ends md5-calculation and returns 16 bytes digest void getDigest(unsigned char digest[16]) { streambuf.getDigest(digest); } /// ends md5-calculation and digest as 32 bytes hex const char* getHexDigest(); /// returns output-iterator to Md5stream iterator begin() { return iterator(&streambuf); } }; } #endif // CXXTOOLS_MD5STREAM_H cxxtools-3.0/include/cxxtools/textcodec.h0000664000175000017500000004133613644433072015640 00000000000000/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_TextCodec_h #define cxxtools_TextCodec_h #include #include #include #ifdef CXXTOOLS_WITH_STD_LOCALE namespace std { template<> class codecvt : public codecvt_base, public locale::facet { public: static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit codecvt(size_t ref = 0); virtual ~codecvt(); codecvt_base::result out(cxxtools::MBState& state, const cxxtools::Char* from, const cxxtools::Char* from_end, const cxxtools::Char*& from_next, char* to, char* to_end, char*& to_next) const { return this->do_out(state, from, from_end, from_next, to, to_end, to_next); } codecvt_base::result unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const { return this->do_unshift(state, to, to_end, to_next); } codecvt_base::result in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, cxxtools::Char* to, cxxtools::Char* to_end, cxxtools::Char*& to_next) const { return this->do_in(state, from, from_end, from_next, to, to_end, to_next); } int encoding() const { return this->do_encoding(); } bool always_noconv() const { return this->do_always_noconv(); } int length(cxxtools::MBState& state, const char* from, const char* end, size_t max) const { return this->do_length(state, from, end, max); } int max_length() const { return this->do_max_length(); } protected: virtual codecvt_base::result do_out(cxxtools::MBState& state, const cxxtools::Char* from, const cxxtools::Char* from_end, const cxxtools::Char*& from_next, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, cxxtools::Char* to, cxxtools::Char* to_end, cxxtools::Char*& to_next) const = 0; virtual int do_encoding() const throw() = 0; virtual bool do_always_noconv() const throw() = 0; virtual int do_length(cxxtools::MBState&, const char* from, const char* end, size_t max) const = 0; virtual int do_max_length() const throw() = 0; }; template<> class codecvt : public codecvt_base, public locale::facet { public: static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit codecvt(size_t ref = 0); virtual ~codecvt(); codecvt_base::result out(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const { return this->do_out(state, from, from_end, from_next, to, to_end, to_next); } codecvt_base::result unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const { return this->do_unshift(state, to, to_end, to_next); } codecvt_base::result in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const { return this->do_in(state, from, from_end, from_next, to, to_end, to_next); } int encoding() const { return this->do_encoding(); } bool always_noconv() const { return this->do_always_noconv(); } int length(cxxtools::MBState& state, const char* from, const char* end, size_t max) const { return this->do_length(state, from, end, max); } int max_length() const { return this->do_max_length(); } protected: virtual codecvt_base::result do_out(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const = 0; virtual int do_encoding() const throw() = 0; virtual bool do_always_noconv() const throw() = 0; virtual int do_length(cxxtools::MBState&, const char* from, const char* end, size_t max) const = 0; virtual int do_max_length() const throw() = 0; }; } #else // no CXXTOOLS_WITH_STD_LOCALE namespace std { class codecvt_base { public: enum { ok, partial, error, noconv }; typedef int result; virtual ~codecvt_base() { } }; template class codecvt : public std::codecvt_base { public: typedef I InternT; typedef E ExternT; typedef S StateT; public: explicit codecvt(size_t ref = 0) {} virtual ~codecvt() { } codecvt_base::result out(StateT& state, const InternT* from, const InternT* from_end, const InternT*& from_next, ExternT* to, ExternT* to_end, ExternT*& to_next) const { return this->do_out(state, from, from_end, from_next, to, to_end, to_next); } codecvt_base::result unshift(StateT& state, ExternT* to, ExternT* to_end, ExternT*& to_next) const { return this->do_unshift(state, to, to_end, to_next); } codecvt_base::result in(StateT& state, const ExternT* from, const ExternT* from_end, const ExternT*& from_next, InternT* to, InternT* to_end, InternT*& to_next) const { return this->do_in(state, from, from_end, from_next, to, to_end, to_next); } int encoding() const { return this->do_encoding(); } bool always_noconv() const { return this->do_always_noconv(); } int length(StateT& state, const ExternT* from, const ExternT* end, size_t max) const { return this->do_length(state, from, end, max); } int max_length() const { return this->do_max_length(); } protected: virtual result do_in(StateT& s, const ExternT* fromBegin, const ExternT* fromEnd, const ExternT*& fromNext, InternT* toBegin, InternT* toEnd, InternT*& toNext) const = 0; virtual result do_out(StateT& s, const InternT* fromBegin, const InternT* fromEnd, const InternT*& fromNext, ExternT* toBegin, ExternT* toEnd, ExternT*& toNext) const = 0; virtual bool do_always_noconv() const = 0; virtual int do_length(StateT& s, const ExternT* fromBegin, const ExternT* fromEnd, size_t max) const = 0; virtual int do_max_length() const = 0; virtual std::codecvt_base::result do_unshift(StateT&, ExternT*, ExternT*, ExternT*&) const = 0; virtual int do_encoding() const = 0; }; } #endif // CXXTOOLS_WITH_STD_LOCALE namespace cxxtools { /** * @brief Generic TextCodec class/facet which may be subclassed by specific Codec classes. * * This class contains default implementations for the methods do_unshift(), do_encoding() * and do_always_noconv() so sub-classes do not have to implement this default behaviour. * * Codecs are used to convert one Text-encoding into another Text-encoding. The internal * and external data type can be specified using the template parameter 'I' (internal) and * 'E' (external). * * When used on a platform which supports locales and facets the conversion may use * locale-specific conversion of the Text. * * This class derives from facet std::codecvt. Further documentation can be found there. * * @param I The character type associated with the internal code set. * @param E The character type associated with the external code set. * * @see Utf8Codec * @see Utf16Codec * @see Utf32Codec */ template class TextCodec : public std::codecvt { public: typedef I InternT; typedef E ExternT; public: /** * @brief Constructs a new TextCodec object. * * The internal and external type are specified by the template parameters of the class. * * @param ref This parameter is passed to std::codecvt. When ref == 0 the locale takes care * of deleting the facet. If ref == 1 the locale does not destroy the facet. */ explicit TextCodec(size_t ref = 0) : std::codecvt(ref) , _refs(ref) {} public: //! Empty desctructor virtual ~TextCodec() {} size_t refs() const { return _refs; } private: size_t _refs; }; /** @brief helper template function for decoding data using a codec. This template function makes it easy to use a codec to convert a string with one encoding to another. */ template std::basic_string decode(const typename CodecType::ExternT* data, unsigned size) { CodecType codec; typename CodecType::InternT to[64]; MBState state; std::basic_string ret; const typename CodecType::ExternT* from = data; typename CodecType::result r; do { typename CodecType::InternT* to_next = to; const typename CodecType::ExternT* from_next = from; r = codec.in(state, from, from + size, from_next, to, to + sizeof(to)/sizeof(typename CodecType::InternT), to_next); if (r == CodecType::error) throw ConversionError("character conversion failed"); if (r == CodecType::partial && from_next == from) throw ConversionError("character conversion failed - unexpected end of input sequence"); ret.append(to, to_next); size -= (from_next - from); from = from_next; } while (r == CodecType::partial); return ret; } /** @brief helper template function for decoding strings using a codec. This template function makes it easy to use a codec to convert a string with one encoding to another. @code std::string utf8data = ...; cxxtools::String unicodeString = cxxtools::decode(utf8data); std::string base64data = ...; std::string data = cxxtools::decode(base64data); @endcode */ template std::basic_string decode(const std::basic_string& data) { return decode(data.data(), data.size()); } template std::basic_string encode(const typename CodecType::InternT* data, unsigned size) { CodecType codec; char to[64]; MBState state; typename CodecType::result r; const typename CodecType::InternT* from = data; std::basic_string ret; do{ const typename CodecType::InternT* from_next; typename CodecType::ExternT* to_next = to; r = codec.out(state, from, from + size, from_next, to, to + sizeof(to), to_next); if (r == CodecType::error) throw ConversionError("character conversion failed"); ret.append(to, to_next); size -= (from_next - from); from = from_next; } while (r == CodecType::partial); typename CodecType::ExternT* to_next = to; r = codec.unshift(state, to, to + sizeof(to), to_next); if (r == CodecType::error) throw ConversionError("character conversion failed"); ret.append(to, to_next); return ret; } /** @brief helper template function for encoding strings using a codec. This template function makes it easy to use a codec to convert a string with one encoding to another. @code cxxtools::String unicodeString = ...; std::string utf8data = cxxtools::encode(unicodeString); std::string base64data = cxxtools::encode("some data"); @endcode */ template std::basic_string encode(const std::basic_string& data) { return encode(data.data(), data.size()); } } #endif cxxtools-3.0/include/cxxtools/base64stream.h0000664000175000017500000000572313644433072016156 00000000000000/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BASE64STREAM_H #define CXXTOOLS_BASE64STREAM_H #include #include #include namespace cxxtools { /** Base64ostream is a base64-encoder. To base64-encode, instantiate a Base64ostream with an outputstream. Write the data to encode into the stream. Base64ostream writes the base64-encoded data to the outputstream. When ready call terminate() to pad and flush. The stream is also padded and flushed in the destructor, when there are characters left. */ class Base64ostream : public BasicTextOStream { Base64Codec* _codec; public: explicit Base64ostream(std::ostream& out) : BasicTextOStream(out, _codec = new Base64Codec()) { } void end() { terminate(); } unsigned maxcol() const { return _codec->maxcol(); } const std::string& lineend() const { return _codec->lineend(); } bool padding() const { return _codec->padding(); } void maxcol(unsigned m) { _codec->maxcol(m); } void lineend(const std::string& l) { _codec->lineend(l); } void padding(bool p) { _codec->padding(p); } }; /** Base64istream is a base64-decoder. To base64-decode, instantiate a base64istream with an inputstream. The class reads base64-encoded data from the inputstream and you get decoded output. */ class Base64istream : public BasicTextIStream { public: explicit Base64istream(std::istream& in) : BasicTextIStream(in, new Base64Codec()) { } void reset() { terminate(); } }; } #endif // CXXTOOLS_BASE64STREAM_H cxxtools-3.0/include/cxxtools/quotedprintablecodec.h0000664000175000017500000001013713644433072020051 00000000000000/* * Copyright (C) 2016 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUOTEDPRINTABLECODEC_H #define CXXTOOLS_QUOTEDPRINTABLECODEC_H #include #include namespace cxxtools { class QuotedPrintableCodec : public TextCodec { public: explicit QuotedPrintableCodec(size_t ref = 0) : TextCodec(ref) {} virtual ~QuotedPrintableCodec() {} protected: result do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; result do_out(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; // inheritdoc std::codecvt_base::result do_unshift(cxxtools::MBState&, char*, char*, char*&) const; bool do_always_noconv() const throw() { return false; } int do_length(MBState& /*s*/, const char* fromBegin, const char* fromEnd, size_t max) const { const int from = (fromEnd - fromBegin) / 4; const int to = max / 3; return to > from ? from * 4 : to * 4; } int do_encoding() const throw() { // stateful encoding return -1; } int do_max_length() const throw() { return 3; } public: /** @brief shortcut for converting quotedprintable encoded data to std::string Example: @code std::string data = cxxtools::QuotedPrintableCodec::decode(quotedprintabledataptr, quotedprintabledatasize); @endcode */ static std::string decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } /** @brief shortcut for converting quotedprintable encoded std::string to std::string */ static std::string decode(const std::string& data) { return cxxtools::decode(data); } /** @brief shortcut for converting data to quotedprintable encoded std::string */ static std::string encode(const char* data, unsigned size) { return cxxtools::encode(data, size); } /** @brief shortcut for converting std::string to quotedprintable encoded std::string */ static std::string encode(const std::string& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/iso8859_2codec.h0000664000175000017500000000412213644433072016215 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_2CODEC_H #define CXXTOOLS_ISO8859_2CODEC_H #include namespace cxxtools { class Iso8859_2Codec : public CharMapCodec { public: explicit Iso8859_2Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/stringstream.h0000664000175000017500000000607413644433072016400 00000000000000/* * Copyright (C) 2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STRINGSTREAM_H #define CXXTOOLS_STRINGSTREAM_H #include #include #include namespace cxxtools { class StringStreamBuffer : public std::basic_stringbuf { public: explicit StringStreamBuffer(std::ios::openmode mode = std::ios::in | std::ios::out); explicit StringStreamBuffer(const cxxtools::String& str, std::ios::openmode mode = std::ios::in | std::ios::out); }; } // namespace cxxtools namespace std { template<> class basic_stringstream : public basic_iostream { public: typedef cxxtools::Char char_type; typedef std::char_traits traits_type; typedef std::allocator allocator_type; typedef traits_type::int_type int_type; typedef traits_type::pos_type pos_type; typedef traits_type::off_type off_type; public: explicit basic_stringstream(ios_base::openmode mode = ios_base::in | ios_base::out); explicit basic_stringstream(const cxxtools::String& str, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out); virtual ~basic_stringstream(); basic_stringbuf* rdbuf() const; cxxtools::String str() const; void str(const cxxtools::String& str); private: cxxtools::StringStreamBuffer _buffer; }; } // namespace std namespace cxxtools { typedef std::basic_stringstream StringStream; typedef std::basic_ostringstream OStringStream; typedef std::basic_istringstream IStringStream; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/connection.h0000664000175000017500000000707413644433072016016 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Connection_h #define cxxtools_Connection_h #include #include namespace cxxtools { class Connectable; /** @internal */ class ConnectionData : public RefCounted { public: ConnectionData() : RefCounted(1) , _valid(false) , _slot(0) , _sender(0) { } ConnectionData(Connectable& sender, Slot* slot) : RefCounted(1) , _valid(true) , _slot(slot) , _sender(&sender) { } ~ConnectionData() { delete _slot; } bool valid() const { return _valid; } void setValid(bool valid) { _valid = valid; } Connectable& sender() { return *_sender; } const Connectable& sender() const { return *_sender; } Slot& slot() { return *_slot; } const Slot& slot() const { return *_slot; } private: bool _valid; Slot* _slot; Connectable* _sender; }; /** @brief Represents a connection between a Signal/Delegate and a slot @ingroup sigslot */ class Connection { Connection(ConnectionData* data) : _data(data) { if (_data) _data->addRef(); } public: Connection(); Connection(Connectable& sender, Slot* slot); Connection(const Connection& connection); Connection& operator=(const Connection& connection); ~Connection(); bool valid() const { return _data && _data->valid(); } const Connectable& sender() const { return _data->sender(); } const Slot& slot() const { return _data->slot(); } bool operator!() const { return !valid(); } void close(); bool operator==(const Connection& connection) const { return _data == connection._data; } private: ConnectionData* _data; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/eventsource.h0000664000175000017500000000665213644433072016222 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_EVENTSOURCE_H #define CXXTOOLS_EVENTSOURCE_H #include #include #include #include #include #include namespace cxxtools { class EventSink; /** @brief Sends Events to receivers in other threads The Signal class is not thread-safe and can only be used for intra-thread communication. To pass Events between different threads use an %EventSource instead. Thread-safety only refers to the usage of the %EventSource itself (connection, disconnecting...) and not the slot. Construction and destruction must always occur in isolation. */ class EventSource { #if __cplusplus >= 201103L EventSource(const EventSource&) = delete; EventSource& operator=(const EventSource&) = delete; #else EventSource(const EventSource&) { } EventSource& operator=(const EventSource&) { return *this; } #endif friend class EventSink; public: EventSource(); ~EventSource(); void send(const cxxtools::Event& ev); void connect(EventSink& sink); void disconnect(EventSink& sink); template void subscribe(EventSink& sink) { subscribe( sink, typeid(EventT) ); } template void unsubscribe(EventSink& sink) { unsubscribe( sink, typeid(EventT) ); } private: bool tryDisconnect(EventSink& sink); void subscribe(EventSink& sink, const std::type_info& ti); void unsubscribe(EventSink& sink, const std::type_info& ti); private: struct Sentry; typedef std::multimap< const std::type_info*, EventSink*, CompareEventTypeInfo > SinkMap; mutable RecursiveMutex _mutex; mutable RecursiveMutex* _dmutex; mutable SinkMap _sinks; mutable Sentry* _sentry; mutable bool _dirty; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/main.h0000664000175000017500000000446013644433072014577 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MAIN_H #define CXXTOOLS_MAIN_H #ifdef _WIN32_WCE #include int main(int, char**); /** @brief A wmain function for wince that calls a regular main function Include this header in your main.cpp so it can be compiled with visual studio for Windows CE, which has only unicode support. This function simply converts the wide string arguments to 8 bit strings and calls a regular main function. */ int wmain(int argc, wchar_t* wargv[]) { char** argv = 0; argv = new char*[argc]; // convert arguments to char* for (int i = 0; i < argc; ++i) { char line[256]; wcstombs(line, wargv[i], 256); char* line2 = new char[ strlen(line) + 1 ]; strcpy(line2, line); argv[i] = line2; } // call the "regular" main function int ret = main(argc, argv); for (int n = 0; n < argc; ++n) { delete argv[n]; } delete argv; return ret; } #endif #endif cxxtools-3.0/include/cxxtools/directory.h0000664000175000017500000001726213644433072015663 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DIRECTORY_H #define CXXTOOLS_DIRECTORY_H #include #include #include namespace cxxtools { /** @brief Iterates over entries of a directory. A %DirectoryIterator is created by the Directory class and can be used as follows: \code cxxtools::Directory d("/usr"); for (cxxtools::DirectoryIterator it = d.begin(); it != d.end(); ++it) { std::cout << "name: " << *it << std::endl; } \endcode */ class DirectoryIterator : public std::iterator { public: //! @brief Default constructor DirectoryIterator(); //! @brief Constructs an iterator pointing at the file given by a path DirectoryIterator(const std::string& path, bool skipHiden = false); //! @brief Copy constructor DirectoryIterator(const DirectoryIterator& it); //! @brief Destructor ~DirectoryIterator(); //! @brief Advances the iterator to the next file DirectoryIterator& operator++(); //! @brief Assignment operator DirectoryIterator& operator=(const DirectoryIterator& it); //! @brief Equality comparison bool operator==(const DirectoryIterator& it) const { return _impl == it._impl; } //! @brief Inequality comparison bool operator!=(const DirectoryIterator& it) const { return _impl != it._impl; } //! @brief Returns the full path of the file the iterator points at const std::string& path() const; //! @brief Returns the name of the file the iterator points at const std::string& operator*() const; const std::string* operator->() const; private: //! @internal class DirectoryIteratorImpl* _impl; }; /** @brief Represents a single directory in the file-system. This class contains methods to create, move, delete directories and gives to possibility to iterate over the contents of the directory. Iterator Example: \code cxxtools::Directory d("/usr"); for (cxxtools::DirectoryIterator it = d.begin(); it != d.end(); ++it) { std::cout << "name: " << *it << std::endl; } \endcode */ class Directory { public: typedef DirectoryIterator const_iterator; public: //! @brief Default Constructor Directory(); /** @brief Constructs a %Directory object from the path \a path If no directory exists at \a path, an exception of type DirectoryNotFound is thrown. */ explicit Directory(const std::string& path); /** @brief Constructs a %Directory object from a FileInfo object An exception of type %DirectoryNotFound is thrown if the %FileInfo does not represent a directory. */ explicit Directory(const FileInfo& fi); //! @brief Copy constructor Directory(const Directory& dir); //! @brief Destructor ~Directory(); //! @brief Assignment operator Directory& operator=(const Directory& dir); /** @brief Returns the path of the directory This method may return a relative path, or a fully qualified one depending on how this object was constructed. */ const std::string& path() const { return _path; } //! @brief Returns the size of the directory in bytes std::size_t size() const; /** @brief Returns the parent directory path This method might return an empty string if the node was created without a complete path. If the directory is located in the root directory of a unix file system, a slash ("/") is returned. A returned directory path always ends with a trailing path separator character. (A backslash in Windows and a slash in Unix, for example.) */ std::string dirName() const; //! @brief Returns the name of the directory excluding the path. std::string name() const; /** @brief Removes the directory This object will be invalid after calling this method. */ void remove(); /** @brief Moves the directory to the location given by \a to The %Directory object will stay valid after this method was called and point to the moved directory. */ void move(const std::string& to); //! @brief Returns an iterator to the first entry in the directory. const_iterator begin(bool skipHiden = false) const; //! @brief Returns an iterator to the end of the directory entries. const_iterator end() const; public: //! @brief Creates a new directory at the path given by \a path static Directory create(const std::string& path); //! @brief Returns true if a directory exists at \a path, or false otherwise static bool exists(const std::string& path); //! @brief Changes the current directory static void chdir(const std::string& path); //! @brief Returns the current directory static std::string cwd(); //! @brief Returns the string representng the current directory in path names static std::string curdir(); //! @brief Returns the string representng the upper directory in path names static std::string updir(); /** @brief Returns the system root path Returns "/" (root) on Linux, "c:\" on Windows */ static std::string rootdir(); /** @brief Returns the systems tmp directory. The environment variables TEMP and TMP are checked first. If not set, "/tmp" is returned if it exists. If none of the environment variables are set and the default system tmp directory does not exist, the current directory is returned. */ static std::string tmpdir(); //! @brief Returns the string representng the separator in path names static std::string sep(); private: //! @internal std::string _path; }; inline bool operator<(const Directory& a, const Directory& b) { return a.path() < b.path(); } inline bool operator==(const Directory& a, const Directory& b) { return a.path() == b.path(); } inline bool operator!=(const Directory& a, const Directory& b) { return !(a == b); } } #endif cxxtools-3.0/include/cxxtools/properties.h0000664000175000017500000001326513644433072016052 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIES_H #define CXXTOOLS_PROPERTIES_H #include #include #include namespace cxxtools { /** Wrapper object to easily print serializable objects as properties to a output stream. PropertiesOObject is a little wrapper which makes it easy to output serializable objects into a ostream. For this the PropertiesOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::basic_ostream, which prints the object in properties format. Example: \code std::vector v; v.push_back(4); v.push_back(17); v.push_back(12); std::cout << cxxtools::Properties(v) << std::endl; \endcode */ template class PropertiesOObject { const ObjectType& _constObject; bool _outputSize; public: /// Constructor. Needs the wrapped object. Optionally a flag can be /// passed whether the properties should be nicely formatted. explicit PropertiesOObject(const ObjectType& object, bool outputSize = true) : _constObject(object), _outputSize(outputSize) { } PropertiesOObject& outputSize(bool sw) { _outputSize = sw; return *this; } bool outputSize() const { return _outputSize; } const ObjectType& object() const { return _constObject; } }; /// The output operator for PropertiesOObject. It does the actual work. template std::basic_ostream& operator<< (std::basic_ostream& out, const PropertiesOObject& object) { try { PropertiesSerializer serializer(out); serializer.outputSize(object.outputSize()); serializer.serialize(object.object()) .finish(); } catch (const std::exception&) { out.setstate(std::ios::failbit); throw; } return out; } /** Wrapper object to easily read properties from a input stream and convert them to serializable objects. */ template class PropertiesIOObject : public PropertiesOObject { ObjectType& _object; std::string _name; bool _envSubst; bool _trim; public: /// Constructor. Needs the wrapped object. explicit PropertiesIOObject(ObjectType& object, const std::string& name = std::string()) : PropertiesOObject(object), _object(object), _name(name), _envSubst(false), _trim(false) { } ObjectType& object() { return _object; } const std::string& name() const { return _name; } /// Sets the envSubst flag. /// When set flag is set, environment variables are substituted in the /// value using / `cxxtools::envSubst`. PropertiesIOObject& envSubst(bool sw) { _envSubst = sw; return *this; } /// Returns the envSubst flag. bool envSubst() const { return _envSubst; } /// Sets the trim flag. /// When set flag is set, white space is removed from the beginning /// and end of the values. PropertiesIOObject& trim(bool sw) { _trim = sw; return *this; } /// Returns the trim flag. bool trim() const { return _trim; } }; /// The input operator for PropertiesIOObject. It does the actual work. template std::basic_istream& operator>> (std::basic_istream& in, PropertiesIOObject object) { PropertiesDeserializer deserializer; deserializer.envSubst(object.envSubst()); deserializer.trim(object.trim()); deserializer.read(in); if (object.name().empty()) deserializer.deserialize(object.object()); else deserializer.deserialize(object.object(), object.name()); return in; } template PropertiesIOObject Properties(ObjectType& object, const std::string& name = std::string()) { return PropertiesIOObject(object, name); } } #endif // CXXTOOLS_PROPERTIES_H cxxtools-3.0/include/cxxtools/void.h0000664000175000017500000000273113644433072014613 00000000000000/* * Copyright (C) 2005-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_void_h #define cxxtools_void_h namespace cxxtools { struct Void {}; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/scopedincrement.h0000664000175000017500000000427213644433072017036 00000000000000/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SCOPEDINCREMENT_H #define CXXTOOLS_SCOPEDINCREMENT_H #include namespace cxxtools { template class ScopedIncrement { T& _value; T _count; public: ScopedIncrement(T& value, T count = 1) : _value(value), _count(count) { _value += _count; } ~ScopedIncrement() { _value -= _count; } }; template class ScopedIncrement> { std::atomic& _value; T _count; public: ScopedIncrement(std::atomic& value, T count = 1) : _value(value), _count(count) { _value.fetch_add(_count); } ~ScopedIncrement() { _value.fetch_sub(_count); } }; } #endif // CXXTOOLS_SCOPEDINCREMENT_H cxxtools-3.0/include/cxxtools/application.h0000664000175000017500000001223413644433072016154 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_APPLICATION_H #define CXXTOOLS_APPLICATION_H #include #include #include #include #include namespace cxxtools { class ApplicationImpl; /** * \brief The Application class provides an event loop for console applications * without a GUI. * * This class is used by non-GUI applications to provide the applications's event * loop. There should be only exactly one instance of Application (or one of its * subclasses) per application. This is not ensured, though. * * Application contains the main event loop, where event sources can be registered * and events from those sources are dispatched to listeners, that were registered * to the event loop. Events may for example be operating system events (timer, file * system changes). * * The application and therefore the event loop is started with a call to run() and * can be exited with a call to exit(). After calling exit() the application should * terminate. * * The event loop can be access by calling eventLoop(). Events can be committed by * calling EventLoop::commitEvent(). Long running operations can call * EventLoop::processEvents() to keep the application responsive. * * There are convenience methods available for easier access to functionality of * the underlying event loop. commitEvent() delegates to EventLoop::commitEvent(), * queueEvent() delegates to EventLoop::queueEvent() and processEvents() delegates * to EventLoop::processEvents() without making it necessary to first obtain the * event loop manually. */ class Application : public Connectable { void construct(); public: Application(); Application(int argc, char** argv); Application(EventLoopBase* loop); Application(EventLoopBase* loop, int argc, char** argv); ~Application(); static Application& instance(); EventLoopBase& loop() { return *_loop; } void run() { _loop->run(); } void exit() { _loop->exit(); } bool catchSystemSignal(int sig); bool raiseSystemSignal(int sig); Signal systemSignal; int argc() const { return _argc; } int& argc() { return _argc; } const char* const* argv() const { return _argv; } char** argv() { return _argv; } ApplicationImpl& impl() { return *_impl; } /// Puts a event in the queue but does not wake the loop. void queueEvent(const Event& event) { loop().queueEvent(event); } /// Puts a event in the queue and wakes the loop so that the event is processed. void commitEvent(const Event& event) { loop().commitEvent(event); } /// Puts a priority event in the queue but does not wake the loop. /// Priority events are processed before any non priority event. void queuePriorityEvent(const Event& event) { loop().queuePriorityEvent(event); } /// Puts a priority event in the queue and wakes the loop so that the event is processed. /// Priority events are processed before any non priority event. void commitPriorityEvent(const Event& event) { loop().commitPriorityEvent(event); } protected: void init(EventLoopBase& loop); private: ApplicationImpl* _impl; int _argc; char** _argv; EventLoopBase* _loop; EventLoop* _owner; }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/ptrstreambuf.h0000664000175000017500000000401013644433072016360 00000000000000/* * Copyright (C) 2018 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PTRSTREAMBUF_H #define CXXTOOLS_PTRSTREAMBUF_H #include namespace cxxtools { template class BasicPtrStreamBuf : public std::basic_streambuf { public: BasicPtrStreamBuf(CharT* begin, CharT* end) { this->setg(begin, begin, end); this->setp(begin, end); } BasicPtrStreamBuf(CharT* begin, size_t size) { this->setg(begin, begin, begin + size); this->setp(begin, begin + size); } CharT* begin() const { return std::basic_streambuf::pbase(); } CharT* end() const { return std::basic_streambuf::pptr(); } }; typedef BasicPtrStreamBuf PtrStreamBuf; } #endif cxxtools-3.0/include/cxxtools/base64codec.h0000664000175000017500000001067213644433072015737 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Base64Codec_h #define cxxtools_Base64Codec_h #include namespace cxxtools { class Base64Codec : public TextCodec { public: explicit Base64Codec(size_t ref = 0); virtual ~Base64Codec() {} protected: result do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; result do_out(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; result do_unshift(MBState& state, char* toBegin, char* toEnd, char*& toNext) const; bool do_always_noconv() const throw() { return false; } int do_length(MBState& /*s*/, const char* fromBegin, const char* fromEnd, size_t max) const { const int from = (fromEnd - fromBegin) / 4; const int to = max / 3; return to > from ? from * 4 : to * 4; } int do_encoding() const throw() { // stateful encoding return -1; } int do_max_length() const throw() { //worst case: XX== -> x return 4; } private: unsigned _maxcol; std::string _lineend; bool _padding; public: unsigned maxcol() const { return _maxcol; } const std::string& lineend() const { return _lineend; } bool padding() const { return _padding; } void maxcol(unsigned m) { _maxcol = m; } void lineend(const std::string& l) { _lineend = l; } void padding(bool p) { _padding = p; } /** @brief shortcut for converting base64 encoded data to std::string Example: @code std::string data = cxxtools::Base64Codec::decode(base64dataptr, base64datasize); @endcode */ static std::string decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } /** @brief shortcut for converting base64 encoded std::string to std::string */ static std::string decode(const std::string& data) { return cxxtools::decode(data); } /** @brief shortcut for converting data to base64 encoded std::string */ static std::string encode(const char* data, unsigned size) { return cxxtools::encode(data, size); } /** @brief shortcut for converting std::string to base64 encoded std::string */ static std::string encode(const std::string& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/settings.h0000664000175000017500000000505713644433072015516 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Settings_h #define cxxtools_Settings_h #include #include #include namespace cxxtools { class SettingsError : public cxxtools::SerializationError { public: SettingsError(const std::string& what, unsigned line); //! @brief Destructor ~SettingsError() throw() {} unsigned line() const { return _line; } private: unsigned _line; }; /// @deprecated class Settings : public cxxtools::SerializationInfo { public: Settings(); void load( std::basic_istream& is ); void save( std::basic_ostream& os ) const; template bool getObject(T& type, const std::string& name) const { const cxxtools::SerializationInfo* si = this->findMember(name); if(si == 0) return false; *si >>= type; return true; } template void setObject(const T& type, const std::string& name) { SerializationInfo& si = this->addMember(name); si <<= type; } }; } #endif cxxtools-3.0/include/cxxtools/hdstream.h0000664000175000017500000000517413644433072015465 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HDSTREAM_H #define CXXTOOLS_HDSTREAM_H #include namespace cxxtools { class Hdstreambuf : public std::streambuf { static const unsigned BUFFERSIZE = 16; std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); char Buffer[BUFFERSIZE]; std::streambuf* Dest; unsigned offset; public: explicit Hdstreambuf(std::streambuf* dest) : Dest(dest), offset(0) { setp(Buffer, Buffer + BUFFERSIZE); } unsigned getOffset() const { return offset; } void setOffset(unsigned offset_) { offset = offset_; } }; /** hexdumper as a outputstream. Data written to a hdostream are passed as a hexdump to the given sink. */ class Hdostream : public std::ostream { typedef std::ostream base_class; Hdstreambuf streambuf; public: Hdostream() : base_class(0), streambuf(std::cout.rdbuf()) { init(&streambuf); } explicit Hdostream(std::ostream& out) : base_class(0), streambuf(out.rdbuf()) { init(&streambuf); } unsigned getOffset() const { return streambuf.getOffset(); } void setOffset(unsigned offset_) { streambuf.setOffset(offset_); } }; } #endif // CXXTOOLS_HDSTREAM_H cxxtools-3.0/include/cxxtools/conversionerror.h0000664000175000017500000000352213644433072017110 00000000000000/* * Copyright (C) 2004-2007 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CONVERSINERROR_H #define CXXTOOLS_CONVERSINERROR_H #include #include namespace cxxtools { class ConversionError : public std::runtime_error { public: explicit ConversionError(const std::string& msg); ~ConversionError() throw() {} static void doThrow(const char* typeto, const char* typefrom); static void doThrow(const char* typeto, const char* typefrom, const char* valuefrom); }; } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/iso8859_3codec.h0000664000175000017500000000412213644433072016216 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_3CODEC_H #define CXXTOOLS_ISO8859_3CODEC_H #include namespace cxxtools { class Iso8859_3Codec : public CharMapCodec { public: explicit Iso8859_3Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/slot.tpp0000664000175000017500000000111713644433072015204 00000000000000// BEGIN_BasicSlot 10 /** BasicSlot is a base type for various "slot" types. */ template < typename R, typename A1 = Void, typename A2 = Void, typename A3 = Void, typename A4 = Void, typename A5 = Void, typename A6 = Void, typename A7 = Void, typename A8 = Void, typename A9 = Void, typename A10 = Void> class BasicSlot : public Slot { public: /** Creates a copy of this object and returns it. The caller owns the returned object. */ virtual Slot* clone() const = 0; }; // END_BasicSlot 10 cxxtools-3.0/include/cxxtools/pipe.h0000664000175000017500000000613713644433072014613 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PIPE_H #define CXXTOOLS_PIPE_H #include namespace cxxtools { class PipeImpl; class Pipe { #if __cplusplus >= 201103L Pipe(const Pipe&) = delete; Pipe& operator=(const Pipe&) = delete; #else Pipe(const Pipe&) { } Pipe& operator=(const Pipe&) { return *this; } #endif class PipeImpl* _impl; protected: PipeImpl* impl() { return _impl; } const PipeImpl* impl() const { return _impl; } public: typedef int OpenMode; static const int Sync = 0; static const int Async = 1; /** @brief Creates the pipe with two IODevices The default constructor will create the pipe and the appropriate IODevices to read and write to the pipe. */ explicit Pipe(OpenMode mode = Sync); /** @brief Destructor Destroys the pipe and closes the internal IODevices. */ ~Pipe(); /** @brief Endpoint of the pipe to read from @return An IODevice used to read from the pipe */ IODevice& out(); const IODevice& out() const; /** @brief Endpoint of the pipe to write to @return An IODevice used to write to the pipe */ IODevice& in(); const IODevice& in() const; size_t write(const char* buf, size_t count) { return in().write(buf, count); } void write(char ch) { in().write(&ch, 1); } size_t read(char* buf, size_t count) { return out().read(buf, count); } char read() { char ch; out().read(&ch, 1); return ch; } }; } #endif // CXXTOOLS_PIPE_H cxxtools-3.0/include/cxxtools/delegate.h0000664000175000017500000000565213644433072015431 00000000000000/* * Copyright (C) 2004-2007 by Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Delegate_h #define cxxtools_Delegate_h #include #include #include #include #include #include namespace cxxtools { /** @internal */ class DelegateBase : public Connectable { public: DelegateBase() { } DelegateBase(const DelegateBase& rhs) : Connectable(rhs) { operator=(rhs); } DelegateBase& operator=(const DelegateBase& other) { _target.close(); if( !other._target ) return *this; const Slot& slot = other._target.slot(); _target = Connection( *this, slot.clone() ); return *this; } virtual void onConnectionOpen(const Connection& c) { const Connectable& sender = c.sender(); if( &sender == this ) { _target.close(); _target = c; } Connectable::onConnectionOpen(c); } virtual void onConnectionClose(const Connection& c) { Connectable::onConnectionClose(c); } bool isConnected() const { return _target.valid(); } protected: Connection _target; }; #include } // !namespace cxxtools #endif cxxtools-3.0/include/cxxtools/textstream.h0000664000175000017500000003200513644433072016047 00000000000000/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_BasicTextStream_h #define cxxtools_BasicTextStream_h #include #include namespace cxxtools { /** @brief Converts character sequences using a Codec. This generic stream, which only supports input, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered. This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device. The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed! @see std::basic_istream */ template class BasicTextIStream : public std::basic_istream { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef std::basic_istream StreamType; typedef TextCodec CodecType; public: /** @brief Construct by input stream and codec. The input stream @a is is used ro read a character sequence and convert it using the codec @a codec. The Codec object which is passed as pointer will afterwards be managed by this class and also be deleted on destruction */ BasicTextIStream(StreamType& is, CodecType* codec) : std::basic_istream(0) , _buffer( &is, codec ) { std::basic_istream::init(&_buffer); std::basic_istream::exceptions(is.exceptions()); } explicit BasicTextIStream(CodecType* codec) : std::basic_istream(0) , _buffer( 0, codec ) { std::basic_istream::init(&_buffer); } //! @brief Deletes to codec. ~BasicTextIStream() { } void attach(StreamType& is) { _buffer.attach( is ); this->clear(); std::basic_istream::exceptions(is.exceptions()); } void detach() { _buffer.detach(); this->clear(); } void terminate() { _buffer.terminate(); } BasicTextBuffer& buffer() { return _buffer; } private: BasicTextBuffer _buffer; }; /** @brief Converts character sequences using a Codec. This generic stream, which only supports output, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered. This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device. The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed! @see std::basic_istream */ template class BasicTextOStream : public std::basic_ostream { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef std::basic_ostream StreamType; typedef TextCodec CodecType; public: /** @brief Construct by output stream and codec. The output stream @a os is used to write a character sequence which has been converted using the codec @a codec. The Codec object which is passed as pointer will afterwards be managed by this class and be deleted on destruction */ BasicTextOStream(StreamType& os, CodecType* codec) : std::basic_ostream(0) , _buffer( &os , codec ) { std::basic_ostream::init(&_buffer); std::basic_ostream::exceptions(os.exceptions()); } explicit BasicTextOStream(CodecType* codec) : std::basic_ostream(0) , _buffer( 0 , codec ) { std::basic_ostream::init(&_buffer); } //! @brief Deletes to codec. ~BasicTextOStream() { } void attach(StreamType& os) { _buffer.attach( os ); std::basic_ostream::exceptions(os.exceptions()); this->clear(); } void detach() { _buffer.detach(); this->clear(); } void terminate() { _buffer.terminate(); } BasicTextBuffer& buffer() { return _buffer; } private: BasicTextBuffer _buffer; }; /** @brief Converts character sequences using a Codec. This generic stream, which only supports input and output, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered. This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device. The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed! @see std::basic_istream */ template class BasicTextStream : public std::basic_iostream { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef std::basic_iostream StreamType; typedef TextCodec CodecType; public: /** @brief Construct by stream and codec. The stream @a ios is used to read a character sequences and convert is using the codec @a codec and write character sequences which have been converted using the codec @a codec. The codec object which is passed as pointer will afterwards be managed by this class and be deleted on destruction */ BasicTextStream(StreamType& ios, CodecType* codec) : std::basic_iostream(0) , _buffer( &ios, codec) { std::basic_iostream::init(&_buffer); std::basic_iostream::exceptions(ios.exceptions()); } explicit BasicTextStream(CodecType* codec) : std::basic_iostream(0) , _buffer(0, codec) { std::basic_iostream::init(&_buffer); } //! @brief Deletes the codec. ~BasicTextStream() { } void attach(StreamType& ios) { _buffer.attach( ios ); this->clear(); std::basic_iostream::exceptions(ios.exceptions()); } void detach() { _buffer.detach(); this->clear(); } void terminate() { _buffer.terminate(); } BasicTextBuffer& buffer() { return _buffer; } private: BasicTextBuffer _buffer; }; /** @brief Text Input Stream for Character conversion */ class TextIStream : public BasicTextIStream { public: typedef TextCodec Codec; public: /** @brief Constructor The stream will read bytes from \a is and use the codec \a codec for character conversion. The codec will be destroyed by the buffer of this stream if the codec was constructed with a refcount of 0. */ TextIStream(std::istream& is, Codec* codec); explicit TextIStream(Codec* codec); ~TextIStream(); }; /** @brief Text Output Stream for Character conversion */ class TextOStream : public BasicTextOStream { public: typedef TextCodec Codec; public: /** @brief Constructor The stream will write bytes to \a os and use the codec \a codec for character conversion. The codec will be destroyed by the buffer of this stream if the codec was constructed with a refcount of 0. */ TextOStream(std::ostream& os, Codec* codec); explicit TextOStream(Codec* codec); ~TextOStream(); }; /** @brief Text Stream for Character conversion */ class TextStream : public BasicTextStream { public: typedef TextCodec Codec; public: /** @brief Constructor The stream will write or write bytes to \a ios and use the codec \a codec for character conversion. The codec will be destroyed by the buffer of this stream if the codec was constructed with a refcount of 0. */ TextStream(std::iostream& ios, Codec* codec); explicit TextStream(Codec* codec); ~TextStream(); }; inline std::basic_ostream& operator<< (std::basic_ostream& out, wchar_t ch) { return out << Char(ch); } inline std::basic_ostream& operator<< (std::basic_ostream& out, const wchar_t* str) { while (*str) out << Char(*str++); return out; } } // namespace cxxtools #endif cxxtools-3.0/include/cxxtools/propertiesparser.h0000664000175000017500000000620713644433072017265 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIESPARSER_H #define CXXTOOLS_PROPERTIESPARSER_H #include #include #include #include #include namespace cxxtools { class PropertiesParser { public: class Event { public: virtual ~Event() { } // return true, if parser should stop virtual bool onKeyPart(const String& key) = 0; virtual bool onKey(const String& key) = 0; virtual bool onValue(const String& value) = 0; }; private: Event& _event; String _key; String _keypart; String _value; String _space; Char::value_type _unicode; unsigned _unicodeCount; unsigned _lineNo; bool _trim; enum { state_0, state_key, state_key_esc, state_key_unicode, state_key_sp, state_value0, state_value, state_value_esc, state_value_cont, state_value_space, state_unicode, state_comment } _state; public: PropertiesParser(Event& event_, bool trim_ = false) : _event(event_), _lineNo(1), _trim(trim_), _state(state_0) { } bool trim() const { return _trim; } void trim(bool sw) { _trim = sw; } void parse(std::basic_istream& in); void parse(std::istream& in, TextCodec* codec = 0); bool advance(Char ch); void end(); }; class PropertiesParserError : public SerializationError { public: explicit PropertiesParserError(const std::string& msg) : SerializationError(msg) { } PropertiesParserError(const std::string& msg, unsigned lineNo); }; } #endif // CXXTOOLS_PROPERTIESPARSER_H cxxtools-3.0/include/cxxtools/iso8859_14codec.h0000664000175000017500000000413213644433072016301 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_14CODEC_H #define CXXTOOLS_ISO8859_14CODEC_H #include namespace cxxtools { class Iso8859_14Codec : public CharMapCodec { public: explicit Iso8859_14Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } static String decode(const std::string& data) { return cxxtools::decode(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-3.0/include/cxxtools/propertiesserializer.h0000664000175000017500000000754413644433072020147 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIESSERIALIZER_H #define CXXTOOLS_PROPERTIESSERIALIZER_H #include #include namespace cxxtools { class PropertiesSerializer { #if __cplusplus >= 201103L PropertiesSerializer(const PropertiesSerializer&) = delete; PropertiesSerializer& operator=(const PropertiesSerializer&) = delete; #else PropertiesSerializer(const PropertiesSerializer&) { } PropertiesSerializer& operator=(const PropertiesSerializer&) { return *this; } #endif public: PropertiesSerializer() : _outputSize(true), _myts(0), _ts(0) { } explicit PropertiesSerializer(std::basic_ostream& ts) : _outputSize(true), _myts(0), _ts(0) { begin(ts); } explicit PropertiesSerializer(std::ostream& os, TextCodec* codec = 0) : _outputSize(true), _myts(0), _ts(0) { begin(os, codec); } ~PropertiesSerializer() { delete _myts; } PropertiesSerializer& begin(std::basic_ostream& ts); PropertiesSerializer& begin(std::ostream& os, TextCodec* codec = 0); void finish(); template PropertiesSerializer& serialize(const T& v, const std::string& name) { SerializationInfo si; si <<= v; format(si, name); return *this; } template PropertiesSerializer& serialize(const T& v) { SerializationInfo si; si <<= v; format(si, si.name()); return *this; } bool outputSize() const { return _outputSize; } void outputSize(bool sw) { _outputSize = sw; } private: void format(const SerializationInfo& si, const std::string& key); void doFormat(const SerializationInfo& si, const std::string& key); bool _outputSize; std::basic_ostream* _myts; std::basic_ostream* _ts; }; } #endif // CXXTOOLS_PROPERTIESSERIALIZER_H cxxtools-3.0/include/cxxtools/constmethod.tpp0000664000175000017500000007236613644433072016570 00000000000000// BEGIN_ConstMethod 10 /** The ConstMethod class wraps const member functions as Callable objects so that they can be used with the signals/slots framework. */ template < typename R,typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const ) { return ConstMethod(obj,ptr); } /** ConstMethodSlot is a wrapper which allows ConstMethod objects to behave like Slot objects. */ template < typename R, typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class ConstMethodSlot : public BasicSlot { public: /** Wraps the given ConstMethod object. */ ConstMethodSlot(const ConstMethod& method) : _method( method ) {} /** Creates a copy of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new ConstMethodSlot(*this); } /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_method; } virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } virtual bool equals(const Slot& slot) const { const ConstMethodSlot* ms = dynamic_cast(&slot); return ms ? (_method == ms->_method) : false; } private: ConstMethod _method; }; /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 10 // BEGIN_ConstMethod 9 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 9 // BEGIN_ConstMethod 8 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7,a8); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 8 // BEGIN_ConstMethod 7 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 7 // BEGIN_ConstMethod 6 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 6 // BEGIN_ConstMethod 5 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return (_object->*_method)(a1,a2,a3,a4,a5); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 5 // BEGIN_ConstMethod 4 template < typename R, typename ClassT,class A1, class A2, class A3, class A4> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return (_object->*_method)(a1,a2,a3,a4); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 4 // BEGIN_ConstMethod 3 template < typename R, typename ClassT,class A1, class A2, class A3> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3) const { return (_object->*_method)(a1,a2,a3); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 3 // BEGIN_ConstMethod 2 template < typename R, typename ClassT,class A1, class A2> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2) const { return (_object->*_method)(a1,a2); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 2 // BEGIN_ConstMethod 1 template < typename R, typename ClassT,class A1> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1) const { return (_object->*_method)(a1); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 1 // BEGIN_ConstMethod 0 template < typename R, typename ClassT> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)() const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()() const { return (_object->*_method)(); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)() const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)() const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 0 cxxtools-3.0/include/cxxtools/clock.h0000664000175000017500000000561213644433072014746 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CLOCK_H #define CXXTOOLS_CLOCK_H #include #include namespace cxxtools { /** @brief Measures time intervals The clock class can be used like a stop-watch by calling Clock::start() and Clock::stop(). The latter method returns the elapsed time. */ class Clock { public: /** @brief Constructs a Clock */ Clock(); Clock(const Clock& cl); Clock& operator=(const Clock& cl); /** @brief Destructor */ virtual ~Clock(); /** @brief Start the clock and return the current system ticks. */ Timespan start(); /** @brief Stop the clock. Can be called several times. Returns the elapsed time since start was called. Since stop does not change the start time it can be called several times in order to get the elapsed time. */ Timespan stop() const; /** @brief Returns the system time */ static UtcDateTime getSystemTime(); /** @brief Returns the current local time */ static LocalDateTime getLocalTime(); /** @brief Returns the timespan since a fixed point in the past The getSystemTicks function retrieves the system ticks, in milliseconds. The system time is the time elapsed since i.e. the system was started, or the unix epoch or some other fixed point in the past. */ static Timespan getSystemTicks(); private: class ClockImpl *_impl; }; } //namespace cxxtools #endif // CXXTOOLS_CLOCK_H cxxtools-3.0/include/cxxtools/charmapcodec.h0000664000175000017500000000560713644433072016270 00000000000000/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CHARMAPCODEC_H #define CXXTOOLS_CHARMAPCODEC_H #include #include #include namespace cxxtools { /** The codec translates between one byte char and unicode char using a translation map. * * The class is the base class for all ISO-8859-x codecs. */ class CharMapCodec : public TextCodec { typedef Char::value_type CharMap[256]; const CharMap& _charMap; public: explicit CharMapCodec(const CharMap& charMap, size_t ref = 0) : TextCodec(ref), _charMap(charMap) {} virtual ~CharMapCodec() {} protected: virtual result do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, Char* toBegin, Char* toEnd, Char*& toNext) const; virtual result do_out(MBState& s, const Char* fromBegin, const Char* fromEnd, const Char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; std::codecvt_base::result do_unshift(cxxtools::MBState&, char*, char*, char*&) const { return std::codecvt_base::noconv; } bool do_always_noconv() const throw(); int do_length(MBState& s, const char* fromBegin, const char* fromEnd, size_t max) const; int do_encoding() const throw() { return 0; } int do_max_length() const throw(); }; } #endif cxxtools-3.0/include/cxxtools/quotedprintablestream.h0000664000175000017500000000442613644433072020273 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUOTEDPRINTABLESTREAM_H #define CXXTOOLS_QUOTEDPRINTABLESTREAM_H #include #include #include namespace cxxtools { /** The QuotedPrintable_ostream implements a encoder for Quoted-printable encoding. Quoted-printable encoding is used sometimes in E-Mails to reduce the character set to 7 bit. Usage example: \code std::ostringstream s; cxxtools::QuotedPrintable_ostream q(s); q << "H\xe4tten H\xfcte ein \xdf im Namen, w\xe4ren sie m\xf6glicherweise keine H\xfcte mehr,\nsondern H\xfc\xdf" "e."; std::string quotedprintabletext = s.str(); \endcode */ class QuotedPrintable_ostream : public BasicTextOStream { public: explicit QuotedPrintable_ostream(std::ostream& in) : BasicTextOStream(in, new QuotedPrintableCodec()) { } }; } #endif // CXXTOOLS_QUOTEDPRINTABLESTREAM_H cxxtools-3.0/include/cxxtools/envsubst.h0000664000175000017500000000545413644433072015530 00000000000000/* * Copyright (C) 2015 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ENVSUBST_H #define CXXTOOLS_ENVSUBST_H #include #include namespace cxxtools { class EnvSubstSyntaxError : public std::runtime_error { public: explicit EnvSubstSyntaxError(const std::string& msg); }; /** This function parses a character data and replaces environment variables. These replacements are done: - A sequence of '$' followed by a sequence of alphanumeric characters or underscore is replaced with the content of the environment variable. When the variable is not set, it is replaced by a empty sequence. - The sequence of alphanumeric characters or underscore can be bracketed with curly brackets. - In curly brackets a default value can be specified by using the sequence ":-". The characters before that are the environment variable and after it the replacement. Environment variables in the replacement are processed with the same rules. Examples: The environment variable USER is set to "tommi" String sequence output --------------------------------- -------------------------------- The user $USER The user tommi The user ${USER} The user tommi The user ${USER:-whoever} The user tommi The user ${UNKNOWN_VAR:-whoever} The user whoever */ std::string envSubst(const std::string& str); } #endif // CXXTOOLS_ENVSUBST_H cxxtools-3.0/include/cxxtools/csvformatter.h0000664000175000017500000000666113644433072016377 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVFORMATTER_H #define CXXTOOLS_CSVFORMATTER_H #include #include #include #include #include #include namespace cxxtools { class CsvFormatter : public Formatter { public: explicit CsvFormatter(std::ostream& os, TextCodec* codec = new Utf8Codec()); explicit CsvFormatter(TextOStream& os); ~CsvFormatter(); void selectColumn(const std::string& title); void selectColumn(const std::string& memberName, const std::string& title); void delimiter(String delimiter) { _delimiter = delimiter; } void quote(Char quote) { _quote = quote; } void lineEnding(const String& le) { _lineEnding = le; } virtual void addValueString(const std::string& name, const std::string& type, const String& value); virtual void beginArray(const std::string& name, const std::string& type); virtual void finishArray(); virtual void beginObject(const std::string& name, const std::string& type); virtual void beginMember(const std::string& name); virtual void finishMember(); virtual void finishObject(); virtual void finish(); private: void toCsvData(String& ret, const std::string& type, const String& value); void dataOut(); bool _firstline; bool _collectTitles; unsigned _level; String _delimiter; Char _quote; String _lineEnding; // titles and member names struct Title { std::string _memberName; std::string _title; }; std::vector _titles; std::vector<String> _data; std::string _memberName; TextOStream* _ts; TextOStream& _os; }; } #endif // CXXTOOLS_CSVFORMATTER_H �������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/stddevice.h�����������������������������������������������������������0000664�0001750�0001750�00000004414�13644433072�015624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STDDEVICE_H #define CXXTOOLS_STDDEVICE_H #include <cxxtools/iodevice.h> namespace cxxtools { class StdinDevice : public IODevice { public: StdinDevice(); ~StdinDevice(); protected: IODeviceImpl& ioimpl(); SelectableImpl& simpl(); size_t onBeginWrite(const char* buffer, size_t n); size_t onWrite(const char* buffer, size_t count); private: IODeviceImpl* _impl; }; class ODevice : public IODevice { protected: ODevice(); ~ODevice(); IODeviceImpl& ioimpl(); SelectableImpl& simpl(); size_t onBeginRead(char* buffer, size_t n, bool& eof); size_t onRead(char* buffer, size_t count, bool& eof); private: IODeviceImpl* _impl; }; class StdoutDevice : public ODevice { public: StdoutDevice(); }; class StderrDevice : public ODevice { public: StderrDevice(); }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/hmac.h����������������������������������������������������������������0000664�0001750�0001750�00000006250�13644433072�014562� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* HMAC algorithm as described by RFC 2104 * http://tools.ietf.org/html/rfc2104 */ #ifndef CXXTOOLS_HMAC_H #define CXXTOOLS_HMAC_H #include <sstream> #include <algorithm> namespace cxxtools { template <typename Algo> void hmac_pad_key(Algo& key_hash, const std::string& key, std::string& o_key_pad, std::string& i_key_pad) { std::string _key(key); if(key.length() > Algo::blockSize) _key = key_hash.getDigest(); _key.resize(Algo::blockSize); std::string::const_iterator key_it = _key.begin(); for(std::string::iterator pad_it = o_key_pad.begin(); pad_it != o_key_pad.end(); pad_it++) *pad_it = *pad_it ^ *key_it++; key_it = _key.begin(); for(std::string::iterator pad_it = i_key_pad.begin(); pad_it != i_key_pad.end(); pad_it++) *pad_it = *pad_it ^ *key_it++; } template <typename Algo, typename data_type> std::string hmac(const std::string& key, const data_type& msg) { Algo key_hash(key); std::string o_key_pad(Algo::blockSize, 0x5c); std::string i_key_pad(Algo::blockSize, 0x36); cxxtools::hmac_pad_key(key_hash, key, o_key_pad, i_key_pad); Algo inner_hash(i_key_pad + msg); Algo outer_hash(o_key_pad + inner_hash.getDigest()); return outer_hash.getHexDigest(); } template <typename Algo, typename iterator_type> std::string hmac(const std::string& key, iterator_type from, iterator_type to) { Algo key_hash(key); std::string o_key_pad(Algo::blockSize, 0x5c); std::string i_key_pad(Algo::blockSize, 0x36); std::stringstream is; cxxtools::hmac_pad_key(key_hash, key, o_key_pad, i_key_pad); std::copy(from, to, std::ostreambuf_iterator<char>(is)); Algo inner_hash(i_key_pad + is.str()); Algo outer_hash(o_key_pad + inner_hash.getDigest()); return outer_hash.getHexDigest(); } } #endif // CXXTOOLS_HMAC_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/semaphore.h�����������������������������������������������������������0000664�0001750�0001750�00000004361�13644433072�015636� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Semaphore_h #define cxxtools_Semaphore_h namespace cxxtools { class Semaphore { friend class SemaphoreImpl; #if __cplusplus >= 201103L Semaphore(const Semaphore&) = delete; Semaphore& operator=(const Semaphore&) = delete; #else Semaphore(const Semaphore&) { } Semaphore& operator=(const Semaphore&) { return *this; } #endif public: //! @brief Construct with initial count explicit Semaphore(unsigned int initial = 0); //! @brief Destructor. Does not signal... ~Semaphore(); //! @brief Wait for the semaphore to become signaled Semaphore& wait(); //! @brief Non-blocking wait bool tryWait(); //! @brief Signal the semaphore Semaphore& post(); private: //! @internal @brief Implementation class SemaphoreImpl* _impl; }; } // !namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/composer.h������������������������������������������������������������0000664�0001750�0001750�00000003747�13644433072�015511� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Composer_h #define cxxtools_Composer_h #include <cxxtools/serializationinfo.h> namespace cxxtools { class IComposer { public: IComposer() {} virtual ~IComposer() {} virtual void fixup(const SerializationInfo& si) = 0; }; template <typename T> class Composer : public IComposer { public: Composer() : _type(0) {} void begin(T& type) { _type = &type; } virtual void fixup(const SerializationInfo& si) { si >>= *_type; } private: T* _type; }; } // namespace cxxtools #endif �������������������������cxxtools-3.0/include/cxxtools/hexdump.h�������������������������������������������������������������0000664�0001750�0001750�00000007061�13644433072�015325� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2017 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HEXDUMP_H #define CXXTOOLS_HEXDUMP_H #include <iostream> #include <cxxtools/hdstream.h> namespace cxxtools { /// @Internal struct HexDump { const char* _p; unsigned _n; HexDump(const char* p, unsigned n) : _p(p), _n(n) { } }; /// @Internal inline HexDump hexDump(const char* p, unsigned n) { return HexDump(p, n); } /** Dumps a memory area with a pointer and size. * * Example: * \code * const char* buffer = ...; * unsigned bufsize = ... * std::cout << cxxtools::hexDump(buffer, bufsize); * \endcode */ inline std::ostream& operator<< (std::ostream& out, const HexDump& hd) { Hdstreambuf buf(out.rdbuf()); if (buf.sputn(hd._p, hd._n) == hd._n) buf.pubsync(); else out.setstate(std::ios::failbit); return out; } /// @Internal template <typename It> struct HexDumpIt { It begin; It end; HexDumpIt(It begin_, It end_) : begin(begin_), end(end_) { } }; /// @Internal template <typename It> HexDumpIt<It> hexDump(It begin, It end) { return HexDumpIt<It>(begin, end); } /** Dumps data specified by 2 iterators. * * Example: * \code * std::vector<char> data = ...; * std::cout << cxxtools::hexDump(data.begin(), data.end()); * \endcode */ template <typename It> std::ostream& operator<< (std::ostream& out, const HexDumpIt<It>& hd) { Hdstreambuf buf(out.rdbuf()); for (It it = hd.begin; it != hd.end; ++it) buf.sputc(*it); buf.pubsync(); return out; } /// @Internal template <typename Container> struct HexDumpC { const Container& c; explicit HexDumpC(const Container& c_) : c(c_) { } }; /// @Internal template <typename Container> HexDumpC<Container> hexDump(const Container& c) { return HexDumpC<Container>(c); } /** Dumps data from a container class. * * Example: * \code * std::vector<char> data = ...; * std::cout << cxxtools::hexDump(data); * \endcode */ template <typename Container> std::ostream& operator<< (std::ostream& out, const HexDumpC<Container>& hd) { Hdstreambuf buf(out.rdbuf()); for (typename Container::const_iterator it = hd.c.begin(); it != hd.c.end(); ++it) buf.sputc(*it); buf.pubsync(); return out; } } #endif // CXXTOOLS_HEXDUMP_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/inifile.h�������������������������������������������������������������0000664�0001750�0001750�00000020064�13644433072�015270� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_INIFILE_H #define CXXTOOLS_INIFILE_H #include <cxxtools/convert.h> #include <cxxtools/utf8codec.h> #include <cxxtools/textstream.h> #include <iostream> #include <string> #include <map> namespace cxxtools { class IniFile { friend std::istream& operator >> (std::istream& in, IniFile& ini); friend std::ostream& operator << (std::ostream& out, const IniFile& ini); typedef std::map<String, std::map<String, String> > MapType; MapType data; struct S { const String& _s; S(const String& s) : _s(s) { } operator const String&() const { return _s; } operator std::string() const { return Utf8Codec::encode(_s); } }; public: IniFile() { } explicit IniFile(const std::string& filename); explicit IniFile(std::istream& in, TextCodec<Char, char>* codec = new Utf8Codec()); /// Returns true, if section exists. bool exists(const String& section) const { return data.find(section) != data.end(); } /// Returns true, if key exists in section exists. bool exists(const String& section, const String& token) const { MapType::const_iterator si = data.find(section); return si != data.end() && si->second.find(token) != si->second.end(); } /// Returns associated value from section-key-pair or default-value. String getValue(const String& section, const String& token, const String& def = String()) const { // find section MapType::const_iterator si = data.find(section); if (si != data.end()) { // find token MapType::mapped_type::const_iterator token_it = si->second.find(token); if (token_it != si->second.end()) return token_it->second; } return def; } /// Get the value and convert it with istream-operator. /// The return-type is identified by the default-value-type. template <typename T> T getValueT(const String& section, const String& token, const T& def) const { // find section MapType::const_iterator si = data.find(section); if (si != data.end()) { // find token MapType::mapped_type::const_iterator token_it = si->second.find(token); if (token_it != si->second.end()) { try { return convert<T>(token_it->second); } catch (const cxxtools::ConversionError&) { // conversion error leads to returning of default value } } } return def; } /// setting a new value void setValue(const String& section, const String& key, const String& value) { data[section][key] = value; } /// setting a new value with a type (need output-operator for ostream). template <typename T> void setValueT(const String& section, const String& key, const T& value) { data[section][key] = convert<String>(value); } /** * Get the names of sections. * example1: * <code> * cxxtools::IniFile ini("my.ini"); * * // copy names of sections into a container * std::set<String> keys; * ini.getSections(std::inserter(s, s.begin()); * * // or printing the names: * ini.getSections(std::ostream_iterator<cxxtools::String>(std::cout, "\n")); * </code> */ template <typename OutputIterator> void getSections(OutputIterator oi) { for (MapType::const_iterator it = data.begin(); it != data.end(); ++it, ++oi) *oi = S(it->first); } /** * Get the keys of a section. * example1: * <code> * cxxtools::IniFile ini("my.ini"); * * // copy keys into a container * std::set<String> keys; * ini.getKeys("section2", std::inserter(s, s.begin()); * * // or printing the keys: * ini.getKeys("section2", std::ostream_iterator<cxxtools::String>(std::cout, "\n")); * </code> */ template <typename OutputIterator> void getKeys(const String& section, OutputIterator oi) { MapType::const_iterator si = data.find(section); if (si != data.end()) { for (MapType::mapped_type::const_iterator it = si->second.begin(); it != si->second.end(); ++it, ++oi) *oi = S(it->first); } } /// for compatibility with older implementation offer methods with utf-8 encoded strings std::string getValue(const std::string& section, const std::string& token, const std::string& def = std::string()) const { return Utf8Codec::encode(getValue( Utf8Codec::decode(section), Utf8Codec::decode(token), Utf8Codec::decode(def))); } /// for compatibility with older implementation offer methods with utf-8 encoded strings template <typename T> T getValueT(const std::string& section, const std::string& token, const T& def) const { return getValue( Utf8Codec::decode(section), Utf8Codec::decode(token), def); } }; /// Reads ini file from an output stream std::istream& operator >> (std::istream& in, IniFile& ini); /// Outputs ini file to an output stream std::ostream& operator << (std::ostream& out, const IniFile& ini); } #endif // CXXTOOLS_INIFILE_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/csvparser.h�����������������������������������������������������������0000664�0001750�0001750�00000006015�13644433072�015661� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVPARSER_H #define CXXTOOLS_CSVPARSER_H #include <cxxtools/string.h> #include <vector> namespace cxxtools { class CsvDeserializer; class CsvParser { public: CsvParser() : _deserializer(0), _delimiter(autoDelimiter), _readTitle(true), _noColumns(0), _lineNo(0) { } Char delimiter() const { return _delimiter; } void delimiter(Char ch) { _delimiter = ch; } bool readTitle() const { return _readTitle; } void readTitle(bool sw) { _readTitle = sw; } static const Char autoDelimiter; void begin(CsvDeserializer& handler); void advance(Char ch); void finish(); private: enum { state_detectDelim, state_detectDelim_q, state_detectDelim_postq, state_title, state_qtitle, state_qtitlep, state_cr, state_rowstart, state_datastart, state_data0, state_data, state_qdata, state_qdata_end } _state; CsvDeserializer* _deserializer; Char _delimiter; bool _readTitle; typedef std::vector<std::string> rowType; rowType _titles; String _value; rowType::size_type _column; unsigned _noColumns; unsigned _lineNo; Char _quote; }; } #endif // CXXTOOLS_CSVPARSER_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/utf8.h����������������������������������������������������������������0000664�0001750�0001750�00000006271�13644433072�014543� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2014 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UTF8_H #define CXXTOOLS_UTF8_H #include <cxxtools/utf8codec.h> #include <cxxtools/string.h> #include <cxxtools/serializationinfo.h> namespace cxxtools { class Utf8OString { String _constStr; public: explicit Utf8OString(const String& str) : _constStr(str) { } const String& ustr() const { return _constStr; } std::string str() const { return encode<Utf8Codec>(_constStr); } operator std::string() const { return encode<Utf8Codec>(_constStr); } }; class Utf8IOString : public Utf8OString { std::string& _str; public: explicit Utf8IOString(std::string& str) : Utf8OString(decode<Utf8Codec>(str)), _str(str) { } std::string& str() { return _str; } String ustr() const { return decode<Utf8Codec>(_str); } operator String() const { return decode<Utf8Codec>(_str); } }; /// Function, which creates a Utf8OString. /// This makes the syntactic sugar perfect. See the example at Utf8OString /// for its use. inline Utf8OString Utf8(const String& str) { return Utf8OString(str); } inline Utf8OString Utf8(const std::string& str) { return Utf8OString(decode<Utf8Codec>(str)); } /// Creates a Utf8IString with a reference to a deserializable object. /// See Utf8IString for a usage example. inline Utf8IOString Utf8(std::string& str) { return Utf8IOString(str); } inline void operator<<= (SerializationInfo& si, const Utf8OString& str) { si <<= str.ustr(); } inline void operator>>= (const SerializationInfo& si, Utf8IOString str) { String s; si >>= s; str.str() = encode<Utf8Codec>(s); } } #endif // CXXTOOLS_UTF8_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/iconverter.h����������������������������������������������������������0000664�0001750�0001750�00000007660�13644433072�016040� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ICONVERTER_H #define CXXTOOLS_ICONVERTER_H #include <cxxtools/iconvstream.h> #include <string> #include <sstream> namespace cxxtools { /** IConverter is a simple wrapper around cxxtools::iconvstream. Often the result of a character-conversion is needed as a std::string. This can be achived to let iconvstream to a ostringstream and get the string from the ostringstream. IConverter simplify this. example: convert a UTF8-encoded string to ISO8859-1: \code cxxtools::IConverter conv("ISO8859-1", "UTF8"); std::string utf8string = getUtf8String(); std::string iso8859_1 = conv.convert(utf8string); // or functor-style: std::string iso8859_1 = conv(utf8string); \endcode */ class IConverter { std::string tocode; std::string fromcode; public: IConverter() { } IConverter(const std::string& tocode_, const std::string& fromcode_) : tocode(tocode_), fromcode(fromcode_) { } void setToCode(const std::string& tocode_) { tocode = tocode_; } void setFromCode(const std::string& fromcode_) { fromcode = fromcode_; } const std::string& getToCode() const { return tocode; } const std::string& getFromCode() const { return fromcode; } template <typename objT> std::string convert(objT s) const { std::ostringstream o; iconvstream conv; conv.exceptions(std::ios::failbit | std::ios::badbit); conv.open(o, tocode.c_str(), fromcode.c_str()); conv << s << std::flush; return o.str(); } std::string convert(const char* data, unsigned size) const { std::ostringstream o; iconvstream conv; conv.exceptions(std::ios::failbit | std::ios::badbit); conv.open(o, tocode.c_str(), fromcode.c_str()); conv.write(data, size); conv.flush(); return o.str(); } template <typename iteratorT> std::string convertRange(iteratorT begin, iteratorT end) const { std::ostringstream o; iconvstream conv; conv.exceptions(std::ios::failbit | std::ios::badbit); conv.open(o, tocode.c_str(), fromcode.c_str()); for (iteratorT it = begin; it != end; ++it) conv << *it; conv.flush(); return o.str(); } template <typename objT> std::string operator() (objT s) const { return convert(s); } std::string operator() (const char* data, unsigned size) const { return convert(data, size); } }; } #endif // CXXTOOLS_ICONVERTER_H ��������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/serviceprocedure.h����������������������������������������������������0000664�0001750�0001750�00000057066�13644433072�017236� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SERVICEPROCEDURE_H #define CXXTOOLS_SERVICEPROCEDURE_H #include <cxxtools/composer.h> #include <cxxtools/decomposer.h> #include <cxxtools/void.h> #include <cxxtools/typetraits.h> #include <cxxtools/callable.h> namespace cxxtools { class ServiceProcedure { public: ServiceProcedure() {} virtual ~ServiceProcedure() {} virtual ServiceProcedure* clone() const = 0; virtual IComposer** beginCall() = 0; virtual IDecomposer* endCall() = 0; }; //! @cond internal // BasicServiceProcedure with 10 arguments template <typename R, typename A1 = Void, typename A2 = Void, typename A3 = Void, typename A4 = Void, typename A5 = Void, typename A6 = Void, typename A7 = Void, typename A8 = Void, typename A9 = Void, typename A10 = Void> class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = &_a8; _args[8] = &_a9; _args[9] = &_a10; _args[10] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); _a8.begin(_v8); _a9.begin(_v9); _a10.begin(_v10); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<A5>::Value V5; typedef typename TypeTraits<A6>::Value V6; typedef typename TypeTraits<A7>::Value V7; typedef typename TypeTraits<A8>::Value V8; typedef typename TypeTraits<A9>::Value V9; typedef typename TypeTraits<A10>::Value V10; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; V8 _v8; V9 _v9; V10 _v10; IComposer* _args[11]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Composer<V5> _a5; Composer<V6> _a6; Composer<V7> _a7; Composer<V8> _a8; Composer<V9> _a9; Composer<V10> _a10; Decomposer<RV> _r; }; // BasicServiceProcedure with 9 arguments template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> class BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = &_a8; _args[8] = &_a9; _args[9] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); _a8.begin(_v8); _a9.begin(_v9); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<A5>::Value V5; typedef typename TypeTraits<A6>::Value V6; typedef typename TypeTraits<A7>::Value V7; typedef typename TypeTraits<A8>::Value V8; typedef typename TypeTraits<A9>::Value V9; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; V8 _v8; V9 _v9; IComposer* _args[10]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Composer<V5> _a5; Composer<V6> _a6; Composer<V7> _a7; Composer<V8> _a8; Composer<V9> _a9; Decomposer<RV> _r; }; // BasicServiceProcedure with 8 arguments template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> class BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = &_a8; _args[8] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); _a8.begin(_v8); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<A5>::Value V5; typedef typename TypeTraits<A6>::Value V6; typedef typename TypeTraits<A7>::Value V7; typedef typename TypeTraits<A8>::Value V8; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4, A5, A6, A7, A8>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; V8 _v8; IComposer* _args[9]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Composer<V5> _a5; Composer<V6> _a6; Composer<V7> _a7; Composer<V8> _a8; Decomposer<RV> _r; }; // BasicServiceProcedure with 7 arguments template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> class BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4, A5, A6, A7>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<A5>::Value V5; typedef typename TypeTraits<A6>::Value V6; typedef typename TypeTraits<A7>::Value V7; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4, A5, A6, A7>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; IComposer* _args[8]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Composer<V5> _a5; Composer<V6> _a6; Composer<V7> _a7; Decomposer<RV> _r; }; // BasicServiceProcedure with 6 arguments template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> class BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4, A5, A6>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<A5>::Value V5; typedef typename TypeTraits<A6>::Value V6; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4, A5, A6>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; IComposer* _args[7]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Composer<V5> _a5; Composer<V6> _a6; Decomposer<RV> _r; }; // BasicServiceProcedure with 5 arguments template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5> class BasicServiceProcedure<R, A1, A2, A3, A4, A5, Void, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4, A5>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<A5>::Value V5; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4, A5>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; IComposer* _args[6]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Composer<V5> _a5; Decomposer<RV> _r; }; // BasicServiceProcedure with 4 arguments template <typename R, typename A1, typename A2, typename A3, typename A4> class BasicServiceProcedure<R, A1, A2, A3, A4, Void, Void, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3, A4>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<A4>::Value V4; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3, A4>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; IComposer* _args[5]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Composer<V4> _a4; Decomposer<RV> _r; }; // BasicServiceProcedure with 3 arguments template <typename R, typename A1, typename A2, typename A3> class BasicServiceProcedure<R, A1, A2, A3, Void, Void, Void, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2, A3>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<A3>::Value V3; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2, A3>* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; IComposer* _args[4]; Composer<V1> _a1; Composer<V2> _a2; Composer<V3> _a3; Decomposer<RV> _r; }; // BasicServiceProcedure with 2 arguments template <typename R, typename A1, typename A2> class BasicServiceProcedure<R, A1, A2, Void, Void, Void, Void, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1, A2>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<A2>::Value V2; typedef typename TypeTraits<R>::Value RV; Callable<R, A1, A2>* _cb; RV _rv; V1 _v1; V2 _v2; IComposer* _args[3]; Composer<V1> _a1; Composer<V2> _a2; Decomposer<RV> _r; }; // BasicServiceProcedure with 1 arguments template <typename R, typename A1> class BasicServiceProcedure<R, A1, Void, Void, Void, Void, Void, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R, A1>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<A1>::Value V1; typedef typename TypeTraits<R>::Value RV; Callable<R, A1>* _cb; RV _rv; V1 _v1; IComposer* _args[2]; Composer<V1> _a1; Decomposer<RV> _r; }; // BasicServiceProcedure with 0 arguments template <typename R> class BasicServiceProcedure<R, Void, Void, Void, Void, Void, Void, Void, Void, Void, Void> : public ServiceProcedure { public: BasicServiceProcedure( const Callable<R>& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { return _args; } IDecomposer* endCall() { _rv = _cb->call(); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits<R>::Value RV; Callable<R>* _cb; RV _rv; IComposer* _args[1]; Decomposer<RV> _r; }; //! @endcond internal } #endif // CXXTOOLS_SERVICEPROCEDURE_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/singleton.h�����������������������������������������������������������0000664�0001750�0001750�00000010656�13644433072�015661� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Singleton_h #define cxxtools_Singleton_h #include <memory> #include <cstdlib> namespace cxxtools { /** @brief Singleton class template @ingroup cxxtools @param T Type of the singleton @param A Allocator for type T The Singleton class template can be used to easily implement the Singleton design pattern. It can either be used directly or as a base class. An allocator can be used to control how the singleton instance will be allocated. The follwing example shows how to use the singleton as a base class: @code class MySingleton : public Singleton<MySingleton> { friend class Singleton<MySingleton>; // ... }; @endcode */ template <typename T, typename A = std::allocator<T> > class Singleton { Singleton(const Singleton&) { } Singleton& operator=(const Singleton&) { return *this; } public: typedef A Allocator; public: /** @brief Returns the instance of the singleton type When called for the first time, the singleton instance will be created with the specified alloctaor. All subsequent calls wikk return a reference to the previously created instance. @return The singleton instance */ static T& instance() { if(!_instance) { try { _instance = (T*)_allocator.allocate(1); new (_instance) T(); std::atexit(&atExit); } catch( const std::bad_alloc& e ) { throw e; } catch(...) { _allocator.deallocate(_instance, 1); _instance = 0; throw; } } return *_instance; } protected: /** @brief Constructor */ Singleton() { } /** @brief Destructor */ ~Singleton() { } private: /** @brief Exit handler This function is set as the program exit handler and will destroy the singleton instance at the end of the program using the specified allocator. */ static void atExit() { _instance->~T(); _allocator.deallocate(_instance, 1); _instance = 0; } private: static A _allocator; static T* _instance; }; template <typename T, typename A> A Singleton<T, A>::_allocator; template <typename T, typename A> T* Singleton<T, A>::_instance = 0; } // namespace cxxtools #endif ����������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/log.h�����������������������������������������������������������������0000664�0001750�0001750�00000002675�13644433072�014442� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LOG_H #define CXXTOOLS_LOG_H #include <cxxtools/log/cxxtools.h> #endif // CXXTOOLS_LOG_H �������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/���������������������������������������������������������������0000775�0001750�0001750�00000000000�13672344760�015071� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/client.h�������������������������������������������������������0000664�0001750�0001750�00000005573�13644433072�016444� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Client_h #define cxxtools_xmlrpc_Client_h #include <cxxtools/remoteclient.h> #include <string> namespace cxxtools { namespace xmlrpc { class ClientImpl; class Client : public RemoteClient { ClientImpl* _impl; protected: Client(Client& c) : _impl(c._impl) { } Client& operator= (const Client& c) { _impl = c._impl; return *this; } void impl(ClientImpl* i) { _impl = i; } public: Client() : _impl(0) { } virtual ~Client(); /// This method is used internally to initiate a rpc request. void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); /// This method is used internally to finalize a rpc request. void endCall(); /// This method is used internally to initiate a rpc request. void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); /// Returns the timeout for syncronous requests. /// When the timeout exprires before the request returns, a cxxtools::IOTimeout is thrown. /// On negative timeout the client will wait infinitely. This is the default. Milliseconds timeout() const; /// Sets the timeout for syncronous requests. void timeout(Milliseconds t); Milliseconds connectTimeout() const; void connectTimeout(Milliseconds t); std::string url() const; const IRemoteProcedure* activeProcedure() const; void cancel(); }; } } #endif �������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/errorcodes.h���������������������������������������������������0000664�0001750�0001750�00000004076�13644433072�017332� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_XMLRPC_ERRORCODES_H #define CXXTOOLS_XMLRPC_ERRORCODES_H namespace cxxtools { namespace xmlrpc { namespace ErrorCodes { static const int parseError = -32700; static const int unsupportedEncoding = -32701; static const int invalidCharacterForEncoding = -32702; static const int invalidXmlRpc = -32600; static const int methodNotFound = -32601; static const int invalidMethodParameters = -32602; static const int internalXmlRpcError = -32603; static const int applicationError = -32500; static const int systemError = -32400; static const int transportError = -32300; } } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/formatter.h����������������������������������������������������0000664�0001750�0001750�00000004715�13644433072�017166� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Formatter_h #define cxxtools_xmlrpc_Formatter_h #include <cxxtools/xml/xmlwriter.h> #include <cxxtools/formatter.h> #include <cxxtools/string.h> #include <string> #include <map> namespace cxxtools { namespace xmlrpc { class Formatter : public cxxtools::Formatter { public: Formatter(xml::XmlWriter& writer) : _writer(&writer) { } void addAlias(const std::string& type, const std::string& alias) { _typemap[type] = alias; } void attach(xml::XmlWriter& writer) { _writer = &writer; } void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value); void beginArray(const std::string& name, const std::string& type); void finishArray(); void beginObject(const std::string& name, const std::string& type); void beginMember(const std::string& name); void finishMember(); void finishObject(); void finish(); private: xml::XmlWriter* _writer; std::map<std::string, std::string> _typemap; }; } } #endif ���������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/httpclient.h���������������������������������������������������0000664�0001750�0001750�00000014757�13644433072�017350� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_HttpClient_h #define cxxtools_xmlrpc_HttpClient_h #include <cxxtools/xmlrpc/client.h> namespace cxxtools { class SelectorBase; namespace net { class AddrInfo; class Uri; } namespace xmlrpc { class HttpClientImpl; /** A cxxtools::xmlrpc::HttpClient executes xmlrpc requests on a xmlrpc server. */ class HttpClient : public Client { public: HttpClient() : _impl(0) { } explicit HttpClient(SelectorBase& selector) : _impl(0) { setSelector(selector); } explicit HttpClient(const net::AddrInfo& addr, const std::string& url, bool ssl = false) : _impl(0) { prepareConnect(addr, url, ssl); } HttpClient(const net::AddrInfo& addr, const std::string& url, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, url, sslCertificate); } HttpClient(const std::string& addr, unsigned short port, const std::string& url, bool ssl = false) : _impl(0) { prepareConnect(addr, port, url, ssl); } HttpClient(const std::string& addr, unsigned short port, const std::string& url, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, port, url, sslCertificate); } explicit HttpClient(const net::Uri& uri) : _impl(0) { prepareConnect(uri); } HttpClient(const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { prepareConnect(uri, sslCertificate); } HttpClient(SelectorBase& selector, const net::AddrInfo& addr, const std::string& url, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, url, ssl); } HttpClient(SelectorBase& selector, const net::AddrInfo& addr, const std::string& url, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, url, sslCertificate); } HttpClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& url, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, port, url, ssl); } HttpClient(SelectorBase& selector, const std::string& addr, const std::string& url, unsigned short port, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, port, url, sslCertificate); } HttpClient(SelectorBase& selector, const net::Uri& uri) : _impl(0) { setSelector(selector); prepareConnect(uri); } HttpClient(SelectorBase& selector, const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(uri, sslCertificate); } HttpClient(const HttpClient&); HttpClient& operator= (const HttpClient&); virtual ~HttpClient(); void prepareConnect(const net::AddrInfo& addr, const std::string& url, bool ssl = false); void prepareConnect(const net::AddrInfo& addr, const std::string& url, const std::string& sslCertificate); void prepareConnect(const std::string& host, unsigned short port, const std::string& url, bool ssl = false); void prepareConnect(const std::string& host, unsigned short port, const std::string& url, const std::string& sslCertificate); void prepareConnect(const net::Uri& uri); void prepareConnect(const net::Uri& uri, const std::string& sslCertificate); void connect(const net::AddrInfo& addrinfo, const std::string& url, bool ssl_ = false) { prepareConnect(addrinfo, url, ssl_); connect(); } void connect(const net::AddrInfo& addrinfo, const std::string& url, const std::string& sslCertificate) { prepareConnect(addrinfo, url, sslCertificate); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& url, bool ssl_ = false) { prepareConnect(host, port, url, ssl_); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& url, const std::string& sslCertificate) { prepareConnect(host, port, url, sslCertificate); connect(); } void connect(const net::Uri& uri) { prepareConnect(uri); connect(); } void connect(const net::Uri& uri, const std::string& sslCertificate) { prepareConnect(uri, sslCertificate); connect(); } void connect(); /// sets the url part void url(const std::string& url); /// sets username and password for authentification void auth(const std::string& username, const std::string& password); /// removes username and password for authentification void clearAuth(); void setSelector(SelectorBase* selector); void setSelector(SelectorBase& selector) { setSelector(&selector); } /// @see cxxtools::net::TcpSocket::setSslVerify void setSslVerify(int level, const std::string& ca = std::string()); void wait(Milliseconds msecs = WaitInfinite); private: HttpClientImpl* _impl; HttpClientImpl* getImpl(); }; } } #endif �����������������cxxtools-3.0/include/cxxtools/xmlrpc/service.h������������������������������������������������������0000664�0001750�0001750�00000003622�13644433072�016617� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Service_h #define cxxtools_xmlrpc_Service_h #include <cxxtools/http/service.h> #include <cxxtools/serviceregistry.h> namespace cxxtools { namespace xmlrpc { class Service : public http::Service, public ServiceRegistry { friend class XmlRpcResponder; public: Service() { } virtual ~Service(); protected: virtual http::Responder* createResponder(const http::Request&); virtual void releaseResponder(http::Responder* resp); }; } } #endif ��������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/scanner.h������������������������������������������������������0000664�0001750�0001750�00000004567�13644433072�016621� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Scanner_h #define cxxtools_xmlrpc_Scanner_h #include <cxxtools/string.h> namespace cxxtools { class Deserializer; class IComposer; namespace xml { class Node; } namespace xmlrpc { class Scanner { enum State { OnParam, OnValueBegin, OnValueEnd, //OnParamEnd, OnScalarBegin, OnScalar, OnScalarEnd, OnStructBegin, OnMemberBegin, OnNameBegin, OnName, OnNameEnd, //OnMemberEnd, OnStructEnd, OnArrayBegin, OnDataBegin, OnDataEnd, OnArrayEnd }; public: Scanner() : _state(OnParam) , _deserializer(0) , _composer(0) {} ~Scanner() {} void begin(Deserializer& handler, IComposer& composer); bool advance(const xml::Node& node); private: State _state; Deserializer* _deserializer; IComposer* _composer; String _value; String _type; }; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xmlrpc/responder.h����������������������������������������������������0000664�0001750�0001750�00000005754�13644433072�017170� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Responder_h #define cxxtools_xmlrpc_Responder_h #include <cxxtools/remoteexception.h> #include <cxxtools/xmlrpc/scanner.h> #include <cxxtools/xmlrpc/formatter.h> #include <cxxtools/xml/xmlreader.h> #include <cxxtools/xml/xmlwriter.h> #include <cxxtools/http/responder.h> #include <cxxtools/deserializer.h> #include <cxxtools/textstream.h> namespace cxxtools { class ServiceProcedure; class IComposer; class IDecomposer; namespace xmlrpc { class Service; class XmlRpcResponder : public http::Responder { enum State { OnBegin, OnMethodCallBegin, OnMethodNameBegin, OnMethodName, OnMethodNameEnd, OnParams, OnParam, OnParamsEnd, OnMethodCallEnd }; public: explicit XmlRpcResponder(Service& service); ~XmlRpcResponder(); void beginRequest(net::TcpSocket& socket, std::istream& in, http::Request& request); std::size_t readBody(std::istream& is); void replyError(std::ostream& os, http::Request& request, http::Reply& reply, const std::exception& ex); void reply(std::ostream& os, http::Request& request, http::Reply& reply); protected: void advance(const cxxtools::xml::Node& node); private: State _state; TextIStream _ts; xml::XmlReader _reader; xml::XmlWriter _writer; Scanner _scanner; Formatter _formatter; Deserializer _deserializer; Service* _service; ServiceProcedure* _proc; IComposer** _args; RemoteException _fault; }; } } #endif ��������������������cxxtools-3.0/include/cxxtools/http/�����������������������������������������������������������������0000775�0001750�0001750�00000000000�13672344760�014543� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/messageheader.h��������������������������������������������������0000664�0001750�0001750�00000012061�13644433072�017423� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_MessageHeader_h #define cxxtools_Http_MessageHeader_h #include <string> #include <cstring> #include <utility> namespace cxxtools { namespace http { class MessageHeader { public: static const unsigned MAXHEADERSIZE = 4096; private: char _rawdata[MAXHEADERSIZE]; // key_1\0value_1\0key_2\0value_2\0...key_n\0value_n\0\0 unsigned _endOffset; char* eptr() { return _rawdata + _endOffset; } unsigned _httpVersionMajor; unsigned _httpVersionMinor; public: typedef std::pair<const char*, const char*> value_type; class const_iterator : public std::iterator<std::forward_iterator_tag, value_type> { friend class MessageHeader; value_type current_value; void fixup() { if (*current_value.first) current_value.second = current_value.first + std::strlen(current_value.first) + 1; else current_value.first = current_value.second = 0; } void moveForward() { current_value.first = current_value.second + std::strlen(current_value.second) + 1; fixup(); } public: const_iterator() : current_value(0, 0) { } explicit const_iterator(const char* p) : current_value(p, p) { fixup(); } bool operator== (const const_iterator& it) const { return current_value.first == it.current_value.first; } bool operator!= (const const_iterator& it) const { return current_value.first != it.current_value.first; } const_iterator& operator++() { moveForward(); return *this; } const_iterator operator++(int) { const_iterator ret = *this; moveForward(); return ret; } const value_type& operator* () const { return current_value; } const value_type* operator-> () const { return ¤t_value; } }; MessageHeader() : _endOffset(0), _httpVersionMajor(1), _httpVersionMinor(1) { _rawdata[0] = _rawdata[1] = '\0'; } virtual ~MessageHeader() {} void clear(); void setHeader(const char* key, const char* value, bool replace = true); void addHeader(const char* key, const char* value) { setHeader(key, value, false); } void removeHeader(const char* key); const char* getHeader(const char* key) const; bool hasHeader(const char* key) const { return getHeader(key) != 0; } bool isHeaderValue(const char* key, const char* value) const; const_iterator begin() const { return const_iterator(_rawdata); } const_iterator end() const { return const_iterator(); } unsigned httpVersionMajor() const { return _httpVersionMajor; } unsigned httpVersionMinor() const { return _httpVersionMinor; } void httpVersion(unsigned major, unsigned minor) { _httpVersionMajor = major; _httpVersionMinor = minor; } bool chunkedTransferEncoding() const; std::size_t contentLength() const; bool keepAlive() const; /// Returns a properly formatted current time-string, as needed in http. /// The buffer must have at least 30 bytes. static char* htdateCurrent(char* buffer); }; } // namespace http } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/server.h���������������������������������������������������������0000664�0001750�0001750�00000012370�13644433072�016137� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Server_h #define cxxtools_Http_Server_h #include <cxxtools/signal.h> #include <cxxtools/delegate.h> #include <cxxtools/timespan.h> #include <string> namespace cxxtools { class EventLoopBase; class SslCertificate; class Regex; namespace http { class Request; class Service; class ServerImplBase; class Server { #if __cplusplus >= 201103L Server(const Server& server) = delete; Server& operator=(const Server& server) = delete; #else Server(const Server&) { } Server& operator=(const Server&) { return *this; } #endif ServerImplBase* newImpl(EventLoopBase& eventLoop); public: explicit Server(EventLoopBase& eventLoop) : _impl(newImpl(eventLoop)) { } Server(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(ip, port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } Server(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(ip, port, certificateFile, certificateFile, sslVerifyLevel, sslCa); } Server(EventLoopBase& eventLoop, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } Server(EventLoopBase& eventLoop, unsigned short int port, const std::string& certificateFile, int sslVerifyLevel, const std::string& sslCa = std::string()) : _impl(newImpl(eventLoop)) { listen(port, certificateFile, certificateFile, sslVerifyLevel, sslCa); } ~Server(); /** Listen to the specified ip and port. * * When a certificate file is given, ssl is enabled. If no private key file is given, the private key * is expected to be in the certificate file. * * Multiple listen calls can be made to listen on multiple interfaces or different settings. */ void listen(const std::string& ip, unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()); void listen(unsigned short int port, const std::string& certificateFile = std::string(), const std::string& privateKeyFile = std::string(), int sslVerifyLevel = 0, const std::string& sslCa = std::string()) { listen(std::string(), port, certificateFile, privateKeyFile, sslVerifyLevel, sslCa); } void addService(const std::string& url, Service& service); void addService(const Regex& url, Service& service); void removeService(Service& service); Milliseconds readTimeout() const; Milliseconds writeTimeout() const; Milliseconds keepAliveTimeout() const; void readTimeout(Milliseconds ms); void writeTimeout(Milliseconds ms); void keepAliveTimeout(Milliseconds ms); unsigned minThreads() const; void minThreads(unsigned m); unsigned maxThreads() const; void maxThreads(unsigned m); enum Runmode { Stopped, Starting, Running, Terminating, Failed }; Signal<Runmode> runmodeChanged; Delegate<bool, const SslCertificate&>& acceptSslCertificate(); private: ServerImplBase* _impl; }; } // namespace http } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/client.h���������������������������������������������������������0000664�0001750�0001750�00000031764�13644433072�016117� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Client_h #define cxxtools_Http_Client_h #include <cxxtools/http/reply.h> #include <cxxtools/query_params.h> #include <cxxtools/selectable.h> #include <cxxtools/signal.h> #include <cxxtools/delegate.h> #include <string> namespace cxxtools { class SslCertificate; class SelectorBase; namespace net { class AddrInfo; class Uri; } namespace http { class ClientImpl; class ReplyHeader; class Request; /** This class implements a http client. The class supports syncronous and asyncronous requests. For connection handling see \ref connection. For asyncronous I/O see \ref asyncronousIO. Example for a syncronous call: \code cxxtools::http::Client client("www.tntnet.org", 80); std::string indexPage = client.get("/"); \endcode */ class Client { ClientImpl* _impl; ClientImpl* getImpl(); const ClientImpl* getImpl() const { return const_cast<Client*>(this)->getImpl(); } public: /// default constructor. Client() : _impl(0) { } explicit Client(SelectorBase& selector) : _impl(0) { setSelector(selector); } /**@{ constructors which set the connection parameters. Note that the Uri class has a non explicit constructor from std::string. The protocol of the uri must be http or https. The url part of the uri is ignored. example: \code cxxtools::http::Client client("http://localhost:8000/"); \endcode */ explicit Client(const net::AddrInfo& addr, bool ssl = false) : _impl(0) { prepareConnect(addr, ssl); } Client(const net::AddrInfo& addr, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, sslCertificate); } Client(const std::string& addr, unsigned short port, bool ssl = false) : _impl(0) { prepareConnect(addr, port, ssl); } Client(const std::string& addr, unsigned short port, const std::string& sslCertificate) : _impl(0) { prepareConnect(addr, port, sslCertificate); } explicit Client(const net::Uri& uri) : _impl(0) { prepareConnect(uri); } Client(const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { prepareConnect(uri, sslCertificate); } Client(SelectorBase& selector, const net::AddrInfo& addr, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, ssl); } Client(SelectorBase& selector, const net::AddrInfo& addr, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, sslCertificate); } Client(SelectorBase& selector, const std::string& addr, unsigned short port, bool ssl = false) : _impl(0) { setSelector(selector); prepareConnect(addr, port, ssl); } Client(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(addr, port, sslCertificate); } Client(SelectorBase& selector, const net::Uri& uri) : _impl(0) { setSelector(selector); prepareConnect(uri); } Client(SelectorBase& selector, const net::Uri& uri, const std::string& sslCertificate) : _impl(0) { setSelector(selector); prepareConnect(uri, sslCertificate); } ///@} /** Copy and assignment. Copying the class results in a copy which references to the same implementation instance. Since one client can have only one running request and the copy shares the same implementation the copy can't run another request. */ Client(const Client&); Client& operator= (const Client&); virtual ~Client(); /** The prepareConnect methods set the host and port of the server for this http client. No actual network connect is done. \see \ref connection */ void prepareConnect(const net::AddrInfo& addr, bool ssl = false); void prepareConnect(const net::AddrInfo& addr, const std::string& sslCertificate); void prepareConnect(const std::string& host, unsigned short port, bool ssl = false); void prepareConnect(const std::string& host, unsigned short port, const std::string& sslCertificate); void prepareConnect(const net::Uri& uri); void prepareConnect(const net::Uri& uri, const std::string& sslCertificate); /** Connects to the client specified by prepareConnect or passed by teh constructor. This happens actually automatically when needed. It just helps checking whether the server is reachable, since setting the connection paramters do not check it. */ void connect(); /** Closes the network connection if connected. The network connection is automaticalle initiated on the next request. The method do not discard the current connection parameters. */ void close(); ///@{ `connect` Sets the network parameters and connects the socket. void connect(const net::AddrInfo& addrinfo, bool ssl_ = false) { prepareConnect(addrinfo, ssl_); connect(); } void connect(const net::AddrInfo& addrinfo, const std::string& sslCertificate) { prepareConnect(addrinfo, sslCertificate); connect(); } void connect(const std::string& host, unsigned short int port, bool ssl_ = false) { prepareConnect(host, port, ssl_); connect(); } void connect(const std::string& host, unsigned short int port, const std::string& sslCertificate) { prepareConnect(host, port, sslCertificate); connect(); } void connect(const net::Uri& uri) { prepareConnect(uri); connect(); } void connect(const net::Uri& uri, const std::string& sslCertificate) { prepareConnect(uri, sslCertificate); connect(); } ///@} /** Sends the passed request to the server and parses the headers. The body must be read with readBody. This method blocks or times out until the body is parsed. When connectTimeout is set to WaitInfinite but timeout is set to something else, the connectTimeout is set to timeout as well. */ const ReplyHeader& execute(const Request& request, Milliseconds timeout = Selectable::WaitInfinite, Milliseconds connectTimeout = Selectable::WaitInfinite); /** Reads the http body after header read with execute. This method blocks until the body is received. */ const Reply& readBody(); /** Returns the reply of the last executed request. */ const Reply& reply() const; Reply& reply(); /** Returns the headers of the last executed reply. The headers can be read after calling execute(). */ const ReplyHeader& header() const { return reply().header(); } /** Returns the body of the last executed request. The readBody() method must be called before the body is available. */ std::string body() const { return reply().body(); } /** Executes a GET request with query parameters. This method blocks until the reply is recieved. When connectTimeout is set to WaitInfinite but timeout is set to something else, the connectTimeout is set to timeout as well. */ const Reply& get(const std::string& url, const QueryParams& qparams, Milliseconds timeout = Selectable::WaitInfinite, Milliseconds connectTimeout = Selectable::WaitInfinite); /** Executes a GET request. This method blocks until the reply is recieved. When connectTimeout is set to WaitInfinite but timeout is set to something else, the connectTimeout is set to timeout as well. */ const Reply& get(const std::string& url, Milliseconds timeout = Selectable::WaitInfinite, Milliseconds connectTimeout = Selectable::WaitInfinite) { return get(url, QueryParams(), timeout, connectTimeout); } /** Executes a POST request with query parameters. This method blocks until the reply is recieved. When connectTimeout is set to WaitInfinite but timeout is set to something else, the connectTimeout is set to timeout as well. */ const Reply& post(const std::string& url, const QueryParams& qparams, Milliseconds timeout = Selectable::WaitInfinite, Milliseconds connectTimeout = Selectable::WaitInfinite); /** Executes a POST request. This method blocks until the reply is recieved. When connectTimeout is set to WaitInfinite but timeout is set to something else, the connectTimeout is set to timeout as well. */ const Reply& post(const std::string& url, Milliseconds timeout = Selectable::WaitInfinite, Milliseconds connectTimeout = Selectable::WaitInfinite) { return post(url, QueryParams(), timeout, connectTimeout); } /** Starts a new request. This method does not block. To actually process the request, the event loop must be executed. The state of the request is signaled with the corresponding signals and delegates. The delegate "bodyAvailable" must be connected, if a body is received. */ void beginExecute(const Request& request); /** Finishes the request. When the signal replyFinished is issued, the user has to call endExecute. This may throw an exception when something went wrong. */ void endExecute(); /// Sets the selector for asyncronous event processing. void setSelector(SelectorBase* selector); void setSelector(SelectorBase& selector); /// @see cxxtools::net::TcpSocket::setSslVerify void setSslVerify(int level, const std::string& ca = std::string()); /// Returns the selector for asyncronous event processing. SelectorBase* selector(); /** Executes the underlying selector until a event occurs or the specified timeout is reached. */ bool wait(Milliseconds msecs); /** Returns the underlying stream, where the reply is to be read from. */ std::istream& in(); const std::string& host() const; unsigned short int port() const; /** Sets the username and password for all subsequent requests. Basic authorization is used always. */ void auth(const std::string& username, const std::string& password); /** Clears the username and password for all subsequent requests. */ void clearAuth(); void cancel(); /// Signals that the request is sent to the server. Signal<Client&> requestSent; /// Signals that the header is received. Signal<Client&> headerReceived; /// This delegate is called, when data is arrived while reading the /// body. The connected functor must return the number of bytes read. cxxtools::Delegate<std::size_t, Client&> bodyAvailable; /// Signals that the reply is completely processed. Signal<Client&> replyFinished; Delegate<bool, const SslCertificate&>& acceptSslCertificate(); }; } // namespace http } // namespace cxxtools #endif ������������cxxtools-3.0/include/cxxtools/http/reply.h����������������������������������������������������������0000664�0001750�0001750�00000006246�13644433072�015771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Reply_h #define cxxtools_Http_Reply_h #include <cxxtools/http/replyheader.h> #include <string> #include <sstream> namespace cxxtools { namespace http { class Request; class Reply { ReplyHeader _header; std::stringstream _body; public: Reply() { } ReplyHeader& header() { return _header; } const ReplyHeader& header() const { return _header; } void setHeader(const char* key, const char* value) { _header.setHeader(key, value); } void addHeader(const char* key, const char* value) { _header.addHeader(key, value); } void removeHeader(const char* key) { _header.removeHeader(key); } const char* getHeader(const char* key) const { return _header.getHeader(key); } bool hasHeader(const char* key) const { return _header.hasHeader(key); } void clear() { _header.clear(); _body.clear(); _body.str(std::string()); } unsigned httpReturnCode() const { return _header.httpReturnCode(); } const std::string& httpReturnText() const { return _header.httpReturnText(); } void httpReturn(unsigned c, const std::string& t) { _header.httpReturn(c, t); } std::string body() const { return _body.str(); } std::stringstream& bodyStream() { return _body; } std::size_t bodySize() const { return _body.str().size(); } void sendBody(std::ostream& out) const { out << _body.str(); } operator std::string() const { return _body.str(); } }; } // namespace http } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/request.h��������������������������������������������������������0000664�0001750�0001750�00000006720�13644433072�016323� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Request_h #define cxxtools_Http_Request_h #include <cxxtools/http/requestheader.h> #include <string> #include <sstream> namespace cxxtools { namespace http { class Request { RequestHeader _header; std::ostringstream _body; public: struct Auth { std::string user; std::string password; }; explicit Request(const std::string& url = std::string()) : _header(url) { } RequestHeader& header() { return _header; } const RequestHeader& header() const { return _header; } void setHeader(const char* key, const char* value) { _header.setHeader(key, value); } void addHeader(const char* key, const char* value) { _header.addHeader(key, value); } void removeHeader(const char* key) { _header.removeHeader(key); } const char* getHeader(const char* key) const { return _header.getHeader(key); } bool hasHeader(const char* key) const { return _header.hasHeader(key); } void clear() { _header.clear(); _body.clear(); _body.str(std::string()); } const std::string& url() const { return _header.url(); } void url(const std::string& u) { _header.url(u); } const std::string& method() const { return _header.method(); } void method(const std::string& m) { _header.method(m); } const std::string& qparams() const { return _header.qparams(); } void qparams(const std::string& q) { _header.qparams(q); } std::string bodyStr() const { return _body.str(); } std::ostream& body() { return _body; } std::size_t bodySize() const { return _body.str().size(); } void sendBody(std::ostream& out) const { out << _body.str(); } Auth auth() const; }; } // namespace http } // namespace cxxtools #endif ������������������������������������������������cxxtools-3.0/include/cxxtools/http/service.h��������������������������������������������������������0000664�0001750�0001750�00000006476�13644433072�016303� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Service_h #define cxxtools_Http_Service_h #include <cxxtools/mutex.h> #include <cxxtools/condition.h> #include <vector> #include <string> namespace cxxtools { namespace http { class Responder; class Request; class Authenticator { protected: virtual ~Authenticator() { } public: virtual bool checkAuth(const Request&) const = 0; }; class Service { std::vector<const Authenticator*> _authenticators; std::string _realm; std::string _authContent; unsigned _responderCount; Mutex _mutex; Condition _isIdle; public: Service() : _responderCount(0) { } virtual ~Service() { } Responder* doCreateResponder(const Request&); void doReleaseResponder(Responder*); bool checkAuth(const Request& request); void setRealm(const std::string& realm, const std::string& content = std::string()) { _realm = realm; _authContent = content; } const std::string& realm() const { return _realm; } const std::string& authContent() const { return _authContent; } void addAuthenticator(const Authenticator* auth) { _authenticators.push_back(auth); } void waitIdle(); protected: virtual Responder* createResponder(const Request&) = 0; virtual void releaseResponder(Responder*) = 0; }; class CachedServiceBase : public Service { typedef std::vector<Responder*> Responders; Responders responders; public: ~CachedServiceBase(); protected: virtual Responder* newResponder() = 0; Responder* createResponder(const Request& request); void releaseResponder(Responder* resp); }; template <typename ResponderType> class CachedService : public CachedServiceBase { virtual Responder* newResponder() { return new ResponderType(*this); } }; } // namespace http } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/requestheader.h��������������������������������������������������0000664�0001750�0001750�00000005021�13644433072�017465� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_RequestHeader_h #define cxxtools_Http_RequestHeader_h #include <cxxtools/http/messageheader.h> #include <string> namespace cxxtools { namespace http { class RequestHeader : public MessageHeader { std::string _url; std::string _method; std::string _qparams; public: explicit RequestHeader(const std::string& url = std::string()) : _url(url), _method("GET") { } virtual ~RequestHeader() {} void clear() { MessageHeader::clear(); _method = "GET"; _qparams.clear(); } const std::string& url() const { return _url; } void url(const std::string& u) { _url = u; } const std::string& method() const { return _method; } void method(const std::string& m) { _method = m; } const std::string& qparams() const { return _qparams; } void qparams(const std::string& q) { _qparams = q; } std::string query() const { return _qparams.empty() ? _url : _url + '?' + _qparams; } }; } // namespace http } // namespace cxxtools #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/replyheader.h����������������������������������������������������0000664�0001750�0001750�00000004412�13644433072�017133� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_ReplyHeader_h #define cxxtools_Http_ReplyHeader_h #include <cxxtools/http/messageheader.h> namespace cxxtools { namespace http { class RequestHeader; class ReplyHeader : public MessageHeader { unsigned _httpReturnCode; std::string _httpReturnText; public: ReplyHeader() : _httpReturnCode(200), _httpReturnText("OK") { } void clear() { MessageHeader::clear(); _httpReturnCode = 200; _httpReturnText = "OK"; } unsigned httpReturnCode() const { return _httpReturnCode; } const std::string& httpReturnText() const { return _httpReturnText; } void httpReturn(unsigned c, const std::string& t) { _httpReturnCode = c; _httpReturnText = t; } }; } // namespace http } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/http/responder.h������������������������������������������������������0000664�0001750�0001750�00000004414�13644433072�016632� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Responder_h #define cxxtools_Http_Responder_h #include <cxxtools/http/service.h> #include <iosfwd> #include <exception> namespace cxxtools { namespace net { class TcpSocket; } namespace http { class Request; class Reply; class Responder { public: explicit Responder(Service& service) : _service(service) { } virtual ~Responder() { } virtual void beginRequest(net::TcpSocket& socket, std::istream& in, Request& request); virtual std::size_t readBody(std::istream&); virtual void reply(std::ostream&, Request& request, Reply& reply) = 0; virtual void replyError(std::ostream&, Request& request, Reply& reply, const std::exception& ex); void release() { _service.doReleaseResponder(this); } private: Service& _service; Request* _request; }; } // namespace http } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/facets.h��������������������������������������������������������������0000664�0001750�0001750�00000006124�13644433072�015117� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FACETS_H #define CXXTOOLS_FACETS_H #include <cxxtools/string.h> #include <iosfwd> namespace std { /** @brief Numpunct localization facet @ingroup Unicode */ template <> class numpunct<cxxtools::Char> : public locale::facet { public: typedef cxxtools::Char char_type; typedef basic_string<cxxtools::Char> string_type; // gcc 3.4.x violates the c++ standard by requiring a __numpunct_cache #if __GLIBCXX__ <= 20051201 && __GLIBCXX__ >= 20040419 typedef __numpunct_cache<cxxtools::Char> __cache_type; #endif static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit numpunct(size_t refs = 0); virtual ~numpunct(); char_type decimal_point() const; char_type thousands_sep() const; string grouping() const; string_type truename() const; string_type falsename() const; protected: virtual char_type do_decimal_point() const; virtual char_type do_thousands_sep() const; virtual string do_grouping() const; virtual string_type do_truename() const; virtual string_type do_falsename() const; }; } // namespace std namespace cxxtools { static std::ios_base::Init cxxtools_stream_init; static struct InitLocale { InitLocale() { std::locale::global( std::locale(std::locale(), new std::ctype<cxxtools::Char>) ); std::locale::global( std::locale(std::locale(), new std::numpunct<cxxtools::Char>) ); std::locale::global( std::locale(std::locale(), new std::num_get<cxxtools::Char>) ); std::locale::global( std::locale(std::locale(), new std::num_put<cxxtools::Char>) ); } } cxxtools_init_locale; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/������������������������������������������������������������������0000775�0001750�0001750�00000000000�13672344760�014364� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/enddocument.h�����������������������������������������������������0000664�0001750�0001750�00000004571�13644433072�016763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_EndDocument_h #define cxxtools_Xml_EndDocument_h #include <cxxtools/xml/node.h> namespace cxxtools { namespace xml { /** * @brief A Node which represents the end of the XML document. * * The last Node/Element which is read from a document is the EndDocument-node. It is read after * the last tag, Text or comment was read from the XML document. This is similar to an eof character * at the end of a file read. * * @see Node */ class EndDocument : public Node { public: //! Creates an EndDocument object. EndDocument() : Node(Node::EndDocument) { } /** * @brief Clones this EndDocument object by creating a duplicate on the heap and returning it. * @return A cloned version of this EndDocument object. */ EndDocument* clone() const { return new EndDocument(*this); } }; } } #endif ���������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/entityresolver.h��������������������������������������������������0000664�0001750�0001750�00000010416�13644433072�017547� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_EntityResolver_h #define cxxtools_xml_EntityResolver_h #include <cxxtools/string.h> #include <map> namespace cxxtools { namespace xml { /** * @brief Entity resolver class which associates entities to resolved entity values. * * Entities can be added to this class using the method addEntity(). This method takes * the entity and the resolved entity value. To resolve the resolves value for an entity * the method resolveEntity() can be used. */ class EntityResolver { public: /** * @brief Constructs a new Resolver object and initializes the entity list using the XML default entities. * * The constructor calls clear() which clears the entity list and adds the XML default entities. */ EntityResolver() { } /** * @brief Resets the entity list to the XML default entities. * * The default entities are all entities from HTML4 */ void clear() { _entityMap.clear(); } /** * @brief Adds the given entity and the given resolved entity value (token) to the entity list. * * To determine the resolved entity value of a entity the method resolveEntity() can be used. * * @param entity A list entry for this entity is created and associated with the also given token. * @param token The resolved entity value that is associated with the also given entity. */ void addEntity(const String& entity, const String& token) { _entityMap.insert( std::pair<String, String>(entity, token) ); } /** * @brief Returns the resolved entity value (token) for the given entity. * * If the entity is not in the list or an dec or hex entity is invalid an exception is thrown. * * @param entity The resolved entity value for this entity is returned. * @return The resolved entity. * @throws XmlError if the entity is not in the list. * */ String resolveEntity(const String& entity) const; /** * @brief Returns the entity value (token) of the given character. * * Returns the entity of the given char. If there is no entity found, either the * given character as a string or a numeric entity is returned depending of the * passed flag. */ String getEntity(Char ch) const; /** * @brief Outputs the entity value (token) of the given character. * * Returns the entity of the given char. If there is no entity found, either the * given character as a string or a numeric entity is returned depending of the * passed flag. */ void getEntity(std::basic_ostream<Char>& os, Char ch) const; private: //! Entity map containing entities which are associated to their resolved entity value. typedef std::map<String, String> EntityMap; EntityMap _entityMap; }; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xmlerror.h��������������������������������������������������������0000664�0001750�0001750�00000005212�13644433072�016321� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlError_h #define cxxtools_Xml_XmlError_h #include <stdexcept> namespace cxxtools { namespace xml { //! Exception that is thrown when a parse error occured. class XmlError : public std::runtime_error { public: /** * @brief Creates a new ParseError object using the given reason and source info. * * @param what The reason of the parse error. * @param info Source info containing information about where the exception occured. */ XmlError(const std::string& what, unsigned line); unsigned line() const { return _line; } private: unsigned _line; }; /// Exception is thrown when trying to read a xml document but nothing was read. /// /// It may not be really an error but just eof when no document is read at all. class XmlNoDocument : public XmlError { public: explicit XmlNoDocument(unsigned line) : XmlError("no xml document read", line) { } }; /// Exception is thrown when trying to read a xml document but the underlying stream fails. /// /// It is really an error if a document is just partly read. class XmlUnexpectedEndOfDocument : public XmlError { public: explicit XmlUnexpectedEndOfDocument(unsigned line) : XmlError("unexpected end of xml", line) { } }; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xmlwriter.h�������������������������������������������������������0000664�0001750�0001750�00000011426�13644433072�016510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlWriter_h #define cxxtools_Xml_XmlWriter_h #include <cxxtools/string.h> #include <cxxtools/textstream.h> #include <cxxtools/xml/attribute.h> #include <stack> namespace cxxtools { namespace xml { class XmlWriter { public: XmlWriter(); XmlWriter(std::ostream& os, int format = UseXmlDeclaration | UseIndent | UseEndl); void begin(std::ostream& os); void writeStartElement(const cxxtools::String& localName); void writeStartElement(const cxxtools::String& localName, const Attribute* attr, size_t attrCount); void writeStartElement(const cxxtools::String& localName, const Attributes& attr) { writeStartElement(localName, &attr[0], attr.size()); } void writeEndElement(); void writeElement(const cxxtools::String& localName, const cxxtools::String& content); void writeElement(const cxxtools::String& localName, const Attribute* attr, size_t attrCount, const cxxtools::String& content); void writeElement(const cxxtools::String& localName, const Attributes& attr, const cxxtools::String& content) { writeElement(localName, &attr[0], attr.size(), content); } void writeContent(const cxxtools::String& text); void writeCharacters(const cxxtools::String& text); void flush(); void endl(); enum FormatFlags { UseXmlDeclaration = 1, UseIndent = 2, UseEndl = 4 }; void setFormat(int f) { _flags = f; } void setFormatFlags(int f, bool sw = true) { if (sw) _flags |= f; else _flags &= ~f; } int format() const { return _flags; } bool useXmlDeclaration() const { return _flags & UseXmlDeclaration; } void useXmlDeclaration(bool sw) { setFormatFlags(UseXmlDeclaration, sw); } bool useIndent() const { return _flags & UseIndent; } void useIndent(bool sw) { setFormatFlags(UseIndent, sw); } bool useEndl() const { return _flags & UseEndl; } void useEndl(bool sw) { setFormatFlags(UseEndl, sw); } void beautify(bool sw) { _flags = sw ? (UseXmlDeclaration | UseIndent | UseEndl) : 0; } class Element { public: Element(XmlWriter& writer, const cxxtools::String& localName) : _writer(writer) { _writer.writeStartElement(localName); } Element(XmlWriter& writer, const cxxtools::String& localName, const Attribute* attr, size_t attrCount) : _writer(writer) { _writer.writeStartElement(localName, attr, attrCount); } Element(XmlWriter& writer, const cxxtools::String& localName, const Attributes& attr) : _writer(writer) { _writer.writeStartElement(localName, attr); } ~Element() { _writer.writeEndElement(); } void writeContent(const String& text); private: XmlWriter& _writer; }; private: void indent(size_t size); void indent(); TextOStream _tos; std::stack<cxxtools::String> _elements; int _flags; }; inline void XmlWriter::indent() { indent(_elements.size()); } } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/characters.h������������������������������������������������������0000664�0001750�0001750�00000013245�13644433072�016573� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_Characters_h #define cxxtools_xml_Characters_h #include <cxxtools/xml/node.h> #include <cxxtools/string.h> namespace cxxtools { namespace xml { /** * @brief A Character element (Node) of an XML document, containing the body's Text of a tag. * * A Character element stores the data of a tag's body. The data is interpreted before it * is set as content of a Character element. This means that entities were translated into * their corresponding character sequence, ... * * Use content() to get the content of the CDATA element. * * When parsing a tag $<a>This is the body's Text</a>$ the following content will be * returned by content(): $This is the body's Text$ * * @see Node */ class Characters : public Node { public: /** * @brief Constructs a new Character object with the given (optional) string as content. * * @param content The content of the Character object. This is an optional parameter. * Default is an empty string. */ explicit Characters( const String& content = String() ) : Node(Node::Characters), _content(content) { } /** * @brief Clones this Character object by creating a duplicate on the heap and returning it. * @return A cloned version of this Character object. */ Characters* clone() const { return new Characters(*this); } /** * @brief Returns $true$ if the content of this Character object is empty; $false$ otherwise. * @return $true$ if the content of this Character object is empty; $false$ otherwise. */ bool empty() const { return _content.empty(); } void clear() { _content.clear(); } /** * @brief Returns the content of this Character object. * * The content includes the Text inside a tag's body. The Text is interpreted before it * is returned, this means that for example entities are translated into their corresponding * character sequence. When parsing a tag $<a>This is the body's Text</a>$ the followin * content will be returned: $This is the body's Text$ * * @return The content of this Character object. */ String& content() { return _content; } /** * @brief Returns the content of this Character object. * * The content includes the Text inside a tag's body. The Text is interpreted before it * is returned, this means that for example entities are translated into their corresponding * character sequence. When parsing a tag $<a>This is the body's Text</a>$ the followin * content will be returned: $This is the body's Text$ * * @return The content of this Character object. */ const String& content() const { return _content; } /** * @brief Sets the content of this Character object. * @param content The new content for this Character object. */ void setContent(const String& content) { _content = content; } /** * @brief Compares this Character object with the given node. * * This method returns $true$ if the given node also is a Character object and * the content of both Character objects is the same. Otherwise it returns $false$. * * @param node This Node object is compared to the current Character node object. * @return $true if this Character object is the same as the given node. */ virtual bool operator==(const Node& node) const; private: //! The content of this Character object. String _content; }; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/namespace.h�������������������������������������������������������0000664�0001750�0001750�00000010636�13644433072�016411� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_Namespace_h #define cxxtools_Xml_Namespace_h #include <cxxtools/string.h> #include <iosfwd> namespace cxxtools { namespace xml { /** * @brief A Namespace element (Node) of an XML document. * * A namespace element stores a namespace uri which describes the namespace URI and a locally * usable prefix which can be added before a tag name to specify that this particular tag * is part of that namespace. * * Use namespaceUri() to get the namespace URI. Use prefix() to get the prefix. * * @see Node * @see NamespaceContext */ class Namespace { public: /** * @brief Constructs a new Namespace object with the given namespace URI and prefix. * * @param namespaceURI The unique URI of this namespace. * @param prefix The namespace prefix which can be added to a tag name to specify that * this tag belongs to that namespace. */ Namespace(const String& namespaceUri, const String& prefix) : _prefix(prefix), _namespaceUri(namespaceUri) { } /** * @brief Returns the prefix of this namespace. * * The namespace prefix can be added to a tag name to specify that this tag belongs * to that namespace. * * @return The namespace prefix of this Namespace object. */ const String& prefix() const { return _prefix; } /** * @brief Sets the prefix of this namespace. * * The namespace prefix can be added to a tag name to specify that this tag belongs * to that namespace. * * @param prefix The namespace prefix for this Namespace object. */ void setPrefix(const String& prefix) { _prefix = prefix; } /** * @brief Returns the URI of this namespace. * * The URI is unique and identifies the namespace. * * @return The namespace URI of this Namespace object. */ const String& namespaceUri() const { return _namespaceUri; } /** * @brief Sets the URI of this namespace. * * The URI is unique and identifies the namespace. * * @param namespaceUri The namespace URI for this Namespace object. */ void setNamespaceUri(const String& namespaceUri) { _namespaceUri = namespaceUri; } /** * @brief Returns $true$ if this is the default namespace in the current XML document. Otherwise * $false$ is returned. * * @return $true$ if this is the default namespace; $false$ otherwise. */ bool isDefaultNamespaceDeclaration(); private: //! The prefix of this namespace. String _prefix; //! The namespace URI of this namespace. String _namespaceUri; }; } } #endif ��������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xmldeserializer.h�������������������������������������������������0000664�0001750�0001750�00000014003�13644433072�017650� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef xis_cxxtools_XmlDeserializer_h #define xis_cxxtools_XmlDeserializer_h #include <cxxtools/string.h> #include <cxxtools/deserializer.h> #include "cxxtools/xml/xmlreader.h" #include "cxxtools/xml/startelement.h" #include <sstream> namespace cxxtools { namespace xml { class XmlReader; /** @brief Deserialize objects or object data to XML Thic class performs XML deserialization of a single object or object data. */ class XmlDeserializer : public Deserializer { public: /** Initializes a deserializer. To read a xml structure, the parse method has to be called. */ explicit XmlDeserializer(bool readAttributes = false, const String& attributePrefix = cxxtools::String()) : _readAttributes(readAttributes), _attributePrefix(attributePrefix) { } /** Initializes a deserializer and reads a xml structure into the underlying SerializationInfo. */ explicit XmlDeserializer(XmlReader& reader, bool readAttributes = false, const String& attributePrefix = cxxtools::String()); /** Initializes a deserializer and reads a xml structure into the underlying SerializationInfo. */ explicit XmlDeserializer(std::istream& is, bool readAttributes = false, const String& attributePrefix = cxxtools::String()); /** Reads a xml structure into the underlying SerializationInfo. */ void parse(XmlReader& reader); /** Reads a xml structure into the underlying SerializationInfo. */ void parse(std::istream& is); /** Reads a xml structure into the underlying SerializationInfo. */ void parse(std::basic_istream<Char>& is); /** Specifies whether xml attributes should be read into members. By default attributes are ignored. When the flag is set, attributes are added as scalar members. */ void readAttributes(bool readAttributes) { _readAttributes = readAttributes; } /** Returns true, when the readAttribute flag is set. */ bool readAttributes() const { return _readAttributes; } /** When reading attributes, the member names can be prefixed with a string. The string is set with this method. */ void attributePrefix(const String& attributePrefix) { _attributePrefix = attributePrefix; } /** When reading attributes, the member names can be prefixed with a string. The currently set string is returned with this method. */ const String& attributePrefix() const { return _attributePrefix; } template <typename T> static void toObject(const std::string& str, T& type, bool readAttributes = false) { std::istringstream in(str); XmlDeserializer d(in, readAttributes); d.deserialize(type); } template <typename T> static void toObject(XmlReader& in, T& type, bool readAttributes = false) { XmlDeserializer d(in, readAttributes); d.deserialize(type); } template <typename T> static void toObject(std::istream& in, T& type, bool readAttributes = false) { XmlDeserializer d(in, readAttributes); d.deserialize(type); } private: //! @internal void beginDocument(XmlReader& reader); //! @internal void onRootElement(XmlReader& reader); //! @internal void onStartElement(XmlReader& reader); //! @internal void onWhitespace(XmlReader& reader); //! @internal void onContent(XmlReader& reader); //! @internal void onEndElement(XmlReader& reader); //! @internal typedef void (XmlDeserializer::*ProcessNode)(XmlReader&); //! @internal ProcessNode _processNode; size_t _startDepth; bool _readAttributes; //! @internal String _nodeName; String _nodeId; String _nodeType; String _nodeCategory; Attributes _attributes; String _attributePrefix; SerializationInfo::Category nodeCategory() const; void processAttributes(const Attributes& attributes); }; } // namespace xml } // namespace cxxtools #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/endelement.h������������������������������������������������������0000664�0001750�0001750�00000012721�13644433072�016572� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_EndElement_h #define cxxtools_xml_EndElement_h #include <cxxtools/xml/node.h> #include <cxxtools/string.h> namespace cxxtools { namespace xml { /** * @brief An end element (Node) which represents a closing tag of an XML document. * * An end element is created when the parser reaches an end tag, for example $</a>$. * An EndElement object only stores the name of the tag. To access the attributes of the tag the * start tag has to be read. The body of the tag can be accessed by reading the previous * Character node(s). * * Use name() to get the name of the tag which was closed. * * When parsing $<a>test</a>$ a StartElement, a Character and finally an EndElement node is * created. If an empty tag is parsed, like for example $</a>$, a StartElement and an EndElement * is created. * * @see StartElement * @see Node */ class EndElement : public Node { public: /** * @brief Constructs a new EndElement object with the given (optional) string as tag name. * * @param name The name of the EndElement object. This is an optional parameter. * Default is an empty string. */ explicit EndElement(const String& name = String()) : Node(Node::EndElement), _name(name) { } /** * @brief Clones this EndElement object by creating a duplicate on the heap and returning it. * @return A cloned version of this EndElement object. */ EndElement* clone() const {return new EndElement(*this);} void clear() { _name.clear(); } /** * @brief Returns the tag name of the closing tag for which this EndElement object was created. * * When parsing <a>test</a> a StartElement, a Character and finally an EndElement node is * created. The EndElement has the name "a". If an empty tag is parsed, like for example </a>, * a StartElement and an EndElement ("a") is created. * * @return The tag name of the closing tag for which this EndElement object was created. */ String& name() { return _name; } /** * @brief Returns the tag name of the closing tag for which this EndElement object was created. * * When parsing <a>test</a> a StartElement, a Character and finally an EndElement node is * created. The EndElement has the name "a". If an empty tag is parsed, like for example </a>, * a StartElement and an EndElement ("a") is created. * * @return The tag name of the closing tag for which this EndElement object was created. */ const String& name() const { return _name; } /** * @brief Sets the tag name of the end tag for which this EndElement object was created. * @param name The new name for this EndElement object. */ void setName(const String& name) { _name = name; } /** * @brief Compares this EndElement object with the given node. * * This method returns $true$ if the given node also is a EndElement object and * the name of both EndElement objects is the same. Otherwise it returns $false$. * * @param node This Node object is compared to the current EndElement node object. * @return $true if this EndElement object is the same as the given node. */ virtual bool operator==(const Node& node) const; private: //! The tag name of this end tag. String _name; }; } } #endif �����������������������������������������������cxxtools-3.0/include/cxxtools/xml/attribute.h�������������������������������������������������������0000664�0001750�0001750�00000010333�13644433072�016452� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_Attribute_h #define cxxtools_xml_Attribute_h #include <cxxtools/string.h> #include <cxxtools/date.h> #include <cxxtools/time.h> #include <cxxtools/datetime.h> #include <vector> namespace cxxtools { namespace xml { /** * @brief A class representing a single attribute of a tag from an XML document. * * An XML attribute consists of the attribute's name and the attribute's value. * The name can be retrieved using the method name(). The value can be retrieved * using the method value(). * * The attributes of a tag are retrieved from the document when the opening tag * is parsed. The attributes are stored in a StartElement object from where they * can be retrieved. */ class Attribute { public: //! Constructs a new Attribute object with an empty name and value. Attribute() { } /** * @brief Constructs a new Attribute using the given name and value. * * @param name The name of the XML attribute. * @param value The value of the XML attribute. */ Attribute(const String& name, const String& value) : _name(name), _value(value) { } Attribute(const String& name, const Date& value) : _name(name), _value(value.toString("%Y-%m-%d")) { } Attribute(const String& name, const Time& value) : _name(name), _value(value.toString("%H:%M:%S")) { } Attribute(const String& name, const DateTime& value) : _name(name), _value(value.toString("%Y-%m-%dT%H:%M:%S")) { } /** * @brief Returns the name of this attribute. * @return The attribute's name. */ const String& name() const { return _name; } String& name() { return _name; } /** * @brief Sets the name of this attribute. * @param name The new name of this attribute. */ void setName(const String& name) { _name = name; } /** * @brief Returns the value of this attribute. * @return The attribute's value. */ const String& value() const { return _value; } String& value() { return _value; } /** * @brief Sets the value of this attribute. * @param value The new value of this attribute. */ void setValue(const String& value) { _value = value; } void clear() { _name.clear(); _value.clear(); } private: //! The name of this attribute. String _name; //! The value of this attribute. String _value; }; typedef std::vector<Attribute> Attributes; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/namespacecontext.h������������������������������������������������0000664�0001750�0001750�00000010630�13644433072�020010� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_NamespaceContext_h #define cxxtools_xml_NamespaceContext_h #include <cxxtools/xml/namespace.h> #include <cxxtools/string.h> #include <map> namespace cxxtools { namespace xml { /** * @brief Manages all namespaces which are valid for a specific XML document. * * Namespaces can be added using the method addNamespace() and can be removed using * the method removeNamespace(). * * To get the namespace URI for a prefix the method namespaceUri() can be used. To * determine the prefix for a namespace the method prefix() can be used. * * @see Namespace */ class NamespaceContext { public: //! Creates a new NamespaceContext object which manages the namespaces of an XML document. NamespaceContext() { } /** * @brief Returns the namespace URI of the namespace which has the prefix that is passed to * this method. * * If no namespace with the given prefix exists, an empty String is returned. * * @param prefix The namespace URI for the namespace with this prefix is returned. * @return The namespace URI for the prefix or an empty String if the prefix was not found. */ const String& namespaceUri(const String& prefix) const; /** * @brief Returns the prefix for the namespace which has the URI that is passed to this method. * * If no namespace with this URI exists, an empty String is returned. * * @param namespaceUri The prefix of the namespace with this namespace URI is returned. * @return The namespace URI for the prefix or an empty String if the prefix was not found. */ const String& prefix(const String& namespaceUri) const ; /** * @brief Associates the element name (elementName) with the given namespace (ns). * * The stored namespace can be retrieved by calling namespaceUri() or prefix(). To * remove the association between the element name and namespace again, the method * removeNamespace() can be used. * * @param elementName Associates this element name with the also given namespace (ns). * @param ns Associates this namespace with the also given element name (elementName). */ void addNamespace(const String& elementName, const Namespace& ns); /** * @brief Removes the associates of the given element name (elementName) to the namespace. * * @param elementName The associates for this element name is removed. */ void removeNamespace(const String& elementName) { _namespaceScopes.erase(elementName); } private: //! Multimap that stores the assocations between an element name and its namespace. typedef std::multimap<String, Namespace> ScopeMap; std::multimap<String, Namespace> _namespaceScopes; }; } } #endif ��������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xml.h�������������������������������������������������������������0000664�0001750�0001750�00000015124�13644433072�015252� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_XML_XML_H #define CXXTOOLS_XML_XML_H #include <cxxtools/xml/xmlserializer.h> #include <cxxtools/xml/xmldeserializer.h> #include <iostream> namespace cxxtools { namespace xml { /** Wrapper object to easily print serializable objects as xml to a output stream. XmlOObject is a little wrapper which makes it easy to output serializable objects into a ostream. For this the XmlOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::basic_ostream, which prints the object in xml format. Example: \code std::vector<unsigned> v; v.push_back(4); v.push_back(17); v.push_back(12); std::cout << cxxtools::xml::Xml(v, "rootnode") << std::endl; \endcode */ template <typename ObjectType> class XmlOObject { const ObjectType& _object; std::string _name; bool _beautify; bool _useAttributes; public: /// Constructor. Needs the wrapped object. Optionally a flag can be /// passed whether the xml should be nicely formatted. XmlOObject(const ObjectType& object, const std::string& name) : _object(object), _name(name), _beautify(false), _useAttributes(true) { } XmlOObject& beautify(bool sw) { _beautify = sw; return *this; } bool beautify() const { return _beautify; } XmlOObject& useAttributes(bool sw) { _useAttributes = sw; return *this; } bool useAttributes() const { return _useAttributes; } const ObjectType& object() const { return _object; } const std::string& name() const { return _name; } }; /// The output operator for XmlOObject. It does the actual work. template <typename CharType, typename ObjectType> std::basic_ostream<CharType>& operator<< (std::basic_ostream<CharType>& out, const XmlOObject<ObjectType>& object) { try { XmlSerializer serializer(out); serializer.useIndent(object.beautify()); serializer.useEndl(object.beautify()); serializer.useAttributes(object.useAttributes()); serializer.serialize(object.object(), object.name()); } catch (const std::exception&) { out.setstate(std::ios::failbit); throw; } return out; } /// Function, which creates a XmlOObject. /// This makes the syntactic sugar perfect. See the example at XmlOObject /// for its use. template <typename ObjectType> XmlOObject<ObjectType> Xml(const ObjectType& object, const std::string& name, bool beautify = false, bool useAttributes = true) { return XmlOObject<ObjectType>(object, name) .beautify(beautify) .useAttributes(useAttributes); } /** Wrapper object to easily read objects as xml from a input stream. XmlIObject is a little wrapper which makes it easy to read objects from a istream. For this the XmlIObject expects a reference to the wrapped object and has a input operator for a std::istream, or actually a std::basic_istream, which reads the object from xml format. Example: \code std::vector<unsigned> v; std::istringstream in( \"<?xml version=\"1.0\" encoding=\"UTF-8\"?><rootnode><a>45</a><a>23</a></rootnode>"); in >> cxxtools::xml::Xml(v); for (unsigned n = 0; n < v.size(); ++n) std::cout << v[n] << '\n'; // prints 45 and 23 \endcode */ template <typename ObjectType> class XmlIObject { ObjectType& _object; bool _readAttributes; String _attributePrefix; public: explicit XmlIObject(ObjectType& object) : _object(object), _readAttributes(false) { } ObjectType& object() { return _object; } XmlIObject& readAttributes(bool sw) { _readAttributes = sw; return *this; } bool readAttributes() const { return _readAttributes; } XmlIObject& attributePrefix(const String& p) { _attributePrefix = p; return *this; } const String& attributePrefix() const { return _attributePrefix; } }; /// The input operator for XmlIObject. It does the actual work. /// See XmlIObject for a usage example. template <typename CharType, typename ObjectType> std::basic_istream<CharType>& operator>> (std::basic_istream<CharType>& in, XmlIObject<ObjectType> object) { try { XmlDeserializer deserializer; deserializer.readAttributes(object.readAttributes()); deserializer.attributePrefix(object.attributePrefix()); deserializer.parse(in); deserializer.deserialize(object.object()); } catch (const std::exception&) { in.setstate(std::ios::failbit); throw; } return in; } /// Creates a XmlIObject with a reference to a deserializable object. /// See XmlIObject for a usage example. template <typename ObjectType> XmlIObject<ObjectType> Xml(ObjectType& object) { return XmlIObject<ObjectType>(object); } } } #endif // CXXTOOLS_XML_XML_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xmlserializer.h���������������������������������������������������0000664�0001750�0001750�00000013727�13644433072�017353� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlSerializer_h #define cxxtools_Xml_XmlSerializer_h #include <cxxtools/xml/xmlformatter.h> #include <cxxtools/decomposer.h> #include <sstream> namespace cxxtools { namespace xml { /** @brief Serialize objects or object data to XML Thic class performs XML serialization of a single object or object data. */ class XmlSerializer { // make non copyable XmlSerializer(const XmlSerializer&) { } XmlSerializer& operator=(const XmlSerializer&) { return *this; } public: /** @brief Construct a serializer without initializing the serializer for writing. The serializer can be "opened" for writing by calling method attach(). */ XmlSerializer(); /** @brief Construct a serializer writing to a byte stream The serializer will write the objects as XML with UTF-8 encoding to the output stream. */ XmlSerializer(std::ostream& os); /** @brief Construct a serializer writing to the given XmlWriter object The serializer will write the objects to the given XmlWriter object. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ XmlSerializer(cxxtools::xml::XmlWriter* writer); //! @brief Destructor ~XmlSerializer(); /** @brief Opens this serializer for writing into the given stream. The serializer will write the objects as XML with UTF-8 encoding to the output stream. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. */ void attach(std::ostream& os); /** @brief Opens this serializer for writing into the given XmlWriter object. The serializer will write the objects to the given XmlWriter object. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ void attach(cxxtools::xml::XmlWriter& writer); /** @brief Detaches the currently set writer from this object. Before detaching the writer, the underlaying stream is flushed. If there is no currently set writer, nothing happens. */ void detach(); void useXmlDeclaration(bool sw) { _formatter.useXmlDeclaration(sw); } bool useXmlDeclaration() const { return _formatter.useXmlDeclaration(); } void useIndent(bool sw) { _formatter.useIndent(sw); } bool useIndent() const { return _formatter.useIndent(); } void useEndl(bool sw) { _formatter.useEndl(sw); } bool useEndl() const { return _formatter.useEndl(); } void useAttributes(bool sw) { _formatter.useAttributes(sw); } bool useAttributes() const { return _formatter.useAttributes(); } /** @brief Serialize an object to XML The serializer will serialize the object \a type as XML to the assigned stream. The string \a name will be used as the instance name of \a type and appear as the name of the XML element. The type must be serializable. */ template <typename T> void serialize(const T& type, const std::string& name) { Decomposer<T> decomposer; decomposer.begin(type); decomposer.setName(name); decomposer.format(_formatter); _formatter.finish(); _formatter.flush(); } void finish() { } template <typename T> static std::string toString(const T& type, const std::string& name, bool beautify = false) { std::ostringstream os; XmlWriter writer(os, beautify ? XmlWriter::UseXmlDeclaration | XmlWriter::UseIndent | XmlWriter::UseEndl : XmlWriter::UseXmlDeclaration); XmlSerializer s(&writer); s.serialize(type, name); s.finish(); return os.str(); } private: XmlFormatter _formatter; }; } // namespace xml } // namespace cxxtools #endif �����������������������������������������cxxtools-3.0/include/cxxtools/xml/startelement.h����������������������������������������������������0000664�0001750�0001750�00000023372�13644433072�017165� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_StartElement_h #define cxxtools_xml_StartElement_h #include <cxxtools/xml/node.h> #include <cxxtools/xml/namespace.h> #include <cxxtools/xml/namespacecontext.h> #include <cxxtools/xml/attribute.h> #include <cxxtools/string.h> namespace cxxtools { namespace xml { /** * @brief A start element (Node) which represents an opening tag of an XML document. * * A start element is created when the parser reaches a start tag, for example $<a>$. * A StartElement object not only stores the name of the tag and its namespace information, * but also stores the attributes of the tag. These attributes can be accessed by calling * attributes(), attribute() and hasAttribute(). * * Use name() to get the name of the tag which was closed. * * When parsing $<a>test</a>$ a StartElement, a Character and finally an EndElement node is * created. If an empty tag is parsed, like for example $</a>$, a StartElement and an EndElement * is created. * * @see EndElement * @see Node * @see Attribute */ class StartElement : public Node { public: //! Constructs a new StartElement object with no name and an empty attribute list. StartElement() : Node(Node::StartElement) { } /** * @brief Constructs a new StartElement object with the given string as tag name. * * @param name The name of the EndElement object. This is an optional parameter. * Default is an empty string. */ StartElement(const String& name) : Node(Node::StartElement), _name(name) { } /** * @brief Clones this StartElement object by creating a duplicate on the heap and returning it. * @return A cloned version of this StartElement object. */ StartElement* clone() const {return new StartElement(*this);} void clear() { _name.clear(); _attributes.clear(); } /** * @brief Returns the tag name of the opening tag for which this StartElement object was created. * * When parsing <a>test</a> a StartElement, a Character and finally an EndElement node is * created. The StartElement has the name "a". If an empty tag is parsed, like for example </a>, * only a StartElement and an EndElement ("a") is created. * * @return The tag name of the opening tag for which this StartElement object was created. */ String& name() {return _name;} /** * @brief Returns the tag name of the opening tag for which this StartElement object was created. * * When parsing <a>test</a> a StartElement, a Character and finally an EndElement node is * created. The StartElement has the name "a". If an empty tag is parsed, like for example </a>, * only a StartElement and an EndElement ("a") is created. * * @return The tag name of the opening tag for which this StartElement object was created. */ const String& name() const {return _name;} /** * @brief Sets the tag name of the end start for which this StartElement object was created. * @param name The new name for this StartElement object. */ void setName(const String& name) {_name = name;} /** * @brief Add the given attribute to the attribute list of this start tag. * * This StartElement object holds a list of attributes, which consist of the attribute name * and the attribute value. The attributes can be read using attributes() or attribute(). * * @param attribute The attribute which is added to this object's attribute list. */ void addAttribute(const Attribute& attribute) {_attributes.push_back(attribute);} /** * @brief Returns the attribute list of this StartElement which contains all attributes of the tag. * * This StartElement object holds a list of attributes, which consist of the attribute name * and the attribute value. This method returns all attributes of the represented tag. The list * can be iterated using a iterator. To access a specific attribute the method attribute() can be * used. * * @return A list containing all attributes of the tag this StartElement represents. */ const Attributes& attributes() const { return _attributes; } /** * @brief Returns the value of the attribute with the given name. * * This StartElement object holds a list of attributes, which consist of the attribute name * and the attribute value. This methods returns the value of a single attribute. To access * all attributes of this StartElement the method attributes() can be used. * * If no attribute with the given name exists, an empty string is returned. * * @param attributeName The value of the attribute with this name is returned. * @return The value of the request attribute; or an empty string if there is no attribute * with this name. */ const String& attribute(const String& attributeName) const; /** * @return Checks if the StartElement has an attribute with the given name. * * This method returns $true$ if an attribute with the given name exists in this * StartElement. If no attribute with this name exist $false$ is returned. * * @param attributeName It is checked if an attribute with this attribute name exists. * @return $true$ if an attribute with this name exists; $false$ otherwise. */ bool hasAttribute(const String& attributeName) const; /** * @brief Returns the namespace conText of this StartElement. * * @return NamespaceContext The namespace conText of this StartElment. * @see NamespaceContext */ const NamespaceContext& namespaceContext() const {return _namespaceContext;} /** * @brief Sets the namespace conText for this StartElement. * * @param conText The new namespace conText for this StartElment. * @see NamespaceContext */ void setNamespaceContext(const NamespaceContext& conText) {_namespaceContext = conText;} /** * @brief Returns the namespace uri for the given tag prefix in this StartElments namespace conText. * * The namespace uri is determined using the method NamespaceContext::namespaceUri(). * If no namespace uri exists for this prefix an empty string is returned. * * @param prefix The prefix for which the namespace uri is returned. * @return The namespace uri for the given prefix; or an empty string if no namespace uri exists * for this prefix. */ const String& namespaceUri(const String& prefix) const {return _namespaceContext.namespaceUri(prefix);} /** * @brief Compares this StartElement object with the given node. * * This method returns $true$ if the given node also is a StartElement object and * the content of both StartElement objects is the same. Otherwise it returns $false$. * * @param node This Node object is compared to the current StartElement node object. * @return $true if this StartElement object is the same as the given node. */ virtual bool operator==(const Node& node) const; private: //! The name of the underlying tag. String _name; //! The list which contains all attributes of the underlying tag. Attributes _attributes; //! The namespace conText of this StartElement. NamespaceContext _namespaceContext; }; } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/node.h������������������������������������������������������������0000664�0001750�0001750�00000012562�13644433072�015402� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_Node_h #define cxxtools_Xml_Node_h namespace cxxtools { namespace xml { /** * @brief The super-class for all specific Node type of an XML document. * * A Node may for example be a opening tag, a closing tag, a comment or a doctype declaration. * The supported node types are contained in the enum Type. To determine the type of a Node the * method type() can be used. * * For every supported node type (except "Unknown") a specialized class exists that is derived * from this Node class. Those classes contain more data and access methods to allow the user * to determine the information specific to the node, for example the tag name for a StartElement. * * This class mainly provides the method type() to determine the type of the Node. The user * may use this information to determine to which specialized class that is associated * with the type this object can be cast; for the Node::StartElement type the Node object can be * cast to StartElement, for example. * * @see Type */ class Node { public: enum Type { //! Unknown Node type (may not currently be supported) Unknown = 0, //! Xml declaration (see class XmlDeclaration) StartDocument = 1, //! Doctype (see class DocType) DocType = 2, //! End of the document (see EndDocument) EndDocument = 3, //! Start element aka opening tag (see StartElement) StartElement = 4, //! End element aka closing tag (see EndElement) EndElement = 5, //! Parsed content of a tag's body (see Characters) Characters = 6, //! Comment (see Comment) Comment, //! Processing instruction (see ProcessingInstruction) ProcessingInstruction }; public: /** * @brief Constructs a new Node object with the specified node type * @see Type */ Node(Type type) : _type(type) { } //! Empty destructor virtual ~Node() { } /** * @brief Returns the type of this Node that can be used to determine what specific * Node this object is. * * This information may be used to determine to which specialized Node class that is associated * with the type, this Node object can be cast; for the Node::StartElement type the Node object * can be cast to StartElement, for example. * * @return The type of this node. */ Type type() const {return _type;} /** * @brief Compares this Node object with the given node. * * The return value of the generic operator== method is always false. Class which derive * from this class should always override this method and provide a useful comparison, for * example by comparing the node type and contents of the current and given Node object * * @param node In subclasses this Node object is compared to the current Node object. * @return In sub-classes $true is returned if this Node object is the same as the given * Node object. In this generic class $false$ is always returned. */ virtual bool operator==(const Node& /*node*/) const { return false; } virtual Node* clone() const = 0; private: //! The type of this Node. Type _type; }; } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/doctypedeclaration.h����������������������������������������������0000664�0001750�0001750�00000006217�13644433072�020332� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_DocTypeDeclaration_h #define cxxtools_xml_DocTypeDeclaration_h #include <cxxtools/xml/node.h> #include <cxxtools/string.h> namespace cxxtools { namespace xml { /** * @brief A DocType element (Node) of an XML document. * * A DocType element stores the document type of the document and contains an URI to a * file which contains the document type definition. * * Use content() to get the content of the DocType element. * * @see Node */ class DocTypeDeclaration : public Node { public: /** * @brief Constructs a new DocTypeDeclaration object with the given string as content. */ DocTypeDeclaration() : Node(Node::DocType) { } void clear() { _content.clear(); } /** * @brief Clones this DocTypeDeclaration object by creating a duplicate on the heap and returning it. * @return A cloned version of this DocTypeDeclaration object. */ DocTypeDeclaration* clone() const { return new DocTypeDeclaration(*this); } /** * @brief Returns the content of this DocTypeDeclaration object. * @return The content of this DocTypeDeclaration object. */ const String& content() const { return _content; } String& content() { return _content; } /** * @brief Sets the content of this DocTypeDeclaration object. * @param content The new content for this DocTypeDeclaration object. */ void setContent(const String& content) { _content = content; } private: //! The content of this DocTypeDeclaration object. String _content; }; } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xmlformatter.h����������������������������������������������������0000664�0001750�0001750�00000012602�13644433072�017174� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlFormatter_h #define cxxtools_Xml_XmlFormatter_h #include <cxxtools/formatter.h> #include <cxxtools/xml/xmlwriter.h> #include <cxxtools/smartptr.h> namespace cxxtools { namespace xml { /** @brief Serialize objects or object data to XML Thic class performs XML serialization of a single object or object data. */ class XmlFormatter : public cxxtools::Formatter { public: /** @brief Construct a serializer without initializing the serializer for writing. The serializer can be "opened" for writing by calling method attach(). */ XmlFormatter(); /** @brief Construct a serializer writing to a byte stream The serializer will write the objects as XML with UTF-8 encoding to the output stream. */ XmlFormatter(std::ostream& os); /** @brief Construct a serializer writing to the given XmlWriter object The serializer will write the objects to the given XmlWriter object. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ XmlFormatter(XmlWriter* writer); //! @brief Destructor ~XmlFormatter(); /** @brief Opens this serializer for writing into the given stream. The serializer will write the objects as XML with UTF-8 encoding to the output stream. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. */ void attach(std::ostream& os); /** @brief Opens this serializer for writing into the given XmlWriter object. The serializer will write the objects to the given XmlWriter object. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ void attach(XmlWriter& writer); /** @brief Detaches the currently set writer from this object. Before detaching the writer, the underlaying stream is flushed. If there is no currently set writer, nothing happens. */ void detach(); //! @internal void flush(); void useXmlDeclaration(bool sw) { _writer->useXmlDeclaration(sw); } bool useXmlDeclaration() const { return _writer->useXmlDeclaration(); } void useIndent(bool sw) { _writer->useIndent(sw); } bool useIndent() const { return _writer->useIndent(); } void useEndl(bool sw) { _writer->useEndl(sw); } bool useEndl() const { return _writer->useEndl(); } void useAttributes(bool sw) { _useAttributes = sw; } bool useAttributes() const { return _useAttributes; } void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value); void beginArray(const std::string& name, const std::string& type); void finishArray(); void beginObject(const std::string& name, const std::string& type); void beginMember(const std::string& name); void finishMember(); void finishObject(); void finish(); private: void beginComplexElement(const std::string& name, const std::string& type, const String& category); //! @internal XmlWriter* _writer; //! @internal cxxtools::SmartPtr<XmlWriter, cxxtools::ExternalRefCounted> _deleter; bool _useAttributes; }; } // namespace xml } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/xmlreader.h�������������������������������������������������������0000664�0001750�0001750�00000014062�13644433072�016435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlReader_h #define cxxtools_Xml_XmlReader_h #include <cxxtools/string.h> #include <cxxtools/textstream.h> #include <cxxtools/xml/node.h> #include <cxxtools/xml/enddocument.h> #include <iosfwd> namespace cxxtools { namespace xml { class Node; class StartElement; class EntityResolver; /** @brief Reads XML as a Stream of XML Nodes. This class operates on an input stream from which XML character data is read and parsed. The parser will only parse the XML document as far as the user read data from it. To read the current element (Node) the method get() can be used. To parse and read the next element the method next() can be used. Only when next() or any corresponding method or operator is called, the next chunk of XML input data is parsed. To parse a XML-document, a XmlReader constructed with an input stream from which the XML document is to be read. The current XML element (Node) can be read using get(). Every call to next() will parse the next element, position the cursor to the next element and return the parsed element. The returned element is of type Node, which is the super-class for all XML element classes. The class Node has a method type() which returns the type of the read element. Depending on the type the generic Node object may be cast to the more concrete element object. For example a Node object with a node type of Node::StartElement can be cast to StartElement. Parsing using next() will continue until the end of the document is reached which will resultin a EndDocument element to be returned by next() and get(). This class also provides the method current() to obtain an iterator which basically works the same way like using using get() and next() directly. The iterator can be set to the next element by using the ++ operator. The current element can be accessed by dereferencing the iterator. @see Node */ class XmlReader { public: class Iterator { public: Iterator() : _stream(0) , _node(0) { } Iterator(XmlReader& xis) : _stream(&xis) , _node(0) { _node = &_stream->get(); } Iterator(const Iterator& it) : _stream(it._stream), _node(it._node) { } ~Iterator() { } Iterator& operator=(const Iterator& it) { _stream = it._stream; _node = it._node; return *this; } inline const Node& operator*() const { return *_node; } inline const Node* operator->() const { return _node; } Iterator& operator++() { if(_node->type() == Node::EndDocument) _node = 0; else _node = &_stream->next(); return *this; } inline bool operator==(const Iterator& it) const { return _node == it._node; } inline bool operator!=(const Iterator& it) const { return _node != it._node; } private: XmlReader* _stream; const Node* _node; }; public: /* TODO: Consider the following processing flags: - ReportProcessingInstructions - IgnoreWhitespace - ReportComments - ReportDocumentStart */ XmlReader(std::istream& is, int flags = 0); XmlReader(std::basic_istream<Char>& is, int flags = 0); ~XmlReader(); void reset(std::basic_istream<Char>& is, int flags = 0); void reset(std::istream& is, int flags = 0); const cxxtools::String& documentVersion() const; const cxxtools::String& documentEncoding() const; bool standaloneDocument() const; EntityResolver& entityResolver(); const EntityResolver& entityResolver() const; size_t depth() const; Iterator current() { return Iterator(*this); } Iterator end() const { return Iterator(); } //! @brief Get current element const Node& get(); //! @brief Get next element from stream const Node& next(); bool advance(); const StartElement& nextElement(); const Node& nextTag(); std::size_t line() const; private: class XmlReaderImpl* _impl; }; } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/comment.h���������������������������������������������������������0000664�0001750�0001750�00000010317�13644433072�016113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_Xml_Comment_h #define CXXTOOLS_Xml_Comment_h #include <cxxtools/xml/node.h> #include <cxxtools/string.h> namespace cxxtools { namespace xml { /** * @brief A Comment element (Node) of an XML document, containing the comment's content. * * A Comment element stores the content of a comment. There is no interpretation of the * comment's Text before it is stored. * * Use Text() to get the content/Text of the comment element without the <!-- and -->. * * When parsing a comment %<!-- This is a comment -->$ the following Text will be * returned by Text(): $This is a comment$ * * @see Node */ class Comment : public Node { public: /** * @brief Constructs a new Comment object with the given string as content/Text. * * @param Text The content/Text of the Comment object. */ explicit Comment(const String& text) : Node(Node::Comment) , _text(text) { } /** * @brief Clones this Comment object by creating a duplicate on the heap and returning it. * @return A cloned version of this Comment object. */ Comment* clone() const {return new Comment(*this);} /** * @brief Returns the content/Text of this Comment object. * * The content includes everything that is between the start and end "tags" of the comment * without being parsed. When parsing a comment %<!-- This is a comment -->$ the following * Text will be returned: $This is a comment$ * * @return The Text of this Comment object. */ String& text() { return _text; } /** * @brief Returns the content/Text of this Comment object. * * The content includes everything that is between the start and end "tags" of the comment * without being parsed. When parsing a comment %<!-- This is a comment -->$ the following * Text will be returned: $This is a comment$ * * @return The Text of this Comment object. */ const String& text() const { return _text; } /** * @brief Sets the Text of this Comment object. * @param text The new Text for this Comment object. */ void setText(const String& text) { _text = text; } private: //! The Text of this Comment object. String _text; }; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/xml/processinginstruction.h�������������������������������������������0000664�0001750�0001750�00000011154�13644433072�021127� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_xml_ProcessingInstruction_h #define CXXTOOLS_xml_ProcessingInstruction_h #include <cxxtools/xml/node.h> #include <cxxtools/string.h> namespace cxxtools { namespace xml { /** * @brief A ProcessingInstruction (PI) element (Node) of an XML document. * * A processing instruction can be used to add instructions to an XML document which is needed * and can be used by specific XML processing software. The data of a processing instruction * has no particular format and can contain plain Text or XML-like attribute/value-associations. * * To access the target, which may for example be a identifier for a specific XML processor, * the method target() can be used. To access the data for this processor the method data() * can be used. * * @see Node */ class ProcessingInstruction : public Node { public: //! Constructs a new ProcessingInstruction. ProcessingInstruction() : Node(Node::ProcessingInstruction) { } void clear() { _target.clear(); _data.clear(); } /** * @brief Clones this CData object by creating a duplicate on the heap and returning it. * @return A cloned version of this CData object. */ ProcessingInstruction* clone() const {return new ProcessingInstruction(*this);} /** * @brief Returns the processor instruction's target. * * The target may be the XML processor for which this PI was added to the XML document. * * @return The target of this processing instruction. */ const String& target() const { return _target; } String& target() { return _target; } /** * @brief Sets the processor instruction's target. * * @param target The target for this processing instruction. */ void setTarget(const String& target) { _target = target; } /** * @brief Returns the processor instruction's data. * * The precise nature of the PI data depends on the XML processor for which this PI * was added to the XML document. It usually contains special instructions for this processor. * * @return The data of this processing instruction. */ const String& data() const { return _data; } String& data() { return _data; } /** * @brief Sets the processor instruction's data. * * @param data The data for this processing instruction. */ void setData(const String& data) { _data = data; } private: //! The target of this processing instruction. String _target; //! The data of this processing instruction. String _data; }; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/iniserializer.h�������������������������������������������������������0000664�0001750�0001750�00000004634�13644433072�016527� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2019 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_INISERIALIZER_H #define CXXTOOLS_INISERIALIZER_H #include <cxxtools/serializationinfo.h> #include <cxxtools/textstream.h> #include <cxxtools/utf8codec.h> namespace cxxtools { class IniSerializer { public: explicit IniSerializer(std::ostream& os, TextCodec<Char, char>* codec = new Utf8Codec()) : _pos(new TextOStream(os, codec)), _os(*_pos) { } explicit IniSerializer(TextOStream& os) : _pos(0), _os(os) { } ~IniSerializer() { delete _pos; } IniSerializer& serialize(const SerializationInfo& si); template <typename T> IniSerializer& serialize(const T& v) { SerializationInfo si; si <<= v; serialize(si); return *this; } private: TextOStream* _pos; TextOStream& _os; bool _inObject; }; } #endif // CXXTOOLS_INISERIALIZER_H ����������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/eventloop.h�����������������������������������������������������������0000664�0001750�0001750�00000014636�13644433072�015674� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_EVENTLOOP_H #define CXXTOOLS_SYSTEM_EVENTLOOP_H #include <cxxtools/event.h> #include <cxxtools/signal.h> #include <cxxtools/selector.h> #include <cxxtools/eventsink.h> #include <cxxtools/timespan.h> namespace cxxtools { class Selectable; /** @brief Thread-safe event loop supporting I/O multiplexing and Timers. */ class EventLoopBase : public SelectorBase , public EventSink { public: /** @brief Destructs the EventLoop */ virtual ~EventLoopBase() {} /** @brief Starts the event loop */ void run() { this->onRun(); } /** @brief Processes all events which are currently in the event queue */ void processEvents(unsigned max = 0) { onProcessEvents(max); } /** @brief Stops the %EventLoop. */ void exit() { this->onExit(); } /** @brief Sets the idle timeout */ void setIdleTimeout(Milliseconds msecs) { _timeout = msecs; } /** @brief Returns the idle timeout */ Milliseconds idleTimeout() const { return _timeout; } /** @brief Notifies about wait timeouts This signal is send when the timeout given to a wait call of the selector expires and no activity occured. */ Signal<> timeout; /** @brief Notifies that all events are processed and the event loop starts waiting. */ Signal<> idle; /** @brief Reports all events */ Signal<const Event&> event; /** @brief Emited when the eventloop is started */ Signal<> started; /** @brief Emited when the eventloop is exited */ Signal<> exited; protected: /** @brief Constructs the EventLoop */ EventLoopBase() : _timeout(WaitInfinite) {} virtual void onRun() = 0; virtual void onExit() = 0; virtual void onProcessEvents(unsigned max) = 0; private: Timespan _timeout; }; /** @brief Thread-safe event loop supporting I/O multiplexing and Timers. The System EventLoop can be used as the central entity of a thread or process to dispatch application events and wait on multiple IODevices or Timers for activity. Events can be added to the internal event queue, even from other threads using the method EventLoop::commitEvent or EventLoop::queueEvent. The first method will add the event to the internal queue and wake the event loop, the latter allows queing multiple events and it is up to the caller to wake the event loop by calling EventLoop::wake when all events are added. When the event loop processes its event, the signal "event" is send for each processed event. Events are processes in the order they were added. To start the %EventLoop the method EventLoop::run must be executed. It blocks until the event loop is stopped. To stop the %EventLoop, EventLoop::exit must be called. The delivery of the events occurs inside the thread that started the execution of the event loop. %IODevices and %Timers can be added to an %EventLoop just as to Selector. In fact a %Selector is used internally to implement the %EventLoop. Since the %EventLoop is a Runnable, it can be easily assigned to a thread to give it its own event loop. */ class EventLoop : public EventLoopBase { public: /** @brief Constructs the EventLoop */ EventLoop(); /** @brief Destructs the EventLoop */ virtual ~EventLoop(); /** Returns the maximum number of events processed per loop cycle. When the loop runs after the specified number of events I/O events are checked. */ unsigned eventsPerLoop(); /** Sets the maximum number of events processed per loop cycle. * The default is 16. */ void eventsPerLoop(unsigned n); protected: virtual void onAdd( Selectable& s ); virtual void onRemove( Selectable& s ); virtual void onReinit(Selectable& s); virtual void onChanged(Selectable& s); virtual void onRun(); virtual bool onWaitUntil(Timespan timeout); virtual void onWake(); virtual void onExit(); virtual void onQueueEvent(const Event& event, bool priority); virtual void onCommitEvent(const Event& event, bool priority); virtual void onProcessEvents(unsigned max); private: class Impl; Impl* _impl; }; } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/convert.h�������������������������������������������������������������0000664�0001750�0001750�00000063441�13644433072�015337� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 by Marc Boris Duerner * Copyright (C) 2004-2007 by Stepan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CONVERT_H #define CXXTOOLS_CONVERT_H #include <cxxtools/config.h> #include <cxxtools/string.h> #include <cxxtools/stringstream.h> #include <cxxtools/conversionerror.h> #include <cxxtools/typetraits.h> #include <sstream> #include <string> #include <typeinfo> #include <limits> #include <iterator> #include <cctype> #include <cmath> #include <cxxtools/config.h> namespace cxxtools { // // Conversions to cxxtools::String // inline void convert(String& s, const String& str) { s = str; } void convert(String& s, const std::string& value); void convert(String& s, bool value); void convert(String& s, char value); void convert(String& s, wchar_t value); void convert(String& s, Char value); void convert(String& s, unsigned char value); void convert(String& s, signed char value); void convert(String& s, short value); void convert(String& s, unsigned short value); void convert(String& s, int value); void convert(String& s, unsigned int value); void convert(String& s, long value); void convert(String& s, unsigned long value); #ifdef HAVE_LONG_LONG void convert(String& s, long long value); #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(String& s, unsigned long long value); #endif void convert(String& s, float value); void convert(String& s, double value); void convert(String& s, long double value); template <typename T> inline void convert(String& s, const T& value) { OStringStream os; os << value; s = os.str(); } // // Conversions from cxxtools::String // void convert(bool& n, const String& str); void convert(char& n, const String& str); void convert(wchar_t& n, const String& str); void convert(Char& n, const String& str); void convert(unsigned char& n, const String& str); void convert(signed char& n, const String& str); void convert(short& n, const String& str); void convert(unsigned short& n, const String& str); void convert(int& n, const String& str); void convert(unsigned int& n, const String& str); void convert(long& n, const String& str); void convert(unsigned long& n, const String& str); #ifdef HAVE_LONG_LONG void convert(long long& n, const String& str); #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const String& str); #endif void convert(float& n, const String& str); void convert(double& n, const String& str); void convert(long double& n, const String& str); template <typename T> inline void convert(T& t, const String& str) { IStringStream is(str); Char ch; is >> t; if (is.fail() || !(is >> ch).eof()) ConversionError::doThrow(typeid(T).name(), "String"); } // // Conversions to std::string // inline void convert(std::string& s, const std::string& str) { s = str; } void convert(std::string& s, const String& str); void convert(std::string& s, bool value); void convert(std::string& s, char value); void convert(std::string& s, signed char value); void convert(std::string& s, unsigned char value); void convert(std::string& s, short value); void convert(std::string& s, unsigned short value); void convert(std::string& s, int value); void convert(std::string& s, unsigned int value); void convert(std::string& s, long value); void convert(std::string& s, unsigned long value); #ifdef HAVE_LONG_LONG void convert(std::string& s, long long value); #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(std::string& s, unsigned long long value); #endif void convert(std::string& s, float value); void convert(std::string& s, double value); void convert(std::string& s, long double value); template <typename T> inline void convert(std::string& s, const T& value) { std::ostringstream os; os << value; s = os.str(); } // // Conversions from std::string // void convert(bool& n, const std::string& str); void convert(char& n, const std::string& str); void convert(signed char& n, const std::string& str); void convert(unsigned char& n, const std::string& str); void convert(short& n, const std::string& str); void convert(unsigned short& n, const std::string& str); void convert(int& n, const std::string& str); void convert(unsigned int& n, const std::string& str); void convert(long& n, const std::string& str); void convert(unsigned long& n, const std::string& str); #ifdef HAVE_LONG_LONG void convert(long long& n, const std::string& str); #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const std::string& str); #endif void convert(float& n, const std::string& str); void convert(double& n, const std::string& str); void convert(long double& n, const std::string& str); template <typename T> inline void convert(T& t, const std::string& str) { std::istringstream is(str); char ch; is >> t; if (is.fail() || !(is >> ch).eof()) ConversionError::doThrow(typeid(T).name(), "string"); } // // Conversions from const char* (null-terminated) // void convert(bool& n, const char* str); void convert(char& n, const char* str); void convert(signed char& n, const char* str); void convert(unsigned char& n, const char* str); void convert(short& n, const char* str); void convert(unsigned short& n, const char* str); void convert(int& n, const char* str); void convert(unsigned int& n, const char* str); void convert(long& n, const char* str); void convert(unsigned long& n, const char* str); #ifdef HAVE_LONG_LONG void convert(long long& n, const char* str); #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const char* str); #endif void convert(float& n, const char* str); void convert(double& n, const char* str); void convert(long double& n, const char* str); // // Generic stream-based conversions // template<typename T, typename S> void convert(T& to, const S& from) { StringStream ss; if( !(ss << from && ss >> to) ) throw ConversionError("conversion between streamable types failed"); } template<typename T, typename S> struct Convert { T operator()(const S& from) const { T value = T(); convert(value, from); return value; } }; template<typename T, typename S> T convert(const S& from) { T value = T(); convert(value, from); return value; } // // number formatting // /** @brief Formats an integer in a given format format. */ template <typename OutIterT, typename T, typename FormatT> inline OutIterT putInt(OutIterT it, T i, const FormatT& fmt); /** @brief Formats an integer in a decimal format. */ template <typename OutIterT, typename T> inline OutIterT putInt(OutIterT it, T i); /** @brief Formats a floating point value in a given format. */ template <typename OutIterT, typename T, typename FormatT> OutIterT putFloat(OutIterT it, T d, const FormatT& fmt, int precision); /** @brief Formats a floating point value in default format. */ template <typename OutIterT, typename T> OutIterT putFloat(OutIterT it, T d); // // number parsing // /** @brief Parses an integer value in a given format. */ template <typename InIterT, typename T, typename FormatT> InIterT getInt(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt); /** @brief Parses an integer value in decimal format. */ template <typename InIterT, typename T> InIterT getInt(InIterT it, InIterT end, bool& ok, T& n); /** @brief Parses a floating point value in a given format. */ template <typename InIterT, typename T, typename FormatT> InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt); /** @brief Parses a floating point value. */ template <typename InIterT, typename T> InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n); template <typename CharType> struct NumberFormat { typedef CharType CharT; static CharT plus() { return CharT('+'); } static CharT minus() { return CharT('-'); } }; template <typename CharType> struct DecimalFormat : public NumberFormat<CharType> { typedef CharType CharT; static const unsigned base = 10; static CharT toChar(unsigned char n) { return CharT(static_cast<char>('0' + n)); } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { int cc = std::char_traits<CharT>::to_int_type(ch) - 48; // let negatives overrun return static_cast<unsigned>(cc); } }; template <typename CharType> struct OctalFormat : public NumberFormat<CharType> { typedef CharType CharT; static const unsigned base = 8; static CharT toChar(unsigned char n) { return CharT(static_cast<char>('0' + n)); } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { int cc = std::char_traits<CharT>::to_int_type(ch) - 48; // let negatives overrun return static_cast<unsigned>(cc); } }; template <typename CharType> struct HexFormat : public NumberFormat<CharType> { typedef CharType CharT; static const unsigned base = 16; static CharT toChar(unsigned char n) { n &= 0x1F; // prevent overrun static const char* digtab = "0123456789abcdef"; return digtab[n]; } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { static const unsigned char chartab[64] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,10,11,12,13,14,15,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,10,11,12,13,14,15,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, }; int cc = ch - 48; // let negatives overrun unsigned uc = static_cast<unsigned>(cc); if(uc > 64) return 0xFF; unsigned char idx = static_cast<unsigned char>(uc); return chartab[ idx ]; } }; template <typename CharType> struct BinaryFormat : public NumberFormat<CharType> { typedef CharType CharT; static const unsigned base = 2; static CharT toChar(unsigned char n) { return CharT(static_cast<char>('0' + n)); } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { int cc = std::char_traits<CharT>::to_int_type(ch) - 48; // let negatives overrun return static_cast<unsigned>(cc); } }; template <typename CharType> struct FloatFormat : public DecimalFormat<CharType> { typedef CharType CharT; static CharT point() { return CharT('.'); } static CharT e() { return CharT('e'); } static CharT E() { return CharT('E'); } static const CharT* nan() { static const CharT nanstr[] = { CharT('n'), CharT('a'), CharT('n'), 0 }; return nanstr; } static const CharT* inf() { static const CharT nanstr[] = { CharT('i'), CharT('n'), CharT('f'), 0 }; return nanstr; } }; //! @internal @brief Returns the absolute value of \a i inline unsigned char formatAbs(char i, bool& isNeg) { isNeg = i < 0; unsigned char u = isNeg ? -i : static_cast<unsigned char>(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned char formatAbs(unsigned char i, bool& isNeg) { isNeg = false; return i; } //! @internal @brief Returns the absolute value of \a i inline unsigned short formatAbs(short i, bool& isNeg) { isNeg = i < 0; unsigned short u = isNeg ? -i : static_cast<unsigned short>(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned short formatAbs(unsigned short i, bool& isNeg) { isNeg = false; return i; } //! @internal @brief Returns the absolute value of \a i inline unsigned int formatAbs(int i, bool& isNeg) { isNeg = i < 0; unsigned int u = isNeg ? -i : static_cast<unsigned int>(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned int formatAbs(unsigned int i, bool& isNeg) { isNeg = false; return i; } //! @internal @brief Returns the absolute value of \a i inline unsigned long formatAbs(long i, bool& isNeg) { isNeg = i < 0; unsigned long u = isNeg ? -i : static_cast<unsigned long>(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned long formatAbs(unsigned long i, bool& isNeg) { isNeg = false; return i; } #ifdef HAVE_LONG_LONG //! @internal @brief Returns the absolute value of \a i inline unsigned long long formatAbs(long long i, bool& isNeg) { isNeg = i < 0; unsigned long long u = isNeg ? -i : static_cast<unsigned long long>(i); return u; } #endif #ifdef HAVE_UNSIGNED_LONG_LONG //! @internal @brief Returns the absolute value of \a i inline unsigned long long formatAbs(unsigned long long i, bool& isNeg) { isNeg = false; return i; } #endif /** @brief Formats an integer in a given format. */ template <typename CharT, typename T, typename FormatT> inline CharT* formatInt(CharT* buf, std::size_t buflen, T si, const FormatT& fmt) { typedef typename IntTraits<T>::Unsigned UnsignedInt; CharT* end = buf + buflen; CharT* cur = end; const unsigned base = fmt.base; bool isNeg = false; UnsignedInt u = formatAbs(si, isNeg); do { T lsd = u % base; u /= base; --cur; *cur = fmt.toChar( unsigned(lsd) ); } while(u != 0 && cur != buf); if(cur == buf) return buf; if(isNeg) { --cur; *cur = fmt.minus(); } return cur; } /** @brief Formats an integer in binary format. */ template <typename CharT, typename T> inline CharT* formatInt(CharT* buf, std::size_t buflen, T i, const BinaryFormat<CharT>& fmt) { CharT* end = buf + buflen; CharT* cur = end; T mask = 1; do { --cur; *cur = fmt.toChar( unsigned(i & mask)); i = i >> 1; } while(i != 0 && cur != buf); if(cur == buf) return buf; return cur; } template <typename OutIterT, typename T, typename FormatT> inline OutIterT putInt(OutIterT it, T i, const FormatT& fmt) { // large enough even for binary and a sign const std::size_t buflen = (sizeof(T) * 8) + 1; typename FormatT::CharT buf[buflen]; typename FormatT::CharT* p = formatInt(buf, buflen, i, fmt); typename FormatT::CharT* end = buf + buflen; for(; p != end; ++p) *it++ = *p; return it; } template <typename OutIterT, typename T> inline OutIterT putInt(OutIterT it, T i) { DecimalFormat<char> fmt; return putInt(it, i, fmt); } template <typename OutIterT, typename T, typename FormatT> inline OutIterT putFloat(OutIterT it, T value, const FormatT& fmt, int precision) { typedef typename FormatT::CharT CharT; // 1. Test for not-a-number with value != value if( value != value ) { for(const CharT* nanstr = fmt.nan(); *nanstr != 0; ++nanstr) { *it = *nanstr; ++it; } return it; } // 2. check sign if(value < 0.0) { *it = fmt.minus(); ++it; } T num = std::fabs(value); // 3. Test for infinity if( num == std::numeric_limits<T>::infinity() ) { for(const CharT* infstr = fmt.inf(); *infstr != 0; ++infstr) { *it = *infstr; ++it; } return it; } const int bufsize = std::numeric_limits<T>::digits10 + 1; if (precision > bufsize) precision = bufsize; CharT fract[bufsize + 1]; fract[precision] = CharT('\0'); int exp = static_cast<int>(std::floor(std::log10(num))) + 1; num *= std::pow(T(10.0), precision - exp); num += .5; bool notZero = false; for (unsigned short dd = precision; dd > 0; --dd) { T n = num / T(10.0); T fl = std::floor(n) * T(10.0); unsigned char v = static_cast<unsigned char>(num - fl); notZero |= (v != 0 && v < 10); fract[dd - 1] = notZero ? fmt.toChar(v) : CharT('\0'); num = n; } if (fract[0] == CharT('\0')) { *it = '0'; ++it; return it; } if (exp <= 0) { *it = '0'; ++it; *it = '.'; ++it; while (exp < 0) { *it = '0'; ++it; ++exp; } for (int dd = 0; fract[dd]; ++dd) { *it = fract[dd]; ++it; } } else { for (int dd = 0; fract[dd]; ++dd) { if (exp-- == 0) { *it = '.'; ++it; } *it = fract[dd]; ++it; } while (exp-- > 0) { *it = '0'; ++it; } } return it; } template <typename OutIterT, typename T> inline OutIterT putFloat(OutIterT it, T value) { const int precision = std::numeric_limits<T>::digits10 - 1; FloatFormat<char> fmt; return putFloat(it, value, fmt, precision); } template <typename InIterT, typename FormatT> InIterT getSign(InIterT it, InIterT end, bool& pos, const FormatT& fmt) { pos = true; // strip leading whitespace, parse sign while (it != end && isspace(*it)) ++it; if (it != end) { if (*it == fmt.minus()) { pos = false; ++it; } else if ( *it == fmt.plus() ) { ++it; } } return it; } template <typename InIterT, typename T, typename FormatT> InIterT getInt(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt) { typedef typename IntTraits<T>::Unsigned UnsignedInt; typedef typename IntTraits<T>::Signed SignedInt; n = 0; ok = false; UnsignedInt max = std::numeric_limits<T>::max(); bool pos = false; it = getSign(it, end, pos, fmt); if (it == end) return it; bool isNeg = ! pos; if( isNeg ) { // return if minus sign was parsed for unsigned type if( isNeg != std::numeric_limits<T>::is_signed) return it; // abs(min) is max for negative signed types SignedInt smin = std::numeric_limits<T>::min(); max = static_cast<UnsignedInt>(-smin); } // parse number UnsignedInt u = 0; const UnsignedInt base = fmt.base; while(it != end) { unsigned char d = fmt.toDigit(*it); if(d >= base) break; if ( u != 0u && base > (max/u) ) return it; u *= base; if(d > max - u) return it; u += d; ++it; } if( isNeg ) n = static_cast<T>(u * -1); else n = static_cast<T>(u); ok = true; return it; } template <typename InIterT, typename T> InIterT getInt(InIterT it, InIterT end, bool& ok, T& n) { return getInt(it, end, ok, n, DecimalFormat<char>() ); } template <typename InIterT, typename T, typename FormatT> InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt) { typedef typename FormatT::CharT CharT; CharT zero = fmt.toChar(0); n = 0.0; ok = false; bool pos = false; it = getSign(it, end, pos, fmt); if (it == end) return it; // NaN, -inf, +inf bool done = false; while(it != end) { switch(std::char_traits<CharT>::to_int_type(*it)) { case 'n': case 'N': if(++it == end) return it; if(*it != CharT('a') && *it != CharT('A')) return it; if(++it == end) return it; if(*it != CharT('n') && *it != CharT('N')) return it; // NaNQ, NaNS (seen on AIX/xlC) { InIterT nit = it; ++nit; if (*nit == CharT('q') || *nit == CharT('Q')) { n = std::numeric_limits<T>::quiet_NaN(); ++it; } else if (*nit == CharT('s') || *nit == CharT('S')) { n = std::numeric_limits<T>::signaling_NaN(); ++it; } else { n = std::numeric_limits<T>::quiet_NaN(); } } ok = true; return ++it; break; case 'i': case 'I': if(++it == end) return it; if(*it != CharT('n') && *it != CharT('N')) return it; if(++it == end) return it; if(*it != CharT('f') && *it != CharT('F')) return it; if( ++it != end ) { if(*it != CharT('i') && *it != CharT('I')) return it; if(++it == end) return it; if(*it != CharT('n') && *it != CharT('N')) return it; if(++it == end) return it; if(*it != CharT('i') && *it != CharT('I')) return it; if(++it == end) return it; if(*it != CharT('t') && *it != CharT('T')) return it; if(++it == end) return it; if(*it != CharT('y') && *it != CharT('Y')) return it; ++it; } n = std::numeric_limits<T>::infinity(); if(!pos) n *= -1; ok = true; return it; break; default: done = true; break; } if(done) break; ++it; } // integral part bool withFractional = false; for( ; it != end; ++it) { if( *it == fmt.point() || *it == fmt.e() || *it == fmt.E() ) { if( *it == fmt.point()) { withFractional = true; ++it; } break; } unsigned digit = fmt.toDigit(*it); if(digit >= fmt.base) return it; ok = true; n *= 10; n += digit; } // it is ok, if fraction is missing if(it == end) { if( ! pos ) n *= -1; ok = true; return it; } T base = 10.0; if( withFractional) { // fractional part, ignore 0 digits after dot unsigned short fractDigits = 0; size_t maxDigits = std::numeric_limits<unsigned short>::max() - std::numeric_limits<T>::digits10; while(it != end && *it == zero) { if( fractDigits > maxDigits ) return it; ++fractDigits; ++it; } // fractional part, parse like integer, skip insignificant digits unsigned short significants = 0; T fraction = 0.0; for( ; it != end; ++it) { unsigned digit = fmt.toDigit(*it); if(digit >= fmt.base) break; if( significants <= std::numeric_limits<T>::digits10 ) { fraction *= 10; fraction += digit; ++fractDigits; ++significants; } } // fractional part, scale down fraction /= std::pow(base, T(fractDigits)); n += fraction; } // exponent [e|E][+|-][0-9]* if(it != end && (*it == fmt.e() || *it == fmt.E()) ) { if(++it == end) return it; long exp = 0; it = getInt(it, end, ok, exp, fmt); if( ! ok ) return it; n *= std::pow(base, T(exp)); } if( ! pos ) n *= -1; ok = true; return it; } template <typename InIterT, typename T> InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n) { return getFloat( it, end, ok, n, FloatFormat<char>() ); } } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/decomposer.h����������������������������������������������������������0000664�0001750�0001750�00000004705�13644433072�016015� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Decomposer_h #define cxxtools_Decomposer_h #include <cxxtools/serializationinfo.h> #include <string> namespace cxxtools { class Formatter; class IDecomposer { public: typedef SerializationInfo::int_type int_type; typedef SerializationInfo::unsigned_type unsigned_type; virtual ~IDecomposer() {} virtual void setName(const std::string& name) = 0; virtual void format(Formatter& formatter) = 0; static void formatEach(const SerializationInfo& si, Formatter& formatter); }; template <typename T> class Decomposer : public IDecomposer { public: Decomposer() : _current(&_si) { } void begin(const T& type) { _si.clear(); _si <<= type; } virtual void setName(const std::string& name) { _si.setName(name); } virtual void format(Formatter& formatter) { formatEach( _si, formatter ); } private: SerializationInfo _si; SerializationInfo* _current; }; } // namespace cxxtools #endif �����������������������������������������������������������cxxtools-3.0/include/cxxtools/iso8859_1codec.h������������������������������������������������������0000664�0001750�0001750�00000004122�13644433072�016214� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2015 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ISO8859_1CODEC_H #define CXXTOOLS_ISO8859_1CODEC_H #include <cxxtools/charmapcodec.h> namespace cxxtools { class Iso8859_1Codec : public CharMapCodec { public: explicit Iso8859_1Codec(size_t ref = 0); static String decode(const char* data, unsigned size) { return cxxtools::decode<Iso8859_1Codec>(data, size); } static String decode(const std::string& data) { return cxxtools::decode<Iso8859_1Codec>(data); } static std::string encode(const Char* data, unsigned size) { return cxxtools::encode<Iso8859_1Codec>(data, size); } static std::string encode(const String& data) { return cxxtools::encode<Iso8859_1Codec>(data); } }; } //namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/textbuffer.h����������������������������������������������������������0000664�0001750�0001750�00000034576�13644433072�016044� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_TextBuffer_h #define cxxtools_TextBuffer_h #include <cxxtools/char.h> #include <cxxtools/textcodec.h> #include <cxxtools/conversionerror.h> #include <iostream> #include <utility> namespace cxxtools { /** @brief Converts character sequences with different encodings. This class derives from std::basic_streambuf which is the super-class of all stream buffer classes. Stream buffer classes are used to connect to an external device, transport characters from and to this external device and buffer the characters in an internal buffer. The internal character set can be specified using the template parameters 'char_type_', the external character set using 'extern_type_'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be completely managed by this class and also be deleted by this class when it's destructed! @see std::basic_streambuf */ template <typename CharT, typename ByteT> class BasicTextBuffer : public std::basic_streambuf<CharT> { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits<CharT> traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef TextCodec<char_type, extern_type> CodecType; typedef MBState state_type; private: static const int _pbmax = 4; static const int _ebufmax = 256; extern_type _ebuf[_ebufmax]; int _ebufsize; static const int _ibufmax = 256; intern_type _ibuf[_ibufmax]; //! Contains the state of conversion. state_type _state; //! The codec which is used to convert character data from or to the external device. CodecType* _codec; std::basic_ios<extern_type>* _target; public: /** @brief Creates a BasicTextBuffer using the given stream buffer and codec. The given stream buffer @a target is used as external device, buffered by this Text buffer and all input from and output to the external device is converted using the codec @a codec. Note: The Codec object which is passed as pointer will be managed by this class and also be deleted by this class on destruction. */ BasicTextBuffer(std::basic_ios<extern_type>* target, CodecType* codec) : _ebufsize(0) , _codec(codec) , _target(target) { this->setg(0, 0, 0); this->setp(0, 0); } ~BasicTextBuffer() throw() { try { this->terminate(); } catch(...) {} if(_codec && _codec->refs() == 0) delete _codec; } void attach(std::basic_ios<extern_type>& target) { this->terminate(); _target = ⌖ } void detach() { this->terminate(); _target = 0; } int terminate() { if( this->pptr() ) { if( -1 == this->sync() ) return -1; if( _codec && ! _codec->always_noconv() ) { typename CodecType::result res = CodecType::error; do { extern_type* next = 0; res = _codec->unshift(_state, _ebuf, _ebuf + _ebufmax, next); _ebufsize = next - _ebuf; if(res == CodecType::error) { throw ConversionError("character conversion failed"); } else if(res == CodecType::ok || res == CodecType::partial) { if(_ebufsize > 0) { _ebufsize -= _target->rdbuf()->sputn(_ebuf, _ebufsize); if(_ebufsize) return -1; } } } while(res == CodecType::partial); } } this->setp(0, 0); this->setg(0, 0, 0); _ebufsize = 0; _state = state_type(); return 0; } std::streamsize import() { if( _target ) { std::streamsize n = _target->rdbuf()->in_avail(); return do_underflow(n).second; } return this->in_avail(); } protected: // inheritdoc virtual int sync() { if( this->pptr() ) { // Try to write out the whole buffer to the underlying stream. // Fail if we can not make progress, because more characters // are needed to continue a multi-byte sequence. while( this->pptr() > this->pbase() ) { const char_type* p = this->pptr(); if( this->overflow( traits_type::eof() ) == traits_type::eof() ) return -1; if( p == this->pptr() ) throw ConversionError("character conversion failed"); } } return 0; } virtual std::streamsize showmanyc() { return 0; } // inheritdoc virtual int_type overflow( int_type ch = traits_type::eof() ) { if( ! _target || this->gptr() ) return traits_type::eof(); if( ! this->pptr() ) { this->setp( _ibuf, _ibuf + _ibufmax ); } while( this->pptr() > this->pbase() ) { const char_type* fromBegin = _ibuf; const char_type* fromEnd = this->pptr(); const char_type* fromNext = fromBegin; extern_type* toBegin = _ebuf + _ebufsize; extern_type* toEnd = _ebuf + _ebufmax; extern_type* toNext = toBegin; typename CodecType::result res = CodecType::noconv; if(_codec) res = _codec->out(_state, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); if(res == CodecType::noconv) { size_t fromSize = fromEnd - fromBegin; size_t toSize = toEnd - toBegin; size_t size = toSize < fromSize ? toSize : fromSize; this->copyChars( toBegin, fromBegin, size ); fromNext += size; toNext += size; } _ebufsize += toNext - toBegin; size_t leftover = fromEnd - fromNext; if(leftover && fromNext > fromBegin) { std::char_traits<char_type>::move(_ibuf, fromNext, leftover); } this->setp( _ibuf, _ibuf + _ibufmax ); this->pbump( leftover ); if(res == CodecType::error) throw ConversionError("character conversion failed"); if(res == CodecType::partial && _ebufsize == 0) break; _ebufsize -= _target->rdbuf()->sputn(_ebuf, _ebufsize); if(_ebufsize) return traits_type::eof(); } if( ! traits_type::eq_int_type(ch, traits_type::eof()) ) { *( this->pptr() ) = traits_type::to_char_type(ch); this->pbump(1); } return traits_type::not_eof(ch); } // inheritdoc virtual int_type underflow() { if( ! _target ) return traits_type::eof(); if( this->gptr() < this->egptr() ) return traits_type::to_int_type( *this->gptr() ); return do_underflow(_ebufmax).first; } std::pair<int_type, std::streamsize> do_underflow(std::streamsize size) { typedef std::pair<int_type, std::streamsize> ret_type; std::streamsize n = 0; if( this->pptr() ) { if( -1 == this->terminate() ) return ret_type(traits_type::eof(), 0); } if( ! this->gptr() ) { this->setg(_ibuf, _ibuf, _ibuf); } if( this->gptr() - this->eback() > _pbmax) { std::streamsize movelen = this->egptr() - this->gptr() + _pbmax; std::char_traits<char_type>::move( _ibuf, this->gptr() - _pbmax, movelen ); this->setg(_ibuf, _ibuf + _pbmax, _ibuf + movelen); } bool atEof = false; const std::streamsize bufavail = _ebufmax - _ebufsize; const std::streamsize in_avail = _target->rdbuf()->in_avail(); if (bufavail < size) size = bufavail; if (in_avail > 0 && in_avail < size) size = in_avail; if (size > 0) { n = _target->rdbuf()->sgetn( _ebuf + _ebufsize, size ); _ebufsize += n; if(n == 0) atEof = true; } const extern_type* fromBegin = _ebuf; const extern_type* fromEnd = _ebuf + _ebufsize; const extern_type* fromNext = fromBegin; char_type* toBegin = this->egptr(); char_type* toEnd = _ibuf + _ibufmax; char_type* toNext = toBegin; typename CodecType::result r = CodecType::noconv; if (_codec) { r = _codec->in(_state, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); std::streamsize consumed = fromNext - fromBegin; if(consumed) { std::char_traits<extern_type>::move( _ebuf, _ebuf + consumed, _ebufsize ); _ebufsize -= consumed; } } else { // copy characters and advance toNext int n = _ebufsize > _ibufmax ? _ibufmax : _ebufsize; this->copyBytes(toBegin, fromBegin, n); _ebufsize -= n; toNext += n; } std::streamsize generated = toNext - toBegin; if(generated) { this->setg(this->eback(), // start of read buffer this->gptr(), // gptr position this->egptr() + generated ); // end of read buffer } if(r == CodecType::error) throw ConversionError("character conversion failed"); if( this->gptr() < this->egptr() ) return ret_type(traits_type::to_int_type( *this->gptr() ), n); // fail if partial charactes are at the end of the stream if(r == CodecType::partial && atEof) throw ConversionError("character conversion failed"); return ret_type(traits_type::eof(), 0); } static void copyChars(extern_type* s1, const char_type* s2, size_t n) { while(n-- > 0) { *s1 = std::char_traits<char_type>::to_int_type(*s2); ++s1; ++s2; } } static void copyBytes(char_type* s1, const extern_type* s2, size_t n) { while(n-- > 0) { *s1 = std::char_traits<char_type>::to_char_type(*s2); ++s1; ++s2; } } }; /** @brief Buffers the conversion of 8-bit character sequences to unicode. The internal type is cxxtools::Char. The external type is $char$. See BasicTextBuffer for a more detailed description. */ class TextBuffer : public BasicTextBuffer<cxxtools::Char, char> { public: typedef TextCodec<cxxtools::Char, char> Codec; public: /** @brief Constructs a new TextBuffer See BasicTextBuffer::BasicTextBuffer() for a more detailed description. @param buffer The buffer (external device) which is wrapped by this object. @param codec The codec which is used to convert data from and to the external device. */ TextBuffer(std::ios* buffer, Codec* codec); }; } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/method.tpp������������������������������������������������������������0000664�0001750�0001750�00000100537�13644433072�015511� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// BEGIN_Method 10 /** The Method class wraps member functions for use with the signals/slots framework. */ template < typename R,typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Method : public Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>(obj,ptr); } /** MethodSlot wraps Method objects so that they can act as Slots. */ template < typename R, typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class MethodSlot : public BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> { public: /** Wraps the given Method object. */ MethodSlot(const Method<R, ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& method) : _method( method ) {} /** Creates a copy of this object and returns it. The caller owns the returned object. */ Slot* clone() const { return new MethodSlot(*this); } /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_method; } virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } virtual bool equals(const Slot& slot) const { const MethodSlot* ms = dynamic_cast<const MethodSlot*>(&slot); return ms ? (_method == ms->_method) : false; } private: Method<R, ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> _method; }; /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>( callable( obj, memFunc ) ); } // END_Method 10 // BEGIN_Method 9 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9>( callable( obj, memFunc ) ); } // END_Method 9 // BEGIN_Method 8 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7,a8); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8>( callable( obj, memFunc ) ); } // END_Method 8 // BEGIN_Method 7 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7>( callable( obj, memFunc ) ); } // END_Method 7 // BEGIN_Method 6 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6> Method<R,ClassT,A1,A2,A3,A4,A5,A6> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6>( callable( obj, memFunc ) ); } // END_Method 6 // BEGIN_Method 5 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5> class Method<R,ClassT, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5> Method<R,ClassT,A1,A2,A3,A4,A5> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)) { return Method<R,ClassT,A1,A2,A3,A4,A5>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5> MethodSlot<R,ClassT,A1,A2,A3,A4,A5> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5>( callable( obj, memFunc ) ); } // END_Method 5 // BEGIN_Method 4 template < typename R, typename ClassT,class A1, class A2, class A3, class A4> class Method<R,ClassT, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return (_object->*_memFunc)(a1,a2,a3,a4); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4> Method<R,ClassT,A1,A2,A3,A4> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4)) { return Method<R,ClassT,A1,A2,A3,A4>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4> MethodSlot<R,ClassT,A1,A2,A3,A4> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4>( callable( obj, memFunc ) ); } // END_Method 4 // BEGIN_Method 3 template < typename R, typename ClassT,class A1, class A2, class A3> class Method<R,ClassT, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3) const { return (_object->*_memFunc)(a1,a2,a3); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3> Method<R,ClassT,A1,A2,A3> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3)) { return Method<R,ClassT,A1,A2,A3>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3> MethodSlot<R,ClassT,A1,A2,A3> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3) ) { return MethodSlot<R,ClassT,A1,A2,A3>( callable( obj, memFunc ) ); } // END_Method 3 // BEGIN_Method 2 template < typename R, typename ClassT,class A1, class A2> class Method<R,ClassT, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2) const { return (_object->*_memFunc)(a1,a2); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2> Method<R,ClassT,A1,A2> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2)) { return Method<R,ClassT,A1,A2>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2> MethodSlot<R,ClassT,A1,A2> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2) ) { return MethodSlot<R,ClassT,A1,A2>( callable( obj, memFunc ) ); } // END_Method 2 // BEGIN_Method 1 template < typename R, typename ClassT,class A1> class Method<R,ClassT, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1) const { return (_object->*_memFunc)(a1); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1> Method<R,ClassT,A1> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1)) { return Method<R,ClassT,A1>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1> MethodSlot<R,ClassT,A1> slot( ClassT & obj, R (BaseT::*memFunc)(A1) ) { return MethodSlot<R,ClassT,A1>( callable( obj, memFunc ) ); } // END_Method 1 // BEGIN_Method 0 template < typename R, typename ClassT> class Method<R,ClassT, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()() const { return (_object->*_memFunc)(); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT> Method<R,ClassT> callable( ClassT & obj, R (BaseT::*ptr)()) { return Method<R,ClassT>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT> MethodSlot<R,ClassT> slot( ClassT & obj, R (BaseT::*memFunc)() ) { return MethodSlot<R,ClassT>( callable( obj, memFunc ) ); } // END_Method 0 �����������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/filedevice.h����������������������������������������������������������0000664�0001750�0001750�00000004454�13644433072�015755� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_System_FileDevice_h #define cxxtools_System_FileDevice_h #include <cxxtools/iodevice.h> namespace cxxtools { class FileDevice : public IODevice { friend class FileDeviceImpl; private: class FileDeviceImpl* _impl; public: FileDevice(); FileDevice( const std::string& path, IODevice::OpenMode mode, bool inherit = true); ~FileDevice(); void open( const std::string& path, IODevice::OpenMode mode, bool inherit = true); const char* path() const { return _path.c_str(); } size_t size() const; protected: bool onSeekable() const { return true; } pos_type onSeek(off_type offset, std::ios::seekdir sd); size_t onPeek(char* buffer, size_t count); IODeviceImpl& ioimpl(); SelectableImpl& simpl(); private: std::string _path; }; } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/sourceinfo.h����������������������������������������������������������0000664�0001750�0001750�00000010554�13644433072�016030� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2006 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SourceInfo_h #define cxxtools_SourceInfo_h #include <string> // GNU C++ compiler #ifdef __GNUC__ #define CXXTOOLS_FUNCTION __PRETTY_FUNCTION__ // Borland C++ #elif defined(__BORLANDC__) #define CXXTOOLS_FUNCTION __FUNC__ // Microsoft C++ compiler #elif defined(_MSC_VER) // .NET 2003 support's demangled function names #if _MSC_VER >= 1300 #define CXXTOOLS_FUNCTION __FUNCDNAME__ #else #define CXXTOOLS_FUNCTION __FUNCTION__ #endif // otherwise use standard macro #else #define CXXTOOLS_FUNCTION "unknown symbol" #endif #define CXXTOOLS_STRINGIFY(x) #x #define CXXTOOLS_TOSTRING(x) CXXTOOLS_STRINGIFY(x) #define CXXTOOLS_SOURCEINFO_STR __FILE__ ":" CXXTOOLS_TOSTRING(__LINE__) /** @brief Construct a SourceInfo object */ #define CXXTOOLS_SOURCEINFO cxxtools::SourceInfo(__FILE__, CXXTOOLS_TOSTRING(__LINE__), CXXTOOLS_FUNCTION) namespace cxxtools { /** @brief Source code info class @ingroup cxxtools This class is used to store information about a location in the source code. The CXXTOOLS_SOURCEINFO macro can be used to construct a cxxtools::SourceInfo object conveniently. @code cxxtools::SourceInfo si(CXXTOOLS_SOURCEINFO); // print file, line and function std::cout << si.file() << std::endl; std::cout << si.line() << std::endl; std::cout << si.func() << std::endl; // print combined string std::cout << si.where() << std::endl; @endcode */ class SourceInfo { public: /** @brief Constructor Do not use the constructor directly, but the CXXTOOLS_SOURCEINFO macro to take advantage of compiler specific macros to indicate the source file name, position and function name. */ inline SourceInfo(const char* file, const char* line, const char* func) : _file(file), _line(line), _func(func) { } /** @brief Returns the filename */ inline const char* file() const { return _file; } /** @brief Returns the line number */ inline const char* line() const { return _line; } /** @brief Returns the function signature */ inline const char* func() const { return _func; } private: const char* _file; const char* _line; const char* _func; }; inline std::string operator+(const std::string& what, const SourceInfo& info) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } inline std::string operator+(const char* what, const SourceInfo& info) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } inline std::string operator+( const SourceInfo& info, const std::string& what) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } inline std::string operator+(const SourceInfo& info, const char* what) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/signal.h��������������������������������������������������������������0000664�0001750�0001750�00000017442�13644433072�015134� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2006 by Dr. Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Signal_h #define cxxtools_Signal_h #include <cxxtools/void.h> #include <cxxtools/event.h> #include <cxxtools/function.h> #include <cxxtools/method.h> #include <cxxtools/constmethod.h> #include <cxxtools/connectable.h> #include <list> #include <map> namespace cxxtools { /** @internal */ class SignalBase : public Connectable { public: struct Sentry { Sentry(const SignalBase* signal); ~Sentry(); void detach(); bool operator!() const { return _signal == 0; } const SignalBase* _signal; }; SignalBase(); ~SignalBase(); SignalBase& operator=(const SignalBase& other); virtual void onConnectionOpen(const Connection& c); virtual void onConnectionClose(const Connection& c); void disconnectSlot(const Slot& slot); private: mutable Sentry* _sentry; mutable bool _sending; mutable bool _dirty; }; #include <cxxtools/signal.tpp> struct CompareEventTypeInfo { bool operator()( const std::type_info* t1, const std::type_info* t2 ) const; }; template <> class Signal<const cxxtools::Event&> : public Connectable { struct Sentry { Sentry(const Signal* signal); ~Sentry(); void detach(); bool operator!() const { return _signal == 0; } const Signal* _signal; }; class IEventRoute { public: IEventRoute(Connection& target) : _target(target) { } virtual ~IEventRoute() {} virtual void route(const cxxtools::Event& ev) { typedef Invokable<const cxxtools::Event&> InvokableT; const InvokableT* invokable = static_cast<const InvokableT*>( _target.slot().callable() ); invokable->invoke(ev); } Connection& connection() { return _target; } bool valid() const { return _target.valid(); } private: Connection _target; }; template <typename EventT> class EventRoute : public IEventRoute { public: EventRoute(Connection& target) : IEventRoute(target) { } virtual void route(const cxxtools::Event& ev) { typedef Invokable<const cxxtools::Event&> InvokableT; const InvokableT* invokable = static_cast<const InvokableT*>( connection().slot().callable() ); const EventT& event = static_cast<const EventT&>(ev); invokable->invoke(event); } }; typedef std::multimap< const std::type_info*, IEventRoute*, CompareEventTypeInfo > RouteMap; // make non copyable #if __cplusplus >= 201103L Signal(const Signal&) = delete; Signal& operator=(const Signal&) = delete; #else Signal(const Signal&) { } Signal& operator=(const Signal&) { return *this; } #endif public: Signal(); ~Signal(); void send(const cxxtools::Event& ev) const; template <typename R> Connection connect(const BasicSlot<R, const cxxtools::Event&>& slot) { Connection conn( *this, slot.clone() ); this->addRoute( 0, new IEventRoute(conn) ); return conn; } template <typename R> void disconnect(const BasicSlot<R, const cxxtools::Event&>& slot) { this->removeRoute(slot); } template <typename EventT> void subscribe( const BasicSlot<void, const EventT&>& slot ) { Connection conn( *this, slot.clone() ); const std::type_info& ti = typeid(EventT); this->addRoute( &ti, new EventRoute<EventT>(conn) ); } template <typename EventT> void unsubscribe( const BasicSlot<void, const EventT&>& slot ) { const std::type_info& ti = typeid(EventT); this->removeRoute(&ti, slot); } virtual void onConnectionOpen(const Connection& c); virtual void onConnectionClose(const Connection& c); protected: void addRoute(const std::type_info* ti, IEventRoute* route); void removeRoute(const Slot& slot); void removeRoute(const std::type_info* ti, const Slot& slot); private: mutable RouteMap _routes; mutable Sentry* _sentry; mutable bool _sending; mutable bool _dirty; }; template <typename R> Connection connect(Signal<const cxxtools::Event&>& signal, R(*func)(const cxxtools::Event&)) { return signal.connect( slot(func) ); } template <typename R, class BaseT, class ClassT> Connection connect( Signal<const cxxtools::Event&>& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) ) { return signal.connect( slot(object, memFunc) ); } template <typename R, class BaseT, class ClassT> Connection connect( Signal<const cxxtools::Event&>& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) const ) { return signal.connect( slot(object, memFunc) ); } inline Connection connect(Signal<const cxxtools::Event&>& sender, Signal<const cxxtools::Event&>& receiver) { return sender.connect( slot(receiver) ); } template <typename R> void disconnect(Signal<const cxxtools::Event&>& signal, R(*func)(const cxxtools::Event&)) { signal.disconnect( slot(func) ); } template <typename R, class BaseT, class ClassT> void disconnect( Signal<const cxxtools::Event&>& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) ) { signal.disconnect( slot(object, memFunc) ); } template <typename R, class BaseT, class ClassT> void disconnect( Signal<const cxxtools::Event&>& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) const ) { signal.disconnect( slot(object, memFunc) ); } inline void disconnect(Signal<const cxxtools::Event&>& sender, Signal<const cxxtools::Event&>& receiver) { sender.disconnect( slot(receiver) ); } } // !namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/serviceregistry.h�����������������������������������������������������0000664�0001750�0001750�00000035475�13644433072�017116� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SERVICEREGISTRY_H #define CXXTOOLS_SERVICEREGISTRY_H #include <cxxtools/serviceprocedure.h> #include <cxxtools/callable.h> #include <cxxtools/function.h> #include <cxxtools/method.h> #include <string> #include <vector> #include <map> namespace cxxtools { class ServiceRegistry { ServiceRegistry(const ServiceRegistry&) { } ServiceRegistry& operator=(const ServiceRegistry&) { return *this; } public: ServiceRegistry() { } ~ServiceRegistry(); template <typename R> void registerFunction(const std::string& name, R (*fn)()) { ServiceProcedure* proc = new BasicServiceProcedure<R>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1> void registerFunction(const std::string& name, R (*fn)(A1)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2> void registerFunction(const std::string& name, R (*fn)(A1, A2)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7, A8)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>(callable(fn)); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10> void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>(callable(fn)); this->registerProcedure(name, proc); } template <typename R> void registerCallable(const std::string& name, const Callable<R>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1> void registerCallable(const std::string& name, const Callable<R, A1>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2> void registerCallable(const std::string& name, const Callable<R, A1, A2>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4, A5>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4, A5, A6>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4, A5, A6, A7>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>(cb); this->registerProcedure(name, proc); } template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10> void registerCallable(const std::string& name, const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& cb) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>(cb); this->registerProcedure(name, proc); } template <typename R, class C> void registerMethod(const std::string& name, C& obj, R (C::*method)() ) { ServiceProcedure* proc = new BasicServiceProcedure<R>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4, typename A5> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7, A8) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>( callable(obj, method) ); this->registerProcedure(name, proc); } template <typename R, class C, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10> void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) ) { ServiceProcedure* proc = new BasicServiceProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>( callable(obj, method) ); this->registerProcedure(name, proc); } ServiceProcedure* getProcedure(const std::string& name) const; void releaseProcedure(ServiceProcedure* proc) const; std::vector<std::string> getProcedureNames() const; protected: void registerProcedure(const std::string& name, ServiceProcedure* proc); private: typedef std::map<std::string, ServiceProcedure*> ProcedureMap; ProcedureMap _procedures; }; } #endif // CXXTOOLS_SERVICEREGISTRY_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/csv.h�����������������������������������������������������������������0000664�0001750�0001750�00000013364�13644433072�014451� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSV_H #define CXXTOOLS_CSV_H #include <cxxtools/csvserializer.h> #include <cxxtools/csvdeserializer.h> #include <iostream> namespace cxxtools { /** Wrapper object to easily print serializable objects as csv to a output stream. CsvOObject is a little wrapper which makes it easy to output serializable objects into s ostream. For this the CsvOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::basic_ostream, which prints the object in json format. Example: \code std::vector<std::vector<int> > v(2); v[0].push_back(4); v[0].push_back(17); v[0].push_back(12); v[1].push_back(45); v[1].push_back(-3); v[1].push_back(76); std::cout << cxxtools::Csv(v) << std::endl; \endcode */ template <typename ObjectType> class CsvOObject { const ObjectType& _object; Char _delimiter; Char _quote; String _lineEnding; public: /// Constructor. Needs the wrapped object. explicit CsvOObject(const ObjectType& object) : _object(object), _delimiter(0), _quote(0) { } CsvOObject& delimiter(Char delimiter) { _delimiter = delimiter; return *this; } CsvOObject& quote(Char quote) { _quote = quote; return *this; } CsvOObject& lineEnding(const String& lineEnding) { _lineEnding = lineEnding; return *this; } Char delimiter() const { return _delimiter; } Char quote() const { return _quote; } const String& lineEnding() const { return _lineEnding; } const ObjectType& object() const { return _object; } }; /// The output operator for CsvOObject. It does the actual work. template <typename CharType, typename ObjectType> std::basic_ostream<CharType>& operator<< (std::basic_ostream<CharType>& out, const CsvOObject<ObjectType>& object) { try { CsvSerializer serializer(out); if (object.delimiter() != CsvParser::autoDelimiter) serializer.delimiter(object.delimiter()); if (object.quote() != Char(0)) serializer.quote(object.quote()); if (!object.lineEnding().empty()) serializer.lineEnding(object.lineEnding()); serializer.serialize(object.object()); } catch (const std::exception&) { out.setstate(std::ios::failbit); throw; } return out; } /// Function, which creates a CsvOObject. /// This makes the syntactic sugar perfect. See the example at CsvOObject /// for its use. template <typename ObjectType> CsvOObject<ObjectType> Csv(const ObjectType& object) { return CsvOObject<ObjectType>(object); } template <typename ObjectType> class CsvIOObject : public CsvOObject<ObjectType> { ObjectType& _object; bool _readTitle; public: explicit CsvIOObject(ObjectType& object) : CsvOObject<ObjectType>(object), _object(object), _readTitle(true) { } CsvIOObject& delimiter(Char delimiter) { CsvOObject<ObjectType>::delimiter(delimiter); return *this; } CsvIOObject& readTitle(bool sw) { _readTitle = sw; return *this; } Char delimiter() const { return CsvOObject<ObjectType>::delimiter(); } bool readTitle() const { return _readTitle; } ObjectType& object() { return _object; } }; /// The input operator for CsvIOObject. It does the actual work. template <typename CharType, typename ObjectType> std::basic_istream<CharType>& operator>> (std::basic_istream<CharType>& in, CsvIOObject<ObjectType> object) { try { CsvDeserializer deserializer; if (object.delimiter() != CsvParser::autoDelimiter) deserializer.delimiter(object.delimiter()); deserializer.readTitle(object.readTitle()); deserializer.read(in); deserializer.deserialize(object.object()); } catch (const std::exception&) { in.setstate(std::ios::failbit); throw; } return in; } template <typename ObjectType> CsvIOObject<ObjectType> Csv(ObjectType& object) { return CsvIOObject<ObjectType>(object); } } #endif // CXXTOOLS_CSV_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/md5.h�����������������������������������������������������������������0000664�0001750�0001750�00000005541�13644433072�014341� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MD5_H #define CXXTOOLS_MD5_H #include <cxxtools/md5stream.h> #include <iterator> #include <algorithm> namespace cxxtools { template <typename iterator_type> std::string md5(iterator_type from, iterator_type to) { Md5stream s; std::copy(from, to, std::ostream_iterator<char>(s)); return s.getHexDigest(); } template <typename data_type> std::string md5(const data_type& data) { Md5stream s; s << data; return s.getHexDigest(); } template <typename data_type> class md5_hash { std::string digest; public: explicit md5_hash(const data_type& data) { unsigned char _digest[16]; Md5stream s; s << data; s.getDigest(_digest); digest.assign(reinterpret_cast<char*>(&_digest[0]), reinterpret_cast<char*>(&_digest[0] + 16)); } md5_hash(typename data_type::const_iterator from, typename data_type::const_iterator to) { unsigned char _digest[16]; Md5stream s; std::copy(from, to, std::ostream_iterator<char>(s)); s.getDigest(_digest); digest.assign(reinterpret_cast<char*>(&_digest[0]), reinterpret_cast<char*>(&_digest[0] + 16)); } static const unsigned short blockSize = 64; std::string getHexDigest() const { static const char hex[] = "0123456789abcdef"; std::string ret; ret.reserve(32); for (unsigned n = 0; n < 16; ++n) { ret.push_back(hex[(digest[n] >> 4) & 0xf]); ret.push_back(hex[digest[n] & 0xf]); } return ret; } std::string getDigest() const { return digest; } }; } #endif // CXXTOOLS_MD5_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/fileinfo.h������������������������������������������������������������0000664�0001750�0001750�00000011112�13644433072�015436� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FILEINFO_H #define CXXTOOLS_FILEINFO_H #include <string> namespace cxxtools { class DirectoryIterator; /** @brief Provides information about a node in the file-system. */ class FileInfo { public: //! @brief File-node type enum Type { Invalid = 0, Directory = 1, File = 2, Chardev = 3, Blockdev = 4, Fifo = 5, Symlink = 6, Socket = 7 }; public: //! @brief Default constructor FileInfo(); /** @brief Constructs a %FileInfo object from the path \a path */ explicit FileInfo(const std::string& path); explicit FileInfo(const DirectoryIterator& it); //! @brief Copy constructor FileInfo(const FileInfo& fi); //! @brief Destructor ~FileInfo(); //! @brief Assignment operator FileInfo& operator=(const FileInfo& fi); //! @brief Returns the type of the file node Type type() const; const std::string& path() const; /** @brief Returns the full path of node in the file-system This method may return a relative path, or a fully qualified one depending on how this object was constructed. */ std::string name() const; /** @brief Returns the parent directory path This method might return an empty string if the node was created without a complete path. If the directory is located in the root directory of a unix file system, a slash ("/") is returned. A returned directory path always ends with a trailing path separator character. (A backslash in Windows and a slash in Unix, for example.) */ std::string dirName() const; //! @brief Returns the size of the file in bytes std::size_t size() const; //! @brief Returns true if the node is a directory bool isDirectory() const { return _type == FileInfo::Directory; } //! @brief Returns true if the node is a file bool isFile() const { return _type == FileInfo::File; } /** @brief Removes the file node. This object will be invalid after calling this method. */ void remove(); /** @brief Moves the file node to the location given by \a to The object will stay valid after this method was called and point to the moved file node. */ void move(const std::string& to); public: //! @brief Returns true if a file or directory exists at \a path static bool exists(const std::string& path); //! @brief Returns the type of file at \a path static Type getType(const std::string& path); private: //! @internal Type _type; //! @internal std::string _path; }; inline bool operator<(const FileInfo& a, const FileInfo& b) { return a.path() < b.path(); } inline bool operator==(const FileInfo& a, const FileInfo& b) { return a.path() == b.path(); } inline bool operator!=(const FileInfo& a, const FileInfo& b) { return !(a == b); } } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/char.h����������������������������������������������������������������0000664�0001750�0001750�00000050030�13653121636�014562� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CHAR_H #define CXXTOOLS_CHAR_H #include <cxxtools/config.h> #include <string> #include <cstring> #include <ios> #include <stdint.h> namespace cxxtools { /** * @brief A lightweight Character class (32 bits). * * Unicode characters are 32-bit entities. This class represents such an entity. It is lightweight, so it * can be used everywhere. Most compilers treat it like an unsigned int of 32 bits. * * This class provides methods for testing/classification, converting to and from other formats, comparing * and case-converting. To convert a character or number to a instance of this class use one of the * constructors provided. To check the type of the character use one of the method starting with "is", like * isLetter() or isDigit(). To compare lower- or upper-case use isUpper() and isLower(). To compare two * characters the corresponding operators are overloaded accordingly. Addition and substraction is supported * as well. Comparison of numeric values (>, <, ==) is supported when using these operators. * * The classification methods operate on the full range of Unicode characters. All methods return $true$ * if the character is a certain type of character. These methods are are wrappers around category() which * return the Unicode-defined category of each character. * * Comparison is critical in Unicode as it covers the characters of the entire world where characters which * look the same may be different in the thinking of numeric values (aka positions in the Unicode table) * Comparing characters will compare based purely on the numeric Unicode value (code point) of the characters. * Upper- and lower-casing using upper() and lower() will only work if the character has a well-defined * upper/lower-case equivalent. * * @see Category */ class Char { public: typedef int32_t value_type; //! Constructs a character with a value of 0. Char() : _value(0) {} //! Constructs a character using the given value as base for the character value. Char(value_type ch) : _value(ch) {} /** * @brief Narrows this character into an 8-bit char if possible. * * If the character can not be converted into an 8-bit char because its value is * greater than 255, the defaultCharacter which is passed to this method is returned. * * If this character is equal or lower than 255 the character is cast to char. * * @param def The default character which is returned if this character can not be narrowed * @return An 8-bit char which is a narrowed representation of this character object or * the default character if this character object's value is out of range (>255). */ char narrow(char def = '?') const; wchar_t toWchar() const { return wchar_t(value()); } static Char null() { return Char(0); } /** * @brief Returns the internal value (unsigned 32 bits) of this character. * @return The 32-bit-value of this character. */ value_type value() const { return _value; } /** * @brief This conversion operator converts the internal value of this character to unsigned 32 bits. * * As the internal value also is an unsigned 32-bit value, the internal value of this character * ist returned. * * @return The character converted to unsigned 32-bit. */ operator value_type() const { return _value; } //! @brief Returns $true$ if the a and b are the same character; $false$ otherwise. //! @return $true$ if the a and b are the same character; $false$ otherwise. friend bool operator==(const Char& a, const Char& b) { return a.value() == b.value(); } friend bool operator==(const Char& a, wchar_t b) { return a.value() == static_cast<value_type>(b); } friend bool operator==(wchar_t a, const Char& b) { return static_cast<value_type>(a) == b.value(); } friend bool operator==(const Char& a, char b) { return a.value() == static_cast<value_type>(b); } friend bool operator==(char a, const Char& b) { return static_cast<value_type>(a) == b.value(); } //! @brief Returns $true$ if the a and b are not the same character; $false$ otherwise. //! @return $true$ if the a and b are not the same character; $false$ otherwise. friend bool operator!=(const Char& a, const Char& b) { return a.value() != b.value(); } friend bool operator!=(const Char& a, wchar_t b) { return a.value() != static_cast<value_type>(b); } friend bool operator!=(wchar_t a, const Char& b) { return static_cast<value_type>(a) != b.value(); } friend bool operator!=(const Char& a, char b) { return a.value() != static_cast<value_type>(b); } friend bool operator!=(char a, const Char& b) { return static_cast<value_type>(a) != b.value(); } //! @brief Returns $true$ if the numeric value of a is less than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is less than the numeric value of b; $false$ otherwise. friend bool operator<(const Char& a, const Char& b) { return a.value() < b.value(); } friend bool operator<(const Char& a, wchar_t b) { return a.value() < static_cast<value_type>(b); } friend bool operator<(wchar_t a, const Char& b) { return static_cast<value_type>(a) < b.value(); } friend bool operator<(const Char& a, char b) { return a.value() < static_cast<value_type>(b); } friend bool operator<(char a, const Char& b) { return static_cast<value_type>(a) < b.value(); } //! @brief Returns $true$ if the numeric value of a is greater than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is greater than the numeric value of b; $false$ otherwise. friend bool operator>(const Char& a, const Char& b) { return a.value() > b.value(); } friend bool operator>(const Char& a, wchar_t b) { return a.value() > static_cast<value_type>(b); } friend bool operator>(wchar_t a, const Char& b) { return static_cast<value_type>(a) > b.value(); } friend bool operator>(const Char& a, char b) { return a.value() > static_cast<value_type>(b); } friend bool operator>(char a, const Char& b) { return static_cast<value_type>(a) > b.value(); } //! @brief Returns $true$ if the numeric value of a is equal or less than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is equal or less than the numeric value of b; $false$ otherwise. friend bool operator<=(const Char& a, const Char& b) { return a.value() <= b.value(); } friend bool operator<=(const Char& a, wchar_t b) { return a.value() <= static_cast<value_type>(b); } friend bool operator<=(wchar_t a, const Char& b) { return static_cast<value_type>(a) <= b.value(); } friend bool operator<=(const Char& a, char b) { return a.value() <= static_cast<value_type>(b); } friend bool operator<=(char a, const Char& b) { return static_cast<value_type>(a) <= b.value(); } //! @brief Returns $true$ if the numeric value of a is equals or greater than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is equals or greater than the numeric value of b; $false$ otherwise. friend bool operator>=(const Char& a, const Char& b) { return a.value() >= b.value(); } friend bool operator>=(const Char& a, wchar_t b) { return a.value() >= static_cast<value_type>(b); } friend bool operator>=(wchar_t a, const Char& b) { return static_cast<value_type>(a) >= b.value(); } friend bool operator>=(const Char& a, char b) { return a.value() >= static_cast<value_type>(b); } friend bool operator>=(char a, const Char& b) { return static_cast<value_type>(a) >= b.value(); } private: value_type _value; }; /// @cond internal struct MBState { MBState() : n(0) {} uint8_t n; union { Char::value_type wchars[4]; char mbytes[16]; } value; }; /// @endcond internal std::ostream& operator<< (std::ostream& out, Char ch); } // namespace cxxtools namespace std { /// @cond internal template<> struct char_traits<cxxtools::Char> { typedef cxxtools::Char char_type; typedef cxxtools::Char::value_type int_type; typedef std::streamoff off_type; typedef std::streampos pos_type; typedef cxxtools::MBState state_type; inline static void assign(char_type& c1, const char_type& c2); inline static bool eq(const char_type& c1, const char_type& c2); inline static bool lt(const char_type& c1, const char_type& c2); inline static int compare(const char_type* c1, const char_type* c2, size_t n); inline static size_t length(const char_type* s); inline static const char_type* find(const char_type* s, size_t n, const char_type& a); inline static char_type* move(char_type* s1, const char_type* s2, int_type n); inline static char_type* copy(char_type* s1, const char_type* s2, size_t n); inline static char_type* assign(char_type* s, size_t n, char_type a); inline static char_type to_char_type(const int_type& c); inline static int_type to_int_type(const char_type& c); inline static bool eq_int_type(const int_type& c1, const int_type& c2); inline static int_type eof(); inline static int_type not_eof(const int_type& c); }; /// @endcond internal inline void char_traits<cxxtools::Char>::assign(char_type& c1, const char_type& c2) { c1 = c2; } inline bool char_traits<cxxtools::Char>::eq(const char_type& c1, const char_type& c2) { return c1 == c2; } inline bool char_traits<cxxtools::Char>::lt(const char_type& c1, const char_type& c2) { return c1 < c2; } inline int char_traits<cxxtools::Char>::compare(const char_type* s1, const char_type* s2, size_t n) { while(n-- > 0) { if( !eq(*s1, *s2) ) return lt(*s1, *s2) ? -1 : +1; ++s1; ++s2; } return 0; } inline size_t char_traits<cxxtools::Char>::length(const char_type* s) { static const cxxtools::Char term(0); std::size_t n = 0; while( !eq(s[n], term) ) ++n; return n; } inline const char_traits<cxxtools::Char>::char_type* char_traits<cxxtools::Char>::find(const char_type* s, size_t n, const char_type& a) { while(n-- > 0) { if (*s == a) return s; ++s; } return 0; } inline char_traits<cxxtools::Char>::char_type* char_traits<cxxtools::Char>::move(char_type* s1, const char_type* s2, int_type n) { return static_cast<cxxtools::Char*>(std::memmove(static_cast<void*>(s1), static_cast<const void*>(s2), n * sizeof(cxxtools::Char))); } inline char_traits<cxxtools::Char>::char_type* char_traits<cxxtools::Char>::copy(char_type* s1, const char_type* s2, size_t n) { return static_cast<cxxtools::Char*>(std::memcpy(static_cast<void*>(s1), static_cast<const void*>(s2), n * sizeof(cxxtools::Char))); } inline char_traits<cxxtools::Char>::char_type* char_traits<cxxtools::Char>::assign(char_type* s, size_t n, char_type a) { while(n-- > 0) { *(s++) = a; } return s; } inline char_traits<cxxtools::Char>::char_type char_traits<cxxtools::Char>::to_char_type(const int_type& c) { return char_type(c); } inline char_traits<cxxtools::Char>::int_type char_traits<cxxtools::Char>::to_int_type(const char_type& c) { return c.value(); } inline bool char_traits<cxxtools::Char>::eq_int_type(const int_type& c1, const int_type& c2) { return c1 == c2; } inline char_traits<cxxtools::Char>::int_type char_traits<cxxtools::Char>::eof() { return static_cast<char_traits<cxxtools::Char>::int_type>( cxxtools::Char::value_type(-1) ); } inline char_traits<cxxtools::Char>::int_type char_traits<cxxtools::Char>::not_eof(const int_type& c) { return eq_int_type(c, eof()) ? 0 : c; } } // namespace std namespace cxxtools { inline char Char::narrow(char def) const { if( _value == std::char_traits<Char>::eof() ) { return std::char_traits<char>::eof(); } if( _value <= 0xff ) { return (char)_value; } return def; } } // namespace cxxtools #ifdef CXXTOOLS_WITH_STD_LOCALE #include <locale> namespace std { #if (defined _MSC_VER || defined __QNX__ || defined __xlC__) /** @brief Ctype localization facet @ingroup Unicode */ template <> class ctype< cxxtools::Char > : public ctype_base { #else /** @brief Ctype localization facet @ingroup Unicode */ template <> class ctype<cxxtools::Char> : public ctype_base, public locale::facet { #endif public: typedef ctype_base::mask mask; static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit ctype(size_t refs = 0); virtual ~ctype(); bool is(mask m, cxxtools::Char c) const { return this->do_is(m, c); } const cxxtools::Char* is(const cxxtools::Char *lo, const cxxtools::Char *hi, mask *vec) const { return this->do_is(lo, hi, vec); } const cxxtools::Char* scan_is(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const { return this->do_scan_is(m, lo, hi); } const cxxtools::Char* scan_not(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const { return this->do_scan_not(m, lo, hi); } cxxtools::Char toupper(cxxtools::Char c) const { return this->do_toupper(c); } const cxxtools::Char* toupper(cxxtools::Char *lo, const cxxtools::Char* hi) const { return this->do_toupper(lo, hi); } cxxtools::Char tolower(cxxtools::Char c) const { return this->do_tolower(c); } const cxxtools::Char* tolower(cxxtools::Char* lo, const cxxtools::Char* hi) const { return this->do_tolower(lo, hi); } cxxtools::Char widen(char c) const { return this->do_widen(c); } const char* widen(const char* lo, const char* hi, cxxtools::Char* to) const { return this->do_widen(lo, hi, to); } char narrow(cxxtools::Char c, char dfault) const { return this->do_narrow(c, dfault); } const cxxtools::Char* narrow(const cxxtools::Char* lo, const cxxtools::Char* hi, char dfault, char *to) const { return this->do_narrow(lo, hi, dfault, to); } protected: virtual bool do_is(mask m, cxxtools::Char c) const; virtual const cxxtools::Char* do_is(const cxxtools::Char* lo, const cxxtools::Char* hi, mask* vec) const; virtual const cxxtools::Char* do_scan_is(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual const cxxtools::Char* do_scan_not(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual cxxtools::Char do_toupper(cxxtools::Char) const; virtual const cxxtools::Char* do_toupper(cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual cxxtools::Char do_tolower(cxxtools::Char) const; virtual const cxxtools::Char* do_tolower(cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual cxxtools::Char do_widen(char) const; virtual const char* do_widen(const char* lo, const char* hi, cxxtools::Char* dest) const; virtual char do_narrow(cxxtools::Char, char dfault) const; virtual const cxxtools::Char* do_narrow(const cxxtools::Char* lo, const cxxtools::Char* hi, char dfault, char* dest) const; }; } // namespace std #else namespace std { class ctype_base { public: enum { alpha = 1 << 5, cntrl = 1 << 2, digit = 1 << 6, lower = 1 << 4, print = 1 << 1, punct = 1 << 7, space = 1 << 0, upper = 1 << 3, xdigit = 1 << 8, alnum = alpha | digit, graph = alnum | punct }; typedef unsigned short mask; ctype_base(size_t _refs = 0) { } }; } #endif namespace cxxtools { std::ctype_base::mask ctypeMask(const Char& ch); inline int isalpha(const Char& ch) { return ctypeMask(ch) & std::ctype_base::alpha; } inline int isalnum(const Char& ch) { return ctypeMask(ch) & std::ctype_base::alnum; } inline int ispunct(const Char& ch) { return ctypeMask(ch) & std::ctype_base::punct; } inline int iscntrl(const Char& ch) { return ctypeMask(ch) & std::ctype_base::cntrl; } inline int isdigit(const Char& ch) { return ctypeMask(ch) & std::ctype_base::digit; } inline int isxdigit(const Char& ch) { return ctypeMask(ch) & std::ctype_base::xdigit; } inline int isgraph(const Char& ch) { return ctypeMask(ch) & std::ctype_base::graph; } inline int islower(const Char& ch) { return ctypeMask(ch) & std::ctype_base::lower; } inline int isupper(const Char& ch) { return ctypeMask(ch) & std::ctype_base::upper; } inline int isprint(const Char& ch) { return ctypeMask(ch) & std::ctype_base::print; } inline int isspace(const Char& ch) { return ctypeMask(ch) & std::ctype_base::space; } Char tolower(const Char& ch); Char toupper(const Char& ch); } // namespace cxxtools #ifdef CXXTOOLS_WITH_STD_LOCALE #include <cxxtools/facets.h> #endif #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/������������������������������������������������������������������0000775�0001750�0001750�00000000000�13672344760�014352� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/net.h�������������������������������������������������������������0000664�0001750�0001750�00000006575�13644433072�015240� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_NET_H #define CXXTOOLS_NET_NET_H #include <string> namespace cxxtools { namespace net { ////////////////////////////////////////////////////////////////////// /** * Wrapper for BSD sockets. */ class Socket { #if __cplusplus >= 201103L Socket(const Socket&) = delete; Socket& operator=(const Socket&) = delete; #else Socket(const Socket&) { } Socket& operator=(const Socket&) { return *this; } #endif public: /// A socket is created. On error a net::Exception is thrown. Socket(int domain, int type, int protocol); /// A socket is initialized with a existing socket descriptor. /// Ownership is transfered to this class. explicit Socket(int fd = -1) : m_sockFd(fd), m_timeout(-1) { } /// The socket is released. /// Errors are printed on stderr. virtual ~Socket(); /// Returns true, if a socket is held. bool good() const { return m_sockFd >= 0; } /// Returns true, if no socket is held. bool bad() const { return m_sockFd < 0; } /// Returns true, if a socket is held. operator bool() const { return m_sockFd >= 0; } /// Creates a new socket. If a socket is already associated with this /// class, it is closed. void create(int domain, int type, int protocol); /// Closes the socket, if a socket is held. void close(); /// Returns the socket handle. int getFd() const { return m_sockFd; } /// wrapper around getsockname(2) std::string getSockAddr() const; /// Set timeout in milliseconds. void setTimeout(int t); /// Returns timeout in milliseconds. int getTimeout() const { return m_timeout; } /// execute poll(2) - throws Timeout-exception, when no data available /// after timeout short poll(short events) const; protected: void setFd(int sockFd); private: int m_sockFd; int m_timeout; }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_NET_H �����������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/udpstream.h�������������������������������������������������������0000664�0001750�0001750�00000005523�13644433072�016446� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UDPSTREAM_H #define CXXTOOLS_UDPSTREAM_H #include <cxxtools/net/udp.h> #include <iostream> namespace cxxtools { namespace net { class UdpStreambuf : public std::streambuf { char* message; unsigned msgsize; UdpSender& sender; int flags; void sendBuffer(); public: explicit UdpStreambuf(UdpSender& sender_, int flags_ = 0, unsigned msgsize_ = 1024) : message(new char[msgsize_]), msgsize(msgsize_), sender(sender_), flags(flags_) { } ~UdpStreambuf() { delete[] message; } protected: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; class UdpOStream : public std::ostream { UdpSender* sender; UdpStreambuf streambuf; public: explicit UdpOStream(UdpSender& sender_, int flags = 0) : std::ostream(0), sender(0), streambuf(sender_, flags) { init(&streambuf); } UdpOStream(const char* ipaddr, unsigned short int port, bool bcast = false, int flags = 0) : std::ostream(0), sender(new UdpSender(ipaddr, port, bcast)), streambuf(*sender, flags) { init(&streambuf); } ~UdpOStream() { delete sender; } }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_UDPSTREAM_H �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/addrinfo.h��������������������������������������������������������0000664�0001750�0001750�00000005312�13644433072�016224� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_ADDRINFO_H #define CXXTOOLS_NET_ADDRINFO_H #include <string> #include <cxxtools/systemerror.h> namespace cxxtools { namespace net { class AddrInfoImpl; class AddrInfo { public: AddrInfo() : _impl(0) { } explicit AddrInfo(AddrInfoImpl* impl); AddrInfo(const std::string& host, unsigned short port, bool listen = false); AddrInfo(const AddrInfo& src); ~AddrInfo(); AddrInfo& operator= (const AddrInfo& src); const std::string& host() const; unsigned short port() const; AddrInfoImpl* impl() { return _impl; } const AddrInfoImpl* impl() const { return _impl; } private: AddrInfoImpl* _impl; }; inline bool operator== (const AddrInfo& a1, const AddrInfo& a2) { return a1.impl() == a2.impl() || (a1.impl() != 0 && a2.impl() != 0 && a1.host() == a2.host() && a1.port() == a2.port()); } inline bool operator!= (const AddrInfo& a1, const AddrInfo& a2) { return !(a1 == a2); } class AddrInfoError : public SystemError { public: explicit AddrInfoError(int ret); }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_ADDRINFO_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/tcpsocket.h�������������������������������������������������������0000664�0001750�0001750�00000013177�13644433072�016445� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_net_TcpSocket_h #define CXXTOOLS_net_TcpSocket_h #include <cxxtools/iodevice.h> #include <cxxtools/net/addrinfo.h> #include <cxxtools/signal.h> #include <cxxtools/delegate.h> #include <cxxtools/string.h> #include <cxxtools/datetime.h> #include <string> namespace cxxtools { class SslCertificate; class SslCertificateNotAccepted : public std::runtime_error { public: SslCertificateNotAccepted() : std::runtime_error("certificate not accepted") { } }; namespace net { class TcpServer; class AddrInfo; class TcpSocket : public IODevice { class TcpSocketImpl* _impl; public: // flags for accept method enum { INHERIT = 1, DEFER_ACCEPT = 2 }; TcpSocket(); TcpSocket(const TcpServer& server, unsigned flags = 0); TcpSocket(const std::string& ipaddr, unsigned short int port); explicit TcpSocket(const AddrInfo& addrinfo); ~TcpSocket(); std::string getSockAddr() const; std::string getPeerAddr() const; void setTimeout(Milliseconds timeout); Milliseconds timeout() const; Milliseconds getTimeout() const { return timeout(); } void accept(const TcpServer& server, unsigned flags = 0); void connect(const AddrInfo& addrinfo); void connect(const std::string& ipaddr, unsigned short int port) { connect(AddrInfo(ipaddr, port)); } bool beginConnect(const AddrInfo& addrinfo); bool beginConnect(const std::string& ipaddr, unsigned short int port) { return beginConnect(AddrInfo(ipaddr, port)); } void endConnect(); Signal<TcpSocket&> connected; Signal<TcpSocket&> sslAccepted; Signal<TcpSocket&> sslConnected; Signal<TcpSocket&> sslClosed; Delegate<bool, const SslCertificate&> acceptSslCertificate; /** @brief Notifies when the device is closed while no reading or writing is pending */ Signal<TcpSocket&> closed; bool isConnected() const; bool isSslConnected() const; int getFd() const; short poll(short events) const; void loadSslCertificateFile(const std::string& certFile, const std::string& privateKeyFile = std::string()); /** Enables ssl peer certificate check. * * Level 0: Disables peer certificate checking, which is the default. * * Level 1: In server mode sends a client certificate request. Verify * peer certificate and fail if not valid. In server mode accept if * client sends no certificate. * * Level 2: As level 1 but in server mode do not accept ssl connection * without client certificate. * * A `ca` must be given if `level` > 0. It specifies the certification * authority file or directory. * * In any case the delegate `acceptSslCertificate` is called if * connected. If the delegate returns false, the ssl connection is * denied. A excepciton of type `cxxtools::SslCertificateNotAccepted` * is thrown. */ void setSslVerify(int level, const std::string& ca = std::string()); bool hasSslPeerCertificate() const; const SslCertificate& getSslPeerCertificate() const; /// initiates a ssl connection on the socket void beginSslConnect(); void endSslConnect(); /// blocking call for initiating ssl void sslConnect(); /// accept a ssl connection from the peer void beginSslAccept(); void endSslAccept(); /// blocking call to accept a ssl connection from the peer void sslAccept(); /// terminates ssl void beginSslShutdown(); void endSslShutdown(); /// blocking call to terminate ssl void sslShutdown(); protected: TcpSocket(TcpSocketImpl* impl) : _impl(impl) { } // inherit doc virtual size_t onBeginRead(char* buffer, size_t n, bool& eof); // inherit doc virtual size_t onBeginWrite(const char* buffer, size_t n); public: // inherit doc virtual SelectableImpl& simpl(); // inherit doc virtual IODeviceImpl& ioimpl(); }; } // namespace net } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/tcpserver.h�������������������������������������������������������0000664�0001750�0001750�00000006265�13644433072�016463� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TcpServer_H #define CXXTOOLS_NET_TcpServer_H #include <cxxtools/selectable.h> #include <cxxtools/signal.h> #include <cxxtools/ioerror.h> #include <string> #include <exception> namespace cxxtools { namespace net { class AddressInUse : public IOError { public: AddressInUse() : IOError("address in use") { } AddressInUse(const std::string& ipaddr, unsigned short int port); }; class AcceptTerminated : public std::exception { public: const char* what() const throw () { return "accept terminated"; } }; class TcpServer : public Selectable { class TcpServerImpl* _impl; public: enum { INHERIT = 1, DEFER_ACCEPT = 2, REUSEADDR = 4 }; TcpServer(); /** @brief Creates a server socket and listens on an address */ TcpServer(const std::string& ipaddr, unsigned short int port, int backlog = 5, unsigned flags = REUSEADDR); ~TcpServer(); void listen(const std::string& ipaddr, unsigned short int port, int backlog = 5, unsigned flags = REUSEADDR); // inherit doc virtual SelectableImpl& simpl(); /** @brief Stops a blocking accept The stopAccept method can be called from a thread to break a blocking accept call in another thread. The call to accept is terminated by a AcceptTerminated exception. */ void terminateAccept(); TcpServerImpl& impl() const; Signal<TcpServer&> connectionPending; protected: // inherit doc virtual void onClose(); // inherit doc virtual bool onWait(Timespan timeout); // inherit doc virtual void onAttach(SelectorBase&); // inherit doc virtual void onDetach(SelectorBase&); }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_TcpServer_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/tcpstream.h�������������������������������������������������������0000664�0001750�0001750�00000021274�13644433072�016445� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TCPSTREAM_H #define CXXTOOLS_NET_TCPSTREAM_H #include <string> #include <cxxtools/net/tcpserver.h> #include <cxxtools/net/tcpsocket.h> #include <cxxtools/net/addrinfo.h> #include <cxxtools/iostream.h> namespace cxxtools { namespace net { /** A buffered TCP/IP stream which supports asyncronous communication. * * When a object is created a buffer size is passed. By default the buffer size * is 0, which means, that the buffer is dynamically extended when needed so that * writing do not block. */ class TcpStream : public IOStream { void init(cxxtools::Timespan timeout); public: /// Creates a not connected TCP stream object. explicit TcpStream(unsigned bufsize = 0, cxxtools::Milliseconds timeout = Selectable::WaitInfinite) : IOStream(bufsize > 0 ? bufsize : 8192, bufsize == 0), acceptSslCertificate(_socket.acceptSslCertificate) { init(timeout); } /// Creates a TCP stream object and connects to the specified IP address and port. TcpStream(const std::string& ipaddr, unsigned short int port, unsigned bufsize = 0, cxxtools::Milliseconds timeout = Selectable::WaitInfinite) : IOStream(bufsize > 0 ? bufsize : 8192, bufsize == 0), acceptSslCertificate(_socket.acceptSslCertificate), _socket(ipaddr, port) { init(timeout); } /// Creates a TCP stream object and connects to the specified address info. explicit TcpStream(const AddrInfo& addrinfo, unsigned bufsize = 0, cxxtools::Milliseconds timeout = Selectable::WaitInfinite) : IOStream(bufsize > 0 ? bufsize : 8192, bufsize == 0), acceptSslCertificate(_socket.acceptSslCertificate), _socket(addrinfo) { init(timeout); } /// Creates a TCP stream object and connects to the specified IP address and port. TcpStream(const char* ipaddr, unsigned short int port, unsigned bufsize = 8192, cxxtools::Milliseconds timeout = Selectable::WaitInfinite) : IOStream(bufsize, true), acceptSslCertificate(_socket.acceptSslCertificate), _socket(ipaddr, port) { init(timeout); } /// Creates a TCP stream object and accepts a connection from a server. explicit TcpStream(TcpServer& server, unsigned bufsize = 8192, unsigned flags = 0, cxxtools::Milliseconds timeout = Selectable::WaitInfinite) : IOStream(bufsize, true), acceptSslCertificate(_socket.acceptSslCertificate), _socket(server, flags) { init(timeout); } /// Set timeout to the given value in milliseconds. void setTimeout(Milliseconds timeout) { _socket.setTimeout(timeout); } /// Returns the current value for timeout in milliseconds. Milliseconds getTimeout() const { return _socket.getTimeout(); } void close() { _socket.close(); } bool beginConnect(const AddrInfo& addrinfo) { return _socket.beginConnect(addrinfo); } bool beginConnect(const std::string& ipaddr, unsigned short int port) { return _socket.beginConnect(ipaddr, port); } void endConnect() { _socket.endConnect(); } void connect(const AddrInfo& addrinfo) { _socket.connect(addrinfo); } void connect(const std::string& ipaddr, unsigned short int port) { _socket.connect(ipaddr, port); } void accept(const TcpServer& server, unsigned flags = 0) { _socket.accept(server, flags); } std::string getSockAddr() const { return _socket.getSockAddr(); } std::string getPeerAddr() const { return _socket.getPeerAddr(); } bool isConnected() const { return _socket.isConnected(); } bool isSslConnected() const { return _socket.isSslConnected(); } int getFd() const { return _socket.getFd(); } void loadSslCertificateFile(const std::string& certFile, const std::string& privateKeyFile = std::string()) { _socket.loadSslCertificateFile(certFile, privateKeyFile); } void setSslVerify(int level, const std::string& ca = std::string()) { _socket.setSslVerify(level, ca); } bool hasSslPeerCertificate() const { return _socket.hasSslPeerCertificate(); } const SslCertificate& getSslPeerCertificate() const { return _socket.getSslPeerCertificate(); } // initiates a ssl connection on the socket void sslConnect() { _socket.sslConnect(); } void beginSslConnect() { _socket.beginSslConnect(); } void endSslConnect() { _socket.endSslConnect(); } // accept a ssl connection from the peer void sslAccept() { _socket.sslAccept(); } void beginSslAccept() { _socket.beginSslAccept(); } void endSslAccept() { _socket.endSslAccept(); } // terminates ssl void sslShutdown() { _socket.sslShutdown(); } void beginSslShutdown() { _socket.beginSslShutdown(); } void endSslShutdown() { _socket.endSslShutdown(); } TcpSocket& socket() { return _socket; } /** @brief Notifies about available data This signal is send when the Socket is monitored in a Selector or EventLoop and data becomes available. The system must call beginRead() to monitor the tcpstream for reading. After the signal is received, data is available in the stream or in case of disconnection, reading fails. */ Signal<TcpStream&> inputReady; /** @brief Notifies when data can be written This signal is send when the Socket is monitored in a Selector or EventLoop and the device is ready to write data. */ Signal<TcpStream&> outputReady; /** @brief Notifies when the device is connected after beginConnect */ Signal<TcpStream&> connected; /** @brief Notifies when the device is closed while no reading or writing is pending */ Signal<TcpStream&> closed; Signal<TcpStream&> sslAccepted; Signal<TcpStream&> sslConnected; Signal<TcpStream&> sslClosed; Delegate<bool, const SslCertificate&>& acceptSslCertificate; private: TcpSocket _socket; void onInput(IODevice&); void onOutput(IODevice&); void onConnected(TcpSocket&); void onClosed(TcpSocket&); void onSslAccepted(TcpSocket&); void onSslConnected(TcpSocket&); void onSslClosed(TcpSocket&); }; typedef TcpStream iostream; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_TCPSTREAM_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/uri.h�������������������������������������������������������������0000664�0001750�0001750�00000012436�13644433072�015242� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_URI_H #define CXXTOOLS_NET_URI_H #include <string> namespace cxxtools { namespace net { /** The Uri class represents a uniform resource identifier. A Uri is used to identify a web resource. This class can parse a string to split a uri into his parts or build a string from parts of the uri. The syntax of a uri is: \verbatim <scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ] \endverbatim A example is here: \verbatim foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose \_/ \______/ \______/ \_________/ \__/ \__________________/ \______________________/ \__/ | | | | | | | | user password hostname port path query fragment | schema/protocol \endverbatim Example use: \code cxxtools::Uri u("http://www.tntnet.org/index.html"); std::cout << "host=" << u.host() << std::endl; // prints www.tntnet.org u.path("cxxtools.html"); std::cout << "new uri " << u.str() << std::endl; // prints http://www.tntnet.org/cxxtools.html \endcode */ class Uri { bool _ipv6; std::string _protocol; std::string _user; std::string _password; std::string _host; unsigned short int _port; std::string _path; std::string _query; std::string _fragment; void parse(const char* str); public: /// Creates an empty Uri. Uri() : _ipv6(false), _port(0) { } /// Parses the string str and set the elements of the Uri. Uri(const std::string& str) : _ipv6(false), _port(0) { parse(str.c_str()); } Uri(const char* str) : _ipv6(false), _port(0) { parse(str); } /// Sets the protocol part of the Uri. void protocol(const std::string& protocol) { _protocol = protocol; } /// Returns the protocol part of the Uri. const std::string& protocol() const { return _protocol; } /// Sets the user part of the Uri. void user(const std::string& user) { _user = user; } /// Returns the user part of the Uri. const std::string& user() const { return _user; } /// Sets the password part of the Uri. void password(const std::string& password) { _password = password; } /// Returns the password part of the Uri. const std::string& password() const { return _password; } /// Sets the host part of the Uri. void host(const std::string& host) { _host = host; } /// Returns the host part of the Uri. const std::string& host() const { return _host; } /// Sets the port part of the Uri. void port(unsigned short int p) { _port = p; } /// Returns the port part of the Uri. unsigned short int port() const { return _port; } /// Sets the path part of the Uri. void path(const std::string& path) { _path = path; } /// Returns the path part of the Uri. const std::string& path() const { return _path; } /// Sets the query part of the Uri. void query(const std::string& query) { _query = query; } /// Returns the query part of the Uri. const std::string& query() const { return _query; } /// Sets the fragment part of the Uri. void fragment(const std::string& fragment) { _fragment = fragment; } /// Returns the fragment part of the Uri. const std::string& fragment() const { return _fragment; } /// Returns the Uri as a string. /// /// All optional parts are left out. The standard ports of http (80), https (443) and ftp (21) are also omitted. std::string str() const; }; } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/net/udp.h�������������������������������������������������������������0000664�0001750�0001750�00000005564�13644433072�015237� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_UDP_H #define CXXTOOLS_NET_UDP_H #include <cxxtools/net/net.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> namespace cxxtools { namespace net { class UdpSender : public Socket { bool connected; public: typedef size_t size_type; UdpSender() : connected(false) { } UdpSender(const std::string& ipaddr, unsigned short int port, bool bcast = false); void connect(const std::string& ipaddr, unsigned short int port, bool bcast = false); bool isConnected() const { return connected; } size_type send(const void* message, size_type length, int flags = 0) const; size_type send(const std::string& message, int flags = 0) const; size_type recv(void* buffer, size_type length, int flags = 0) const; std::string recv(size_type length, int flags = 0) const; }; class UdpReceiver : public Socket { struct sockaddr_storage peeraddr; socklen_t peeraddrLen; public: typedef size_t size_type; UdpReceiver(); UdpReceiver(const std::string& ipaddr, unsigned short int port); void bind(const std::string& ipaddr, unsigned short int port); size_type recv(void* buffer, size_type length, int flags = 0); std::string recv(size_type length, int flags = 0); size_type send(const void* message, size_type length, int flags = 0) const; size_type send(const std::string& message, int flags = 0) const; }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_UDP_H ��������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/refcounted.h����������������������������������������������������������0000664�0001750�0001750�00000004432�13644433072�016010� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REFCOUNTED_H #define CXXTOOLS_REFCOUNTED_H #include <atomic> namespace cxxtools { class SimpleRefCounted { unsigned rc; public: SimpleRefCounted() : rc(0) { } explicit SimpleRefCounted(unsigned refs_) : rc(refs_) { } virtual ~SimpleRefCounted() { } virtual unsigned addRef() { return ++rc; } virtual unsigned release() { return --rc; } unsigned refs() const { return rc; } }; class AtomicRefCounted { std::atomic<unsigned> rc; public: AtomicRefCounted() : rc(0) { } explicit AtomicRefCounted(unsigned refs_) : rc(refs_) { } virtual ~AtomicRefCounted() { } virtual unsigned addRef() { return ++rc; } virtual unsigned release() { return --rc; } unsigned refs() const { return rc; } }; typedef SimpleRefCounted RefCounted; } #endif // CXXTOOLS_REFCOUNTED_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/include/cxxtools/limitstream.h���������������������������������������������������������0000664�0001750�0001750�00000030736�13644433072�016212� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2014 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LIMITSTREAM_H #define CXXTOOLS_LIMITSTREAM_H #include <iostream> #include <algorithm> namespace cxxtools { /** The class implements a stream buffer, which reads or writes from another streambuffer but limits the number of characters. There are separate counters for reading and writing. They may be reset whenever needed. A buffer is used for reading. It is not guaranteed, that characters not yet read from this stream buffer can be read from the underlying stream buffer. */ template <typename char_type> class BasicLimitStreambuf : public std::basic_streambuf<char_type> { std::basic_streambuf<char_type>* _sb; unsigned _icount; unsigned _ocount; unsigned _ibufsize; char_type* _ibuffer; typedef typename std::basic_streambuf<char_type>::traits_type traits_type; typedef typename std::basic_streambuf<char_type>::int_type int_type; public: /// initialize a BasicLimitStreambuf with a underlying stream. BasicLimitStreambuf(std::basic_streambuf<char_type>* sb, unsigned icount, unsigned ocount, unsigned ibufsize = 8192) : _sb(sb), _icount(icount), _ocount(ocount), _ibufsize(ibufsize), _ibuffer(0) { } ~BasicLimitStreambuf() { delete[] _ibuffer; } /// returns the number of remaining characters to read including characters in the buffer. unsigned icount() const { return _icount + (this->egptr() - this->gptr()); } /// sets the number of remaining characters to read. /// When there are characters in the buffer already, they are not counted /// i.e. when there are 10 bytes in the buffer the call to icount(20) /// leads to actually 30 bytes to read. void icount(unsigned c) { _icount = c; } /// returns the number of remaining characters to write. unsigned ocount() const { return _ocount; } /// sets the number of remaining characters to write. void ocount(unsigned c) { _ocount = c; } /// returns the underlying stream buffer. std::basic_streambuf<char_type>* streambuf() { return _sb; } /// sets the underlying stream buffer. void attach(std::basic_streambuf<char_type>* s) { _sb = s; } protected: char_type* ibuffer() { if (_ibuffer == 0) _ibuffer = new char_type[_ibufsize]; return _ibuffer; } std::streamsize showmanyc() { if (this->gptr() == this->egptr() && _icount > 0) { std::streamsize n = _sb->in_avail(); if (n > 0) { n = _sb->sgetn(ibuffer(), std::min(static_cast<std::streamsize>(_icount), n)); this->setg(_ibuffer, _ibuffer, _ibuffer + n); _icount -= n; } } return this->egptr() - this->gptr(); } int_type overflow(int_type ch) { if (ch != traits_type::eof() && _ocount > 0) { int r = _sb->sputc(traits_type::to_char_type(ch)); if (r == traits_type::eof()) return traits_type::eof(); --_ocount; return traits_type::not_eof(ch); } return traits_type::eof(); } int_type underflow() { if (_icount == 0) return traits_type::eof(); std::streamsize c = _sb->sgetn(ibuffer(), std::min(_icount, _ibufsize)); if (c == 0) return traits_type::eof(); _icount -= c; this->setg(_ibuffer, _ibuffer, _ibuffer + c); return this->sgetc(); } int sync() { return 0; } }; /** The class implements a input stream, which limits the number of characters to read. When trying to read more than the specified number of characters, eof is reported. */ template <typename char_type> class BasicLimitIStream : public std::basic_istream<char_type> { BasicLimitStreambuf<char_type> _streambuf; public: /// Initialize a limiting input stream using a underlying input stream /// and the number of characters to read. explicit BasicLimitIStream(std::basic_istream<char_type>& source, unsigned count = 0) : std::basic_istream<char_type>(0), _streambuf(source.rdbuf(), count, 0) { std::basic_istream<char_type>::init(&_streambuf); } /// Initialize a limiting input stream using a underlying stream buffer /// and the number of characters to read. BasicLimitIStream(std::basic_streambuf<char_type>* source, unsigned count = 0) : std::basic_istream<char_type>(0), _streambuf(source, count, 0) { std::basic_istream<char_type>::init(&_streambuf); } /// returns the number of remaining characters to read. unsigned icount() const { return _streambuf.icount(); } /// sets the number of remaining characters to read. void icount(unsigned c) { _streambuf.icount(c); } /// sets the underlying stream buffer. void attach(std::basic_istream<char_type>& s) { _streambuf.attach(s.rdbuf()); } /// sets the underlying stream buffer. void attach(std::basic_streambuf<char_type>* s) { _streambuf.attach(s); } }; /** The class implements a output stream, which limits the number of characters to write. When trying to write more than the specified number of characters, eof is reported. */ template <typename char_type> class BasicLimitOStream : public std::basic_ostream<char_type> { BasicLimitStreambuf<char_type> _streambuf; public: /// Initialize a limiting output stream using a underlying output stream /// and the number of characters to write. explicit BasicLimitOStream(std::basic_ostream<char_type>& sink, unsigned count = 0) : std::basic_ostream<char_type>(0), _streambuf(sink.rdbuf(), 0, count) { std::basic_ostream<char_type>::init(&_streambuf); } /// Initialize a limiting output stream using a underlying stream buffer /// and the number of characters to write. explicit BasicLimitOStream(std::basic_streambuf<char_type>* sink, unsigned count = 0) : std::basic_ostream<char_type>(0), _streambuf(sink, 0, count) { std::basic_ostream<char_type>::init(&_streambuf); } /// sets the number of remaining characters to write. unsigned ocount() const { return _streambuf.ocount(); } /// returns the number of remaining characters to write. void ocount(unsigned c) { _streambuf.ocount(c); } /// sets the underlying stream buffer. void attach(std::basic_ostream<char_type>& s) { _streambuf.attach(s.rdbuf()); } /// sets the underlying stream buffer. void attach(std::basic_streambuf<char_type>* s) { _streambuf.attach(s); } }; /** This class implements a input/output stream, which limits the number of characters to read and write. */ template <typename char_type> class BasicLimitIOStream : public std::basic_iostream<char_type> { BasicLimitStreambuf<char_type> _streambuf; public: /// Initialize a limiting I/O stream using a underlying output stream, /// the number of characters to read and the number of characters to write. BasicLimitIOStream(std::basic_iostream<char_type>& sinksource, unsigned icount, unsigned ocount) : std::basic_iostream<char_type>(0), _streambuf(sinksource.rdbuf(), icount, ocount) { std::basic_iostream<char_type>::init(&_streambuf); } /// Initialize a limiting I/O stream using a underlying output stream. /// The number of characters to read and the number of characters to write are initialized to 0. BasicLimitIOStream(std::basic_iostream<char_type>& sinksource) : std::basic_iostream<char_type>(0), _streambuf(sinksource.rdbuf(), 0, 0) { std::basic_iostream<char_type>::init(&_streambuf); } /// Initialize a limiting I/O stream using a underlying stream buffer, /// the number of characters to read and the number of characters to write. BasicLimitIOStream(std::basic_streambuf<char_type>* sinksource, unsigned icount, unsigned ocount) : std::basic_iostream<char_type>(0), _streambuf(sinksource, icount, ocount) { std::basic_iostream<char_type>::init(&_streambuf); } /// Initialize a limiting I/O stream using a underlying stream buffer. /// The number of characters to read and the number of characters to write are initialized to 0. BasicLimitIOStream(std::basic_streambuf<char_type>* sinksource) : std::basic_iostream<char_type>(0), _streambuf(sinksource, 0, 0) { std::basic_iostream<char_type>::init(&_streambuf); } /// returns the number of remaining characters to read. unsigned icount() const { return _streambuf.icount(); } /// sets the number of remaining characters to read. void icount(unsigned c) { _streambuf.icount(c); } /// returns the number of remaining characters to write. unsigned ocount() const { return _streambuf.ocount(); } /// sets the number of remaining characters to write. void ocount(unsigned c) { _streambuf.ocount(c); } /// sets the underlying stream buffer. void attach(std::basic_iostream<char_type>& s) { _streambuf.attach(s.rdbuf()); } /// sets the underlying stream buffer. void attach(std::basic_streambuf<char_type>* s) { _streambuf.attach(s); } }; typedef BasicLimitStreambuf<char> LimitStreambuf; typedef BasicLimitIStream<char> LimitIStream; typedef BasicLimitOStream<char> LimitOStream; typedef BasicLimitIOStream<char> LimitIOStream; } #endif // CXXTOOLS_LIMITSTREAM_H ����������������������������������cxxtools-3.0/include/cxxtools/remoteresult.h��������������������������������������������������������0000664�0001750�0001750�00000005777�13644433072�016421� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Dr. Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTERESULT_H #define CXXTOOLS_REMOTERESULT_H #include <string> #include <cxxtools/remoteclient.h> #include <cxxtools/remoteexception.h> namespace cxxtools { class IRemoteResult { public: IRemoteResult() : _failed(false), _rc(0) { } void setFault(int rc, const std::string& msg) { _failed = true; _rc = rc; _msg = msg; } void clearFault() { _failed = false; _rc = 0; _msg.clear(); } bool failed() const { return _failed; } protected: void checkFault() const { if (_failed) throw RemoteException(_msg, _rc); } private: bool _failed; int _rc; std::string _msg; }; template <typename R> class RemoteResult : public IRemoteResult { public: RemoteResult() : _client(0) { } explicit RemoteResult(RemoteClient& client) : _client(&client) { } const R& value() const { return _result; } R& value() { return _result; } #if __cplusplus >= 201103L R&& get() { _client->endCall(); checkFault(); return std::move(_result); } #else R& get() { _client->endCall(); checkFault(); return _result; } #endif RemoteClient& client() { return *_client; } private: RemoteClient* _client; R _result; }; } #endif �cxxtools-3.0/config.guess���������������������������������������������������������������������������0000755�0001750�0001750�00000126173�13644433103�012513� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # This file 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; either version 3 of the License, or # (at your option) any later version. # # 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. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 set_cc_for_build() { : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu set_cc_for_build cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" case `isainfo -b` in 32) echo i386-pc-solaris2"$UNAME_REL" ;; 64) echo x86_64-pc-solaris2"$UNAME_REL" ;; esac exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <<EOF NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize the system type. Please install a C compiler and try again. EOF ;; esac cat >&2 <<EOF This script (version $timestamp), has failed to recognize the operating system you are using. If your script is old, overwrite *all* copies of config.guess and config.sub with the latest versions from: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub If $0 has already been updated, send the following data and any information you think might be pertinent to config-patches@gnu.org to provide the necessary information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/compile��������������������������������������������������������������������������������0000755�0001750�0001750�00000016327�13644433103�011550� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # 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; either version 2, or (at your option) # any later version. # # 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to <bug-automake@gnu.org> or send patches to # <automake-patches@gnu.org>. nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to <bug-automake@gnu.org>. EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/�����������������������������������������������������������������������������0000775�0001750�0001750�00000000000�13672344760�012225� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/cxxtools-xmlrpc.pc.in��������������������������������������������������������0000664�0001750�0001750�00000000416�13644433072�016257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-xmlrpc Description: A toolbox with reusable C++ components - XMLRPC package Version: @PACKAGE_VERSION@ Requires: cxxtools cxxtools-http Libs: -L${libdir} -lcxxtools-xmlrpc ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/cxxtools-unit.pc.in����������������������������������������������������������0000664�0001750�0001750�00000000375�13644433072�015735� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-unit Description: A toolbox with reusable C++ components - testing library Version: @PACKAGE_VERSION@ Requires: cxxtools Libs: -L${libdir} -lcxxtools-unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/cxxtools.pc.in���������������������������������������������������������������0000664�0001750�0001750�00000000346�13644433072�014756� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools Description: A toolbox with reusable C++ components Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lcxxtools Cflags: -I${includedir} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/cxxtools-bin.pc.in�����������������������������������������������������������0000664�0001750�0001750�00000000376�13644433072�015527� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-bin Description: A toolbox with reusable C++ components - binary RPC package Version: @PACKAGE_VERSION@ Requires: cxxtools Libs: -L${libdir} -lcxxtools-bin ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/cxxtools-http.pc.in����������������������������������������������������������0000664�0001750�0001750�00000000412�13644433072�015725� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-http Description: A toolbox with reusable C++ components - HTTP protocol implementation Version: @PACKAGE_VERSION@ Requires: cxxtools Libs: -L${libdir} -lcxxtools-http ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/pkgconfig/cxxtools-json.pc.in����������������������������������������������������������0000664�0001750�0001750�00000000410�13644433072�015715� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-json Description: A toolbox with reusable C++ components - JSON package Version: @PACKAGE_VERSION@ Requires: cxxtools cxxtools-http Libs: -L${libdir} -lcxxtools-json ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/INSTALL��������������������������������������������������������������������������������0000644�0001750�0001750�00000036614�13644433103�011224� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '<wchar.h>' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. ��������������������������������������������������������������������������������������������������������������������cxxtools-3.0/depcomp��������������������������������������������������������������������������������0000755�0001750�0001750�00000056020�13644433103�011541� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # 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; either version 2, or (at your option) # any later version. # 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to <bug-automake@gnu.org>. EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/������������������������������������������������������������������������������������0000775�0001750�0001750�00000000000�13672344760�010576� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/ax_cxx_compile_stdcxx_11.m4���������������������������������������������������������0000664�0001750�0001750�00000011275�13644433072�015660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXXFLAGS to enable support. # # The first argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The second argument, if specified 'mandatory' or if left unspecified, # indicates that baseline C++11 support is required and that the macro # should error out if no mode with that support is found. If specified # 'optional', then configuration proceeds regardless, after defining # HAVE_CXX11 if and only if a supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com> # Copyright (c) 2012 Zack Weinberg <zackw@panix.com> # Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu> # Copyright (c) 2014 Alexey Sokolov <sokolov@google.com> # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 4 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ template <typename T> struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; struct Base { virtual void f() {} }; struct Child : public Base { virtual void f() override {} }; typedef check<check<bool>> right_angle_brackets; int a; decltype(a) b; typedef check<int> check_type; check_type c; check_type&& cr = static_cast<check_type&&>(c); auto d = a; auto l = [](){}; ]]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl m4_if([$1], [], [], [$1], [ext], [], [$1], [noext], [], [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], [$2], [optional], [ax_cxx_compile_cxx11_required=false], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])]) AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++11 features by default, ax_cv_cxx_compile_cxx11, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [ax_cv_cxx_compile_cxx11=yes], [ax_cv_cxx_compile_cxx11=no])]) if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi m4_if([$1], [noext], [], [dnl if test x$ac_success = xno; then for switch in -std=gnu++11 -std=gnu++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) m4_if([$1], [ext], [], [dnl if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) fi else if test x$ac_success = xno; then HAVE_CXX11=0 AC_MSG_NOTICE([No compiler with C++11 support was found]) else HAVE_CXX11=1 AC_DEFINE(HAVE_CXX11,1, [define if the compiler supports basic C++11 syntax]) fi AC_SUBST(HAVE_CXX11) fi ]) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/iconv.m4����������������������������������������������������������������������������0000664�0001750�0001750�00000005636�13644433072�012102� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. Modified by Tommi Mäkitalo AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCICONV" LIBICONV=-liconv AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include <stdlib.h> #include <iconv.h> extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) ��������������������������������������������������������������������������������������������������cxxtools-3.0/m4/ltversion.m4������������������������������������������������������������������������0000644�0001750�0001750�00000001273�13644433101�012771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/ax_check_compile_flag.m4������������������������������������������������������������0000664�0001750�0001750�00000006251�13644433072�015224� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> # # 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, either version 3 of the License, or (at your # option) any later version. # # 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. # # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/lt~obsolete.m4����������������������������������������������������������������������0000644�0001750�0001750�00000013774�13644433101�013327� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) ����cxxtools-3.0/m4/ltsugar.m4��������������������������������������������������������������������������0000644�0001750�0001750�00000010440�13644433101�012421� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/libtool.m4��������������������������������������������������������������������������0000644�0001750�0001750�00001125306�13644433101�012415� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test no != "$with_gnu_ld" && break ;; *) test yes != "$with_gnu_ld" && break ;; esac fi done IFS=$lt_save_ifs else lt_cv_path_LD=$LD # Let the user override the test with a path. fi]) LD=$lt_cv_path_LD if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) _LT_PATH_LD_GNU AC_SUBST([LD]) _LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) ])# LT_PATH_LD # Old names: AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_LD], []) dnl AC_DEFUN([AC_PROG_LD], []) # _LT_PATH_LD_GNU #- -------------- m4_defun([_LT_PATH_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac]) with_gnu_ld=$lt_cv_prog_gnu_ld ])# _LT_PATH_LD_GNU # _LT_CMD_RELOAD # -------------- # find reload flag for linker # -- PORTME Some linkers may need a different reload flag. m4_defun([_LT_CMD_RELOAD], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD # _LT_PATH_DD # ----------- # find a working dd m4_defun([_LT_PATH_DD], [AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/ltoptions.m4������������������������������������������������������������������������0000644�0001750�0001750�00000034262�13644433101�013003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/acx_pthread.m4����������������������������������������������������������������������0000664�0001750�0001750�00000022417�13644433072�013242� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl @summary figure out how to build C programs using POSIX threads dnl dnl This macro figures out how to build C programs using POSIX threads. dnl It sets the PTHREAD_LIBS output variable to the threads library and dnl linker flags, and the PTHREAD_CFLAGS output variable to any special dnl C compiler flags that are needed. (The user can also force certain dnl compiler flags/libs to be tested by setting these environment dnl variables.) dnl dnl Also sets PTHREAD_CC to any special C compiler that is needed for dnl multi-threaded programs (defaults to the value of CC otherwise). dnl (This is necessary on AIX to use the special cc_r compiler alias.) dnl dnl NOTE: You are assumed to not only compile your program with these dnl flags, but also link it with them as well. e.g. you should link dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS dnl $LIBS dnl dnl If you are only building threads programs, you may wish to use dnl these variables in your default LIBS, CFLAGS, and CC: dnl dnl LIBS="$PTHREAD_LIBS $LIBS" dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" dnl CC="$PTHREAD_CC" dnl dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a threads dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the dnl default action will define HAVE_PTHREAD. dnl dnl Please let the authors know if this macro fails on any platform, or dnl if you have any other suggestions or comments. This macro was based dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. dnl We are also grateful for the helpful feedback of numerous users. dnl dnl @category InstalledPackages dnl @author Steven G. Johnson <stevenj@alum.mit.edu> dnl @version 2005-06-15 dnl @license GPLWithACException AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads -mt --thread-safe pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads -mt pthread -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include <pthread.h>], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) AC_CHECK_PROG(PTHREAD_CXX, CC_r, CC_r, ${CXX}) else PTHREAD_CC="$CC" PTHREAD_CXX="$CXX" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) AC_SUBST(PTHREAD_CXX) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-3.0/m4/ax_compiler_vendor.m4���������������������������������������������������������������0000664�0001750�0001750�00000006616�13644433072�014642� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS # # AX_COMPILER_VENDOR # # DESCRIPTION # # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, # watcom, etc. The vendor is returned in the cache variable # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2008 Matteo Frigo # # 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, either version 3 of the License, or (at your # option) any later version. # # 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. # # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 11 AC_DEFUN([AX_COMPILER_VENDOR], [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [# note: don't check for gcc first since some other compilers define __GNUC__ vendors="intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__TURBOC__ comeau: __COMO__ cray: _CRAYC kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ portland: __PGI unknown: UNKNOWN" for ventest in $vendors; do case $ventest in *:) vendor=$ventest; continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ #if !($vencpp) thisisanerror; #endif ])], [break]) done ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` ]) ]) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������